From 2a7e0a624f482a28af1c770dbcf2a20f52f94f78 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Sun, 19 Apr 2015 03:30:08 +0100 Subject: Added Midas Touch --- .../.history/0/60c4594705e50014174fe663e69b8422 | 61 ++ .../.history/0/805d1a320cde00141043c3025ec60dfc | 186 ----- .../.history/0/f026d60e2de60014127dc373d78c1666 | 78 +++ .../.history/1/207a58e4fde40014174fe663e69b8422 | 65 ++ .../.history/1/20a8ecb810e60014127dc373d78c1666 | 585 ++++++++++++++++ .../.history/1/806717930fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/1/f0fa8fa8cfdf00141dc6c962aec96210 | 102 --- .../.history/10/202fc46ed0df00141dc6c962aec96210 | 87 --- .../.history/10/803b287d0cde00141043c3025ec60dfc | 66 -- .../.history/10/d02d52592dde00141043c3025ec60dfc | 106 --- .../.history/10/f023f9b6fce40014174fe663e69b8422 | 66 ++ .../.history/11/10e3134797e3001412c4c4819c88e86b | 75 ++ .../.history/11/80418fb197e3001412c4c4819c88e86b | 75 ++ .../.history/11/80d06da024e60014127dc373d78c1666 | 74 ++ .../.history/12/0037843510e60014127dc373d78c1666 | 581 ++++++++++++++++ .../.history/12/208b7b02fce40014174fe663e69b8422 | 64 ++ .../.history/12/c07337da02e50014174fe663e69b8422 | 57 ++ .../.history/12/e0e3109acfdf00141dc6c962aec96210 | 102 --- .../.history/13/40a0b31607e50014174fe663e69b8422 | 96 +++ .../.history/13/503edced25e60014127dc373d78c1666 | 97 +++ .../.history/13/800cba6310e60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/13/a08d42f22dde00141043c3025ec60dfc | 107 --- .../.history/14/700de6a60fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/15/506cbafe2be60014127dc373d78c1666 | 81 +++ .../.history/15/607a0b0a28de00141043c3025ec60dfc | 465 ------------- .../.history/15/a002d0b6cedf00141dc6c962aec96210 | 87 --- .../.history/17/f0ded3dbcedf00141dc6c962aec96210 | 185 ----- .../.history/18/0027527092e3001417b2e384bf7c3702 | 27 + .../.history/18/00a2b6defce40014174fe663e69b8422 | 65 ++ .../.history/18/80383f3671e300141084bb8bfb075c08 | 72 ++ .../.history/18/908e94da36e100141e1cc3c3be242e56 | 454 ++++++++++++ .../.history/18/a049720d0be60014127dc373d78c1666 | 94 +++ .../.history/1a/006abc9323e60014127dc373d78c1666 | 76 +++ .../.history/1a/706949a171e300141084bb8bfb075c08 | 75 ++ .../.history/1b/10513bc210e60014127dc373d78c1666 | 585 ++++++++++++++++ .../.history/1c/501314b626de00141043c3025ec60dfc | 105 --- .../.history/1c/a0cc56d4fbe40014174fe663e69b8422 | 68 ++ .../.history/1c/c0982a0792e3001417b2e384bf7c3702 | 26 + .../.history/1c/d012a06acedf00141dc6c962aec96210 | 87 --- .../.history/1d/3003c407fee40014174fe663e69b8422 | 65 ++ .../.history/1d/c0db3b8431e100141e1cc3c3be242e56 | 60 ++ .../.history/1e/f08e283892e3001417b2e384bf7c3702 | 26 + .../.history/1f/4094f8e609de00141043c3025ec60dfc | 184 ----- .../.history/1f/60cb78e111e60014127dc373d78c1666 | 590 ++++++++++++++++ .../.history/2/003d2b0505de00141043c3025ec60dfc | 279 -------- .../.history/2/20405a71ccdf00141dc6c962aec96210 | 96 --- .../.history/2/304b2ee02be60014127dc373d78c1666 | 80 +++ .../.history/2/4002026028de00141043c3025ec60dfc | 465 ------------- .../.history/2/607789ae0fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/2/609f909029de00141043c3025ec60dfc | 122 ---- .../.history/2/700a88ac90e3001417b2e384bf7c3702 | 54 ++ .../.history/2/a0d5c9a72bde00141043c3025ec60dfc | 121 ---- .../.history/20/5081dc2706de00141043c3025ec60dfc | 123 ---- .../.history/20/703581a771e300141084bb8bfb075c08 | 56 ++ .../.history/21/1057f5e202e60014127dc373d78c1666 | 84 +++ .../.history/21/30a1626704de00141043c3025ec60dfc | 278 -------- .../.history/21/30f15f9026e60014127dc373d78c1666 | 69 ++ .../.history/21/801465eccbdf00141dc6c962aec96210 | 98 --- .../.history/22/705d9b5b23e60014127dc373d78c1666 | 75 ++ .../.history/22/c036359431e100141e1cc3c3be242e56 | 12 + .../.history/22/c083e9b42bde00141043c3025ec60dfc | 122 ---- .../.history/23/00c5f4c902de00141043c3025ec60dfc | 131 ---- .../.history/23/7059c98a6edd001412dce27813e7be4a | 108 --- .../.history/23/90e61b1372e300141084bb8bfb075c08 | 37 + .../.history/24/609d74fbfde40014174fe663e69b8422 | 46 ++ .../.history/25/102009133ce100141e1cc3c3be242e56 | 26 + .../.history/25/300cc20804e60014127dc373d78c1666 | 94 +++ .../.history/25/a0aafa332de60014127dc373d78c1666 | 78 +++ .../.history/26/803e9d8d04e50014174fe663e69b8422 | 61 ++ .../.history/26/902ed2a826e60014127dc373d78c1666 | 74 ++ .../.history/27/00520c9504e50014174fe663e69b8422 | 61 ++ .../.history/27/40a4e6b92be60014127dc373d78c1666 | 80 +++ .../.history/27/a01776bcfde50014127dc373d78c1666 | 0 .../.history/28/30de043304de00141043c3025ec60dfc | 278 -------- .../.history/28/40247e5d2dde00141043c3025ec60dfc | 106 --- .../.history/28/809e116607e50014174fe663e69b8422 | 63 ++ .../.history/28/9027920627de00141043c3025ec60dfc | 105 --- .../.history/28/a04b7a8e91e3001417b2e384bf7c3702 | 25 + .../.history/28/b0c118102dde00141043c3025ec60dfc | 105 --- .../.history/29/6015a33bd1df00141dc6c962aec96210 | 122 ---- .../.history/29/707801098ee3001417b2e384bf7c3702 | 24 + .../.history/29/80b60a3e27e60014127dc373d78c1666 | 70 ++ .../.history/29/c011836acadf00141dc6c962aec96210 | 94 --- .../.history/2a/c026412f36e100141e1cc3c3be242e56 | 62 ++ .../.history/2a/d0f34296e1e50014109ec019d2f6c0dc | 60 ++ .../.history/2b/0026ada605e50014174fe663e69b8422 | 60 ++ .../.history/2b/703a47a523e60014127dc373d78c1666 | 76 +++ .../.history/2c/809d0e09cddf00141dc6c962aec96210 | 85 --- .../.history/2c/b0ae616ecedf00141dc6c962aec96210 | 87 --- .../.history/2d/106f70bf01e60014127dc373d78c1666 | 41 ++ .../.history/2d/50f61c022bde00141043c3025ec60dfc | 466 ------------- .../.history/2d/c06ef67e91e3001417b2e384bf7c3702 | 25 + .../.history/2e/c00d944e2de60014127dc373d78c1666 | 78 +++ .../.history/2e/e03f878f72e300141084bb8bfb075c08 | 54 ++ .../.history/2f/10f36a6990e3001417b2e384bf7c3702 | 36 + .../.history/2f/50d498da36e100141e1cc3c3be242e56 | 62 ++ .../.history/2f/c07570fc8de3001417b2e384bf7c3702 | 24 + .../.history/3/20e2ed160cde00141043c3025ec60dfc | 186 ----- .../.history/3/b00f12e436e100141e1cc3c3be242e56 | 62 ++ .../.history/30/1096a2fac8df00141dc6c962aec96210 | 93 --- .../.history/30/604048aa00e50014174fe663e69b8422 | 53 ++ .../.history/30/608a239c29e60014127dc373d78c1666 | 24 + .../.history/30/70358e7c0fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/31/201793702dde00141043c3025ec60dfc | 106 --- .../.history/31/204db0c810e60014127dc373d78c1666 | 585 ++++++++++++++++ .../.history/31/30675ea024e60014127dc373d78c1666 | 96 +++ .../.history/31/e04866d3fde50014127dc373d78c1666 | 12 + .../.history/31/f02810b507de00141043c3025ec60dfc | 183 ----- .../.history/32/206828078de3001417b2e384bf7c3702 | 37 + .../.history/32/30ca78699ae3001412c4c4819c88e86b | 86 +++ .../.history/32/50aa567f09e50014174fe663e69b8422 | 65 ++ .../.history/32/609ee512cfdf00141dc6c962aec96210 | 109 --- .../.history/33/50d8454d2ce60014127dc373d78c1666 | 80 +++ .../.history/33/808ebec629de00141043c3025ec60dfc | 466 ------------- .../.history/33/f001bde393e3001412c4c4819c88e86b | 54 ++ .../.history/34/10925bf3cadf00141dc6c962aec96210 | 96 --- .../.history/34/203b62722be60014127dc373d78c1666 | 80 +++ .../.history/35/5069282604e50014174fe663e69b8422 | 58 ++ .../.history/35/60c4bcde2ce60014127dc373d78c1666 | 78 +++ .../.history/36/201a8e4e08e60014127dc373d78c1666 | 60 ++ .../.history/36/4064f9042ce60014127dc373d78c1666 | 81 +++ .../.history/36/70f6390a33e100141e1cc3c3be242e56 | 11 + .../.history/36/a08ceb03fee50014127dc373d78c1666 | 19 + .../.history/37/4027a5e129de00141043c3025ec60dfc | 105 --- .../.history/37/600d023b95e3001412c4c4819c88e86b | 74 ++ .../.history/37/8062bf2107e50014174fe663e69b8422 | 96 +++ .../.history/37/b01358c6fce40014174fe663e69b8422 | 65 ++ .../.history/37/f0613fc4cfdf00141dc6c962aec96210 | 102 --- .../.history/38/10b4162c31e100141e1cc3c3be242e56 | 0 .../.history/38/30cbc9efdde50014109ec019d2f6c0dc | 93 +++ .../.history/38/c01a0a822be60014127dc373d78c1666 | 80 +++ .../.history/38/f0c649af08de00141043c3025ec60dfc | 184 ----- .../.history/39/1068e79a01e60014127dc373d78c1666 | 41 ++ .../.history/39/5031a6ce32e100141e1cc3c3be242e56 | 12 + .../.history/39/60be6d7a67dd001412dce27813e7be4a | 123 ---- .../.history/3a/6000f6390ade00141043c3025ec60dfc | 185 ----- .../.history/3a/900cd0d2ccdf00141dc6c962aec96210 | 79 --- .../.history/3b/10b462f7fce40014174fe663e69b8422 | 65 ++ .../.history/3b/6096e9aedbe50014109ec019d2f6c0dc | 74 ++ .../.history/3b/a06f5eb026de00141043c3025ec60dfc | 105 --- .../.history/3c/209ecde827e60014127dc373d78c1666 | 74 ++ .../.history/3c/20d6830327de00141043c3025ec60dfc | 105 --- .../.history/3d/801c40ebcbdf00141dc6c962aec96210 | 97 --- .../.history/3d/a08b206401e50014174fe663e69b8422 | 55 ++ .../.history/3d/d039874701e50014174fe663e69b8422 | 54 ++ .../.history/3e/309bbd4008de00141043c3025ec60dfc | 183 ----- .../.history/3e/7054379b0fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/3e/70b5b24de0e50014109ec019d2f6c0dc | 57 ++ .../.history/3f/9062eb5626e60014127dc373d78c1666 | 97 +++ .../.history/3f/f026c032fde40014174fe663e69b8422 | 46 ++ .../.history/40/003a974204de00141043c3025ec60dfc | 278 -------- .../.history/40/a03afdd19ae3001412c4c4819c88e86b | 86 +++ .../.history/40/a0d154642be60014127dc373d78c1666 | 80 +++ .../.history/40/c035952b36e100141e1cc3c3be242e56 | 186 +++++ .../.history/41/900c963102e50014174fe663e69b8422 | 55 ++ .../.history/42/f061f27170e300141084bb8bfb075c08 | 12 + .../.history/43/3086cd9311e60014127dc373d78c1666 | 587 ++++++++++++++++ .../.history/44/007d9fbe0ade00141043c3025ec60dfc | 186 ----- .../.history/44/c043415c99e3001412c4c4819c88e86b | 27 + .../.history/44/c04764282ede00141043c3025ec60dfc | 109 --- .../.history/44/c0ddc4bd08e60014127dc373d78c1666 | 60 ++ .../.history/45/6018c4e6fce40014174fe663e69b8422 | 47 ++ .../.history/45/f045d0fb2ede00141043c3025ec60dfc | 108 --- .../.history/46/10ad6cb191e3001417b2e384bf7c3702 | 25 + .../.history/46/60b9df5e2be60014127dc373d78c1666 | 80 +++ .../.history/46/a0709cf62ae60014127dc373d78c1666 | 80 +++ .../.history/46/d01a6b619ce3001412c4c4819c88e86b | 33 + .../.history/47/40949c9f36e100141e1cc3c3be242e56 | 454 ++++++++++++ .../.history/47/6037f46203e60014127dc373d78c1666 | 84 +++ .../.history/48/c00ae4970fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/48/c01e000872e300141084bb8bfb075c08 | 85 +++ .../.history/48/e03e86c12ede00141043c3025ec60dfc | 46 -- .../.history/49/005b61f003e60014127dc373d78c1666 | 94 +++ .../.history/49/10b8eac006e50014174fe663e69b8422 | 63 ++ .../.history/49/40142c73fee50014127dc373d78c1666 | 20 + .../.history/49/e070a9a826e60014127dc373d78c1666 | 27 + .../.history/4a/601566c636e100141e1cc3c3be242e56 | 62 ++ .../.history/4a/608194048ee3001417b2e384bf7c3702 | 24 + .../.history/4a/80a948a2fce40014174fe663e69b8422 | 65 ++ .../.history/4a/a015113e04de00141043c3025ec60dfc | 278 -------- .../.history/4b/009902e3fbe40014174fe663e69b8422 | 64 ++ .../.history/4b/b07b909e26de00141043c3025ec60dfc | 105 --- .../.history/4c/5014ba759ce3001412c4c4819c88e86b | 33 + .../.history/4d/d0cfb46325e60014127dc373d78c1666 | 100 +++ .../.history/4d/f028294b23e60014127dc373d78c1666 | 75 ++ .../.history/4d/f0c241e602e60014127dc373d78c1666 | 193 ++++++ .../.history/4f/a0532f0bfce40014174fe663e69b8422 | 65 ++ .../.history/4f/b06750e295e3001412c4c4819c88e86b | 81 +++ .../.history/5/2064f33d99e3001412c4c4819c88e86b | 28 + .../.history/5/c0c8f29707e50014174fe663e69b8422 | 96 +++ .../.history/5/e0dae57e2ce60014127dc373d78c1666 | 80 +++ .../.history/51/b08acbee01e60014127dc373d78c1666 | 41 ++ .../.history/52/5089f60bfee40014174fe663e69b8422 | 65 ++ .../.history/52/7045388123e60014127dc373d78c1666 | 76 +++ .../.history/52/d0c8245c0fe60014127dc373d78c1666 | 578 ++++++++++++++++ .../.history/53/500f4e3704e50014174fe663e69b8422 | 61 ++ .../.history/53/5094c22ddce50014109ec019d2f6c0dc | 77 +++ .../.history/53/702fad0522e60014127dc373d78c1666 | 195 ++++++ .../.history/53/707860379ce3001412c4c4819c88e86b | 33 + .../.history/53/c056dd602ee60014127dc373d78c1666 | 580 ++++++++++++++++ .../.history/53/e0ac941eccdf00141dc6c962aec96210 | 96 --- .../.history/54/b0dd171b36e100141e1cc3c3be242e56 | 62 ++ .../.history/54/d08a12f794e3001412c4c4819c88e86b | 74 ++ .../.history/55/509f12b8cfdf00141dc6c962aec96210 | 102 --- .../.history/55/70eb2ca3ccdf00141dc6c962aec96210 | 96 --- .../.history/55/b076e5188ee3001417b2e384bf7c3702 | 24 + .../.history/55/f055598098e3001412c4c4819c88e86b | 37 + .../.history/56/604b232936e100141e1cc3c3be242e56 | 206 ++++++ .../.history/56/70418fad26e60014127dc373d78c1666 | 24 + .../.history/57/108313903de100141e1cc3c3be242e56 | 66 ++ .../.history/57/70f03ed40fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/57/90a153b367dd001412dce27813e7be4a | 123 ---- .../.history/57/b095661a2ede00141043c3025ec60dfc | 109 --- .../.history/57/e0bfffad9ce3001412c4c4819c88e86b | 33 + .../.history/58/401fb0e42ae60014127dc373d78c1666 | 80 +++ .../.history/58/c05809292ee60014127dc373d78c1666 | 580 ++++++++++++++++ .../.history/58/d07c98730ade00141043c3025ec60dfc | 185 ----- .../.history/58/d07f51f1e1e50014109ec019d2f6c0dc | 60 ++ .../.history/59/20ea69c702e50014174fe663e69b8422 | 57 ++ .../.history/59/3020e4818ee3001417b2e384bf7c3702 | 82 +++ .../.history/59/5060e6c998e3001412c4c4819c88e86b | 27 + .../.history/59/a0c899f616e60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/59/c078df6404de00141043c3025ec60dfc | 278 -------- .../.history/5b/40a922fbcddf00141dc6c962aec96210 | 87 --- .../.history/5b/5029f1a804de00141043c3025ec60dfc | 278 -------- .../.history/5b/800cb89f9ce3001412c4c4819c88e86b | 33 + .../.history/5c/10c90e0b09e60014127dc373d78c1666 | 61 ++ .../.history/5c/407a4588cadf00141dc6c962aec96210 | 96 --- .../.history/5c/40f3d19e91e3001417b2e384bf7c3702 | 25 + .../.history/5c/70816d6f94e3001412c4c4819c88e86b | 65 ++ .../.history/5c/c05f30bd25e60014127dc373d78c1666 | 24 + .../.history/5d/90359fe194e3001412c4c4819c88e86b | 74 ++ .../.history/5d/a045419026e60014127dc373d78c1666 | 97 +++ .../.history/5e/50be335402e50014174fe663e69b8422 | 56 ++ .../.history/5e/d0d224852ce60014127dc373d78c1666 | 80 +++ .../.history/5e/f0632658c0e50014122af9ad4a560236 | 55 ++ .../.history/5f/30f9e59108de00141043c3025ec60dfc | 184 ----- .../.history/5f/e0ff939e02e60014127dc373d78c1666 | 78 +++ .../.history/6/0065cfc101e50014174fe663e69b8422 | 53 ++ .../.history/6/40b159950ade00141043c3025ec60dfc | 186 ----- .../.history/60/a004e1a8c3e50014122af9ad4a560236 | 55 ++ .../.history/60/f045b1c8fce40014174fe663e69b8422 | 65 ++ .../.history/61/8023076d28de00141043c3025ec60dfc | 465 ------------- .../.history/61/d0336393dee50014109ec019d2f6c0dc | 93 +++ .../.history/61/d0d1c7060cde00141043c3025ec60dfc | 186 ----- .../.history/62/507f105a2ede00141043c3025ec60dfc | 109 --- .../.history/62/c01a61492ede00141043c3025ec60dfc | 109 --- .../.history/63/204cfa240ade00141043c3025ec60dfc | 185 ----- .../.history/63/a0890abe02de00141043c3025ec60dfc | 272 -------- .../.history/63/d03963b82ede00141043c3025ec60dfc | 108 --- .../.history/64/009346bd26de00141043c3025ec60dfc | 105 --- .../.history/64/a0662de901e60014127dc373d78c1666 | 41 ++ .../.history/64/c06ac17c09de00141043c3025ec60dfc | 184 ----- .../.history/65/206e9fbfdce50014109ec019d2f6c0dc | 81 +++ .../.history/65/90070fc8cfdf00141dc6c962aec96210 | 102 --- .../.history/65/d0ebb9bd98e3001412c4c4819c88e86b | 27 + .../.history/66/1063c37f8ee3001417b2e384bf7c3702 | 83 +++ .../.history/66/30591b0b27de00141043c3025ec60dfc | 105 --- .../.history/66/600230f8fde50014127dc373d78c1666 | 193 ++++++ .../.history/66/702cdaf0ccdf00141dc6c962aec96210 | 82 --- .../.history/66/706f7de52ce60014127dc373d78c1666 | 78 +++ .../.history/66/80f33350c9df00141dc6c962aec96210 | 93 --- .../.history/67/502eece29ce3001412c4c4819c88e86b | 95 +++ .../.history/67/8018e58904e50014174fe663e69b8422 | 61 ++ .../.history/67/c0bee05e02e50014174fe663e69b8422 | 56 ++ .../.history/67/d0413c3339e100141e1cc3c3be242e56 | 64 ++ .../.history/67/e0b3c0d50bde00141043c3025ec60dfc | 185 ----- .../.history/67/f076514d01e50014174fe663e69b8422 | 55 ++ .../.history/68/30cad6710ee60014127dc373d78c1666 | 94 +++ .../.history/68/40551ae474e300141084bb8bfb075c08 | 37 + .../.history/68/705ae70e2ce60014127dc373d78c1666 | 81 +++ .../.history/68/9054945503de00141043c3025ec60dfc | 94 --- .../.history/68/a011af0c03e50014174fe663e69b8422 | 57 ++ .../.history/68/a0a1c6429ae3001412c4c4819c88e86b | 86 +++ .../.history/69/10a8e852ffe40014174fe663e69b8422 | 51 ++ .../.history/69/80c87259cadf00141dc6c962aec96210 | 84 --- .../.history/69/f0fb303b0bde00141043c3025ec60dfc | 185 ----- .../.history/6a/00f1323d0cde00141043c3025ec60dfc | 186 ----- .../.history/6b/700e006d95e3001412c4c4819c88e86b | 74 ++ .../.history/6b/8040daa897e3001412c4c4819c88e86b | 75 ++ .../.history/6b/90c73e68dfe50014109ec019d2f6c0dc | 93 +++ .../.history/6b/b02224c467dd001412dce27813e7be4a | 123 ---- .../.history/6c/1001cf0b72e300141084bb8bfb075c08 | 36 + .../.history/6c/408da85a08e60014127dc373d78c1666 | 60 ++ .../.history/6c/801db51c37e100141e1cc3c3be242e56 | 454 ++++++++++++ .../.history/6c/80909a0b36e100141e1cc3c3be242e56 | 63 ++ .../.history/6c/809dbb21fde40014174fe663e69b8422 | 64 ++ .../.history/6d/40cc91f125e60014127dc373d78c1666 | 28 + .../.history/6e/00835d83fde40014174fe663e69b8422 | 65 ++ .../.history/6e/a0449c8093e3001412c4c4819c88e86b | 84 +++ .../.history/6e/a046bebfcfdf00141dc6c962aec96210 | 102 --- .../.history/6e/f0a4797968dd001412dce27813e7be4a | 123 ---- .../.history/6f/70d2e64cfae40014174fe663e69b8422 | 0 .../.history/6f/b0690d9a2be60014127dc373d78c1666 | 80 +++ .../.history/7/10543334ffe40014174fe663e69b8422 | 51 ++ .../.history/7/80707ccf26de00141043c3025ec60dfc | 105 --- .../.history/70/a012e7fa2ae60014127dc373d78c1666 | 80 +++ .../.history/71/60061e9571e300141084bb8bfb075c08 | 72 ++ .../.history/71/80a334f7dee50014109ec019d2f6c0dc | 93 +++ .../.history/71/c0574f9791e3001417b2e384bf7c3702 | 25 + .../.history/72/1087a1e902e50014174fe663e69b8422 | 57 ++ .../.history/72/30500e3137e100141e1cc3c3be242e56 | 454 ++++++++++++ .../.history/72/90d70d9e10e60014127dc373d78c1666 | 585 ++++++++++++++++ .../.history/72/c0e5f1d298e3001412c4c4819c88e86b | 27 + .../.history/72/d04b715902e50014174fe663e69b8422 | 56 ++ .../.history/73/902cfdee91e3001417b2e384bf7c3702 | 26 + .../.history/73/a02269c636e100141e1cc3c3be242e56 | 50 ++ .../.history/73/e02cfa2c2ce60014127dc373d78c1666 | 81 +++ .../.history/73/e0673f4237e100141e1cc3c3be242e56 | 62 ++ .../.history/74/20dad64f2ede00141043c3025ec60dfc | 109 --- .../.history/74/60d7e68b6edd001412dce27813e7be4a | 46 -- .../.history/74/80e1a2afcbdf00141dc6c962aec96210 | 97 --- .../.history/74/a0dd791f2be60014127dc373d78c1666 | 74 ++ .../.history/75/60834d1d9ce3001412c4c4819c88e86b | 26 + .../.history/75/d03da29126de00141043c3025ec60dfc | 105 --- .../.history/76/e089d7410fe60014127dc373d78c1666 | 578 ++++++++++++++++ .../.history/77/103378ed2ae60014127dc373d78c1666 | 80 +++ .../.history/77/603b1e1d20e60014127dc373d78c1666 | 94 +++ .../.history/78/305762850fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/78/90636f1ffde40014174fe663e69b8422 | 65 ++ .../.history/78/f0abd173d0df00141dc6c962aec96210 | 87 --- .../.history/79/70b22b2507e50014174fe663e69b8422 | 96 +++ .../.history/79/b096988c2be60014127dc373d78c1666 | 80 +++ .../.history/7a/1026e96300e60014127dc373d78c1666 | 40 ++ .../.history/7a/10e3c302dee50014109ec019d2f6c0dc | 93 +++ .../.history/7a/30bcf87f94e3001412c4c4819c88e86b | 71 ++ .../.history/7a/402c65f927e500141c50bd6848c69dc6 | 57 ++ .../.history/7a/8029efd19de3001412c4c4819c88e86b | 77 +++ .../.history/7a/9000a4bccadf00141dc6c962aec96210 | 94 --- .../.history/7a/9031349f2dde00141043c3025ec60dfc | 106 --- .../.history/7a/c03fc5e5dde50014109ec019d2f6c0dc | 93 +++ .../.history/7b/50271aa22ce60014127dc373d78c1666 | 78 +++ .../.history/7b/5081b1640fe60014127dc373d78c1666 | 578 ++++++++++++++++ .../.history/7b/6082e39affe50014127dc373d78c1666 | 20 + .../.history/7b/a06388ad26e60014127dc373d78c1666 | 26 + .../.history/7c/b0bc2130cbdf00141dc6c962aec96210 | 97 --- .../.history/7c/f0f277a80ade00141043c3025ec60dfc | 186 ----- .../.history/7d/b0ad63acfde40014174fe663e69b8422 | 46 ++ .../.history/7e/30c7389426de00141043c3025ec60dfc | 105 --- .../.history/7e/50e1e03570e300141084bb8bfb075c08 | 0 .../.history/7e/6040154608de00141043c3025ec60dfc | 184 ----- .../.history/7e/80d136b994e3001412c4c4819c88e86b | 72 ++ .../.history/7f/1085f39501e50014174fe663e69b8422 | 53 ++ .../.history/7f/10e9952ffde40014174fe663e69b8422 | 46 ++ .../.history/8/00f0902b36e100141e1cc3c3be242e56 | 206 ++++++ .../.history/8/40c942690fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/80/c002ba7395e3001412c4c4819c88e86b | 74 ++ .../.history/80/d0f4feb20ade00141043c3025ec60dfc | 186 ----- .../.history/80/e0f236a626de00141043c3025ec60dfc | 105 --- .../.history/81/d03329bd25e60014127dc373d78c1666 | 74 ++ .../.history/82/9020848ffce40014174fe663e69b8422 | 65 ++ .../.history/83/50fcae8bd0df00141dc6c962aec96210 | 87 --- .../.history/83/60276c082de60014127dc373d78c1666 | 78 +++ .../.history/84/00a3c9260cde00141043c3025ec60dfc | 186 ----- .../.history/84/1025655c2bde00141043c3025ec60dfc | 466 ------------- .../.history/84/80aeb7fb26de00141043c3025ec60dfc | 105 --- .../.history/87/209236d010e60014127dc373d78c1666 | 585 ++++++++++++++++ .../.history/87/d06a48742ce60014127dc373d78c1666 | 80 +++ .../.history/89/1013dbafccdf00141dc6c962aec96210 | 96 --- .../.history/89/30156ba910e60014127dc373d78c1666 | 585 ++++++++++++++++ .../.history/89/8044082ffce40014174fe663e69b8422 | 37 + .../.history/89/f01e505a95e3001412c4c4819c88e86b | 74 ++ .../.history/8a/20753b7905de00141043c3025ec60dfc | 23 - .../.history/8a/209ca7a826e60014127dc373d78c1666 | 25 + .../.history/8a/7075f1a529e60014127dc373d78c1666 | 24 + .../.history/8a/90fa117a8de3001417b2e384bf7c3702 | 35 + .../.history/8a/e058c2a396e3001412c4c4819c88e86b | 36 + .../.history/8a/f09ccb8e23e60014127dc373d78c1666 | 76 +++ .../.history/8b/6060ee470fe60014127dc373d78c1666 | 578 ++++++++++++++++ .../.history/8d/10a39f8636e100141e1cc3c3be242e56 | 261 +++++++ .../.history/8d/50e526fb2be60014127dc373d78c1666 | 81 +++ .../.history/8d/d01b82df0bde00141043c3025ec60dfc | 186 ----- .../.history/8d/d0e1834d23e60014127dc373d78c1666 | 74 ++ .../.history/8d/f0467f9a2bde00141043c3025ec60dfc | 466 ------------- .../.history/8e/1088932b36e100141e1cc3c3be242e56 | 62 ++ .../.history/8e/30bf1d4c2dde00141043c3025ec60dfc | 105 --- .../.history/8e/50894d0b33e100141e1cc3c3be242e56 | 191 ++++++ .../.history/8f/907dbd0a2ede00141043c3025ec60dfc | 109 --- .../.history/8f/e0ba42a391e3001417b2e384bf7c3702 | 25 + .../.history/9/b0b8c8a826e60014127dc373d78c1666 | 74 ++ .../.history/90/e0c2b692fce40014174fe663e69b8422 | 65 ++ .../.history/91/70348a9a23e60014127dc373d78c1666 | 76 +++ .../.history/91/90b5ab67fee40014174fe663e69b8422 | 759 +++++++++++++++++++++ .../.history/91/a05f8b8d6edd001412dce27813e7be4a | 121 ---- .../.history/92/e0cafc4603e60014127dc373d78c1666 | 41 ++ .../.history/93/1066a4a395e3001412c4c4819c88e86b | 74 ++ .../.history/93/c006172337e100141e1cc3c3be242e56 | 62 ++ .../.history/93/d022da5e25e60014127dc373d78c1666 | 96 +++ .../.history/94/00e861e202e50014174fe663e69b8422 | 57 ++ .../.history/94/9018c447fde40014174fe663e69b8422 | 65 ++ .../.history/95/1062bc07fee40014174fe663e69b8422 | 48 ++ .../.history/95/20dfbe86fde50014127dc373d78c1666 | 94 +++ .../.history/95/503f48a829de00141043c3025ec60dfc | 465 ------------- .../.history/96/0020beb436e100141e1cc3c3be242e56 | 62 ++ .../.history/96/009ea381fde40014174fe663e69b8422 | 65 ++ .../.history/96/3071082c4ae0001413f1950b5bdb0d24 | 190 ------ .../.history/96/d08cb0332ee60014127dc373d78c1666 | 580 ++++++++++++++++ .../.history/97/20ee800597e3001412c4c4819c88e86b | 75 ++ .../.history/97/a0b6bcf374e300141084bb8bfb075c08 | 37 + .../.history/98/30d2e29d08de00141043c3025ec60dfc | 184 ----- .../.history/98/707c1e6f36e100141e1cc3c3be242e56 | 62 ++ .../.history/99/904b914b0ade00141043c3025ec60dfc | 185 ----- .../.history/99/d0582ab82ce60014127dc373d78c1666 | 78 +++ .../.history/9a/50f79109fce40014174fe663e69b8422 | 65 ++ .../.history/9a/a0bc584010e60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/9a/c02c41de21e60014127dc373d78c1666 | 0 .../.history/9a/f09f6139c8df00141dc6c962aec96210 | 92 --- .../.history/9b/505befdf08e60014127dc373d78c1666 | 60 ++ .../.history/9c/009ded5190e3001417b2e384bf7c3702 | 82 +++ .../.history/9c/108a9f5210e60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/9c/6077fb309be3001412c4c4819c88e86b | 96 +++ .../.history/9c/c07d2bbd25e60014127dc373d78c1666 | 74 ++ .../.history/9d/00cb774c9ce3001412c4c4819c88e86b | 33 + .../.history/9d/105089d82ae60014127dc373d78c1666 | 80 +++ .../.history/9d/50ed421e04e50014174fe663e69b8422 | 57 ++ .../.history/9d/70ce133137e100141e1cc3c3be242e56 | 62 ++ .../.history/9d/80673fdbfae40014174fe663e69b8422 | 62 ++ .../.history/9e/30320ac0fde40014174fe663e69b8422 | 161 +++++ .../.history/9e/403b2d4afbe40014174fe663e69b8422 | 61 ++ .../.history/9e/9043b9010cde00141043c3025ec60dfc | 186 ----- .../.history/9e/904d6c6392e3001417b2e384bf7c3702 | 27 + .../.history/9f/10132f5697e3001412c4c4819c88e86b | 75 ++ .../.history/9f/60685a52dce50014109ec019d2f6c0dc | 80 +++ .../.history/9f/60cd21f40bde00141043c3025ec60dfc | 186 ----- .../.history/9f/c07592ad26e60014127dc373d78c1666 | 24 + .../.history/a/8044e5d790e3001417b2e384bf7c3702 | 82 +++ .../.history/a0/40594fd502e50014174fe663e69b8422 | 57 ++ .../.history/a0/9009625127e60014127dc373d78c1666 | 70 ++ .../.history/a0/a088aa6692e3001417b2e384bf7c3702 | 27 + .../.history/a1/b074f8a10fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/a1/d03d8f064ae0001413f1950b5bdb0d24 | 190 ------ .../.history/a2/0094abb608de00141043c3025ec60dfc | 184 ----- .../.history/a2/d0b0f0ab3de100141e1cc3c3be242e56 | 26 + .../.history/a3/504564742ee60014127dc373d78c1666 | 580 ++++++++++++++++ .../.history/a4/200ef2fd26de00141043c3025ec60dfc | 105 --- .../.history/a4/30f1557c29de00141043c3025ec60dfc | 121 ---- .../.history/a4/502b9fa69ce3001412c4c4819c88e86b | 33 + .../.history/a4/60b5788803e60014127dc373d78c1666 | 40 ++ .../.history/a4/e0f28f5e03e60014127dc373d78c1666 | 41 ++ .../.history/a5/80728a19fde40014174fe663e69b8422 | 50 ++ .../.history/a6/101bc69d0bde00141043c3025ec60dfc | 185 ----- .../.history/a6/508cb5f72be60014127dc373d78c1666 | 80 +++ .../.history/a6/90e5a94627e60014127dc373d78c1666 | 70 ++ .../.history/a7/b09d7740fce40014174fe663e69b8422 | 67 ++ .../.history/a7/b0e9409a31e100141e1cc3c3be242e56 | 27 + .../.history/a7/b0f1fd2f02de00141043c3025ec60dfc | 272 -------- .../.history/a7/e0de3db82bde00141043c3025ec60dfc | 123 ---- .../.history/a8/00bcf92d8ee3001417b2e384bf7c3702 | 25 + .../.history/a8/1058fac532e100141e1cc3c3be242e56 | 0 .../.history/a8/90919bf50ade00141043c3025ec60dfc | 185 ----- .../.history/a8/b02d0de436e100141e1cc3c3be242e56 | 454 ++++++++++++ .../.history/a8/c06f6dbf2be60014127dc373d78c1666 | 80 +++ .../.history/a8/d0d6ac8a2ce60014127dc373d78c1666 | 80 +++ .../.history/a8/e02833072fde00141043c3025ec60dfc | 46 -- .../.history/a9/30408fedfbe40014174fe663e69b8422 | 64 ++ .../.history/a9/804ba49f0fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/a9/906a5c63fce40014174fe663e69b8422 | 65 ++ .../.history/a9/d09fd6372bde00141043c3025ec60dfc | 466 ------------- .../.history/aa/2006adf198e3001412c4c4819c88e86b | 27 + .../.history/aa/e0530e5726e60014127dc373d78c1666 | 24 + .../.history/ab/20e316d367dd001412dce27813e7be4a | 123 ---- .../.history/ab/b01141212bde00141043c3025ec60dfc | 466 ------------- .../.history/ad/4031063499e3001412c4c4819c88e86b | 27 + .../.history/ad/705d0e479ae3001412c4c4819c88e86b | 87 +++ .../.history/ae/a07a436227e60014127dc373d78c1666 | 70 ++ .../.history/ae/d0d0f67107e50014174fe663e69b8422 | 61 ++ .../.history/b/000c08e404e50014174fe663e69b8422 | 56 ++ .../.history/b/90e8344505e50014174fe663e69b8422 | 61 ++ .../.history/b/e0b0ac5f2ce60014127dc373d78c1666 | 80 +++ .../.history/b0/5097d3042de60014127dc373d78c1666 | 78 +++ .../.history/b0/c0347e0403e50014174fe663e69b8422 | 58 ++ .../.history/b0/e03fd2740bde00141043c3025ec60dfc | 185 ----- .../.history/b0/e0ae27cf28de00141043c3025ec60dfc | 465 ------------- .../.history/b1/00caa6936edd001412dce27813e7be4a | 465 ------------- .../.history/b1/1037e339dee50014109ec019d2f6c0dc | 93 +++ .../.history/b1/e0e1250efde40014174fe663e69b8422 | 46 ++ .../.history/b2/408df7d236e100141e1cc3c3be242e56 | 62 ++ .../.history/b3/5082774936e100141e1cc3c3be242e56 | 62 ++ .../.history/b3/50dc9ef400e50014174fe663e69b8422 | 53 ++ .../.history/b3/80253a9b9ce3001412c4c4819c88e86b | 33 + .../.history/b3/d0ac8fe598e3001412c4c4819c88e86b | 27 + .../.history/b3/e08d6da9c8df00141dc6c962aec96210 | 734 -------------------- .../.history/b3/e09e0f810fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/b4/5075577ed0df00141dc6c962aec96210 | 87 --- .../.history/b4/c067553a97e3001412c4c4819c88e86b | 75 ++ .../.history/b5/009077530fe60014127dc373d78c1666 | 578 ++++++++++++++++ .../.history/b5/a02d9af974e300141084bb8bfb075c08 | 37 + .../.history/b5/d0d7234a2ce60014127dc373d78c1666 | 80 +++ .../.history/b6/4012105328e60014127dc373d78c1666 | 97 +++ .../.history/b6/40a9d3b7c9df00141dc6c962aec96210 | 93 --- .../.history/b6/602b567104e50014174fe663e69b8422 | 61 ++ .../.history/b7/2037e31a2ee60014127dc373d78c1666 | 580 ++++++++++++++++ .../.history/b7/2049de70fde50014127dc373d78c1666 | 94 +++ .../.history/b7/5041281b2ce60014127dc373d78c1666 | 81 +++ .../.history/b7/a07d88ff3ce100141e1cc3c3be242e56 | 26 + .../.history/b7/c057434c00e50014174fe663e69b8422 | 54 ++ .../.history/b7/e0125a0b06de00141043c3025ec60dfc | 465 ------------- .../.history/b7/e0b972a8fce40014174fe663e69b8422 | 67 ++ .../.history/b7/f08dace103e60014127dc373d78c1666 | 41 ++ .../.history/b8/60aefdf029de00141043c3025ec60dfc | 105 --- .../.history/b8/80c3ddc026de00141043c3025ec60dfc | 105 --- .../.history/b8/c088de560fe60014127dc373d78c1666 | 578 ++++++++++++++++ .../.history/b9/003e90f5fce40014174fe663e69b8422 | 65 ++ .../.history/b9/10eef35626e60014127dc373d78c1666 | 70 ++ .../.history/b9/307c0486d0df00141dc6c962aec96210 | 87 --- .../.history/b9/4057874afde40014174fe663e69b8422 | 65 ++ .../.history/b9/60396614fde40014174fe663e69b8422 | 65 ++ .../.history/b9/706877bc92e3001417b2e384bf7c3702 | 27 + .../.history/b9/a0900f1428de00141043c3025ec60dfc | 464 ------------- .../.history/ba/30275f77cadf00141dc6c962aec96210 | 95 --- .../.history/ba/c00c84b926de00141043c3025ec60dfc | 105 --- .../.history/bb/10dd91b3fce40014174fe663e69b8422 | 65 ++ .../.history/bb/a064cf8efee40014174fe663e69b8422 | 48 ++ .../.history/bb/b0dd80ef11e60014127dc373d78c1666 | 580 ++++++++++++++++ .../.history/bc/4013300e27de00141043c3025ec60dfc | 105 --- .../.history/bd/4074a0d332e100141e1cc3c3be242e56 | 11 + .../.history/bd/d04b122337e100141e1cc3c3be242e56 | 454 ++++++++++++ .../.history/be/20e626ed27e60014127dc373d78c1666 | 74 ++ .../.history/be/802b92950fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/be/a080bd0705de00141043c3025ec60dfc | 132 ---- .../.history/be/e0c402be67dd001412dce27813e7be4a | 123 ---- .../.history/bf/00f9e72d10e60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/bf/208d91aafae40014174fe663e69b8422 | 12 + .../.history/c/3035f90c0cde00141043c3025ec60dfc | 186 ----- .../.history/c/70125005fde40014174fe663e69b8422 | 46 ++ .../.history/c0/10b2fd5626e60014127dc373d78c1666 | 27 + .../.history/c0/30ee099203de00141043c3025ec60dfc | 278 -------- .../.history/c0/70c41ccd0fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/c0/902e10a698e3001412c4c4819c88e86b | 26 + .../.history/c0/a02202f990e3001417b2e384bf7c3702 | 25 + .../.history/c1/000e0f74fde40014174fe663e69b8422 | 79 +++ .../.history/c1/205923f410e60014127dc373d78c1666 | 585 ++++++++++++++++ .../.history/c1/60f9f2d236e100141e1cc3c3be242e56 | 454 ++++++++++++ .../.history/c1/d097cbcdc9df00141dc6c962aec96210 | 84 --- .../.history/c1/f0452224fde50014127dc373d78c1666 | 94 +++ .../.history/c2/50cdf66ecfdf00141dc6c962aec96210 | 124 ---- .../.history/c2/8031ad1933e100141e1cc3c3be242e56 | 190 ++++++ .../.history/c2/a0107643fce40014174fe663e69b8422 | 67 ++ .../.history/c2/b0134cea38e100141e1cc3c3be242e56 | 62 ++ .../.history/c2/b0c9916cfde40014174fe663e69b8422 | 77 +++ .../.history/c2/c09197b00ade00141043c3025ec60dfc | 186 ----- .../.history/c3/30c6932ffde40014174fe663e69b8422 | 46 ++ .../.history/c3/e007edb70fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/c3/f0eac1132de60014127dc373d78c1666 | 78 +++ .../.history/c4/002a225726e60014127dc373d78c1666 | 74 ++ .../.history/c4/10491e1095e3001412c4c4819c88e86b | 74 ++ .../.history/c4/40572ab1dee50014109ec019d2f6c0dc | 93 +++ .../.history/c4/40aec02197e3001412c4c4819c88e86b | 75 ++ .../.history/c4/a0fb3f132be60014127dc373d78c1666 | 74 ++ .../.history/c4/b0d0b3d167dd001412dce27813e7be4a | 123 ---- .../.history/c4/c09495102ee60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/c4/d08f4aa603de00141043c3025ec60dfc | 278 -------- .../.history/c4/d0a333fafbe40014174fe663e69b8422 | 64 ++ .../.history/c5/2028a19f36e100141e1cc3c3be242e56 | 62 ++ .../.history/c5/308908c731e100141e1cc3c3be242e56 | 190 ++++++ .../.history/c5/309c6aa024e60014127dc373d78c1666 | 74 ++ .../.history/c5/40e0dc622bde00141043c3025ec60dfc | 466 ------------- .../.history/c5/609361c93ce100141e1cc3c3be242e56 | 66 ++ .../.history/c5/a003543c36e100141e1cc3c3be242e56 | 62 ++ .../.history/c5/e0326bc32bde00141043c3025ec60dfc | 123 ---- .../.history/c6/90bc489493e3001412c4c4819c88e86b | 81 +++ .../.history/c6/f05c135726e60014127dc373d78c1666 | 24 + .../.history/c7/b0ea5e5c03de00141043c3025ec60dfc | 94 --- .../.history/c7/f01a9f8d0fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/c8/20a0aab003e60014127dc373d78c1666 | 41 ++ .../.history/c8/40a455692be60014127dc373d78c1666 | 80 +++ .../.history/c8/40c3ebde71e300141084bb8bfb075c08 | 38 ++ .../.history/c9/0091fdd79ce3001412c4c4819c88e86b | 96 +++ .../.history/c9/80e3852ffde40014174fe663e69b8422 | 46 ++ .../.history/c9/a03c4cbb97e3001412c4c4819c88e86b | 75 ++ .../.history/ca/206721badae50014109ec019d2f6c0dc | 63 ++ .../.history/ca/30297e3828e60014127dc373d78c1666 | 17 + .../.history/ca/90cc7cc9c8df00141dc6c962aec96210 | 744 -------------------- .../.history/cb/20c24219cedf00141dc6c962aec96210 | 87 --- .../.history/cb/700a357f67dd001412dce27813e7be4a | 123 ---- .../.history/cb/80a6c431dae50014109ec019d2f6c0dc | 60 ++ .../.history/cb/9070315200e50014174fe663e69b8422 | 54 ++ .../.history/cb/c061a2c326de00141043c3025ec60dfc | 105 --- .../.history/cc/008e9c8b2ce60014127dc373d78c1666 | 78 +++ .../.history/cd/905ab41326e60014127dc373d78c1666 | 71 ++ .../.history/cd/a066fa7271e300141084bb8bfb075c08 | 36 + .../.history/ce/60bee40466dd001412dce27813e7be4a | 122 ---- .../.history/ce/909313c197e3001412c4c4819c88e86b | 75 ++ .../.history/ce/d0c430372ce60014127dc373d78c1666 | 80 +++ .../.history/ce/e0e674522ce60014127dc373d78c1666 | 80 +++ .../.history/cf/90de1e2936e100141e1cc3c3be242e56 | 186 +++++ .../.history/d0/102ad27afde40014174fe663e69b8422 | 65 ++ .../.history/d0/203f4a6a07e50014174fe663e69b8422 | 61 ++ .../.history/d0/905dc04d2bde00141043c3025ec60dfc | 466 ------------- .../.history/d0/90c5727dfde40014174fe663e69b8422 | 65 ++ .../.history/d0/a0f6c7b4fde40014174fe663e69b8422 | 43 ++ .../.history/d1/201cc7f23ce100141e1cc3c3be242e56 | 66 ++ .../.history/d1/406cb68309de00141043c3025ec60dfc | 184 ----- .../.history/d1/6037b5cdcedf00141dc6c962aec96210 | 87 --- .../.history/d1/b032073032e100141e1cc3c3be242e56 | 63 ++ .../.history/d1/d0592b5d92e3001417b2e384bf7c3702 | 27 + .../.history/d1/e027ffc10fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/d2/1003962904de00141043c3025ec60dfc | 278 -------- .../.history/d3/10f4b42522e60014127dc373d78c1666 | 16 + .../.history/d3/10f60dd394e3001412c4c4819c88e86b | 74 ++ .../.history/d3/8065ef51d1df00141dc6c962aec96210 | 119 ---- .../.history/d4/d0970b5004de00141043c3025ec60dfc | 278 -------- .../.history/d5/504bd33404e50014174fe663e69b8422 | 58 ++ .../.history/d5/70d86f778de3001417b2e384bf7c3702 | 38 ++ .../.history/d5/b00062e0ffe40014174fe663e69b8422 | 65 ++ .../.history/d6/40cea7b326de00141043c3025ec60dfc | 105 --- .../.history/d6/904f212936e100141e1cc3c3be242e56 | 62 ++ .../.history/d6/f004df7701e50014174fe663e69b8422 | 51 ++ .../.history/d7/b0f547c42be60014127dc373d78c1666 | 80 +++ .../.history/d7/e01fa45502e60014127dc373d78c1666 | 77 +++ .../.history/d7/f08bbf16c9df00141dc6c962aec96210 | 94 --- .../.history/d8/30c5a0be10e60014127dc373d78c1666 | 585 ++++++++++++++++ .../.history/d8/6023bb4999e3001412c4c4819c88e86b | 27 + .../.history/d8/802536bc07de00141043c3025ec60dfc | 186 ----- .../.history/d9/e0c5a699fde40014174fe663e69b8422 | 164 +++++ .../.history/da/70f5abaa35e100141e1cc3c3be242e56 | 63 ++ .../.history/db/50bc8a77d0df00141dc6c962aec96210 | 87 --- .../.history/dc/d063631307e50014174fe663e69b8422 | 93 +++ .../.history/de/a05f4f052dde00141043c3025ec60dfc | 105 --- .../.history/e/1035499a26de00141043c3025ec60dfc | 105 --- .../.history/e/20231c3ffee50014127dc373d78c1666 | 20 + .../.history/e/20a9f8c891e3001417b2e384bf7c3702 | 25 + .../.history/e/706fd6f390e3001417b2e384bf7c3702 | 25 + .../.history/e/90e9856afce40014174fe663e69b8422 | 65 ++ .../.history/e/f0dbfc7597e3001412c4c4819c88e86b | 75 ++ .../.history/e0/3010dd8c3de100141e1cc3c3be242e56 | 26 + .../.history/e1/90df506301e50014174fe663e69b8422 | 55 ++ .../.history/e2/10498d82cbdf00141dc6c962aec96210 | 97 --- .../.history/e3/20ac2f520bde00141043c3025ec60dfc | 185 ----- .../.history/e3/308fca16fde40014174fe663e69b8422 | 66 ++ .../.history/e3/7050e4ed2ce60014127dc373d78c1666 | 78 +++ .../.history/e3/d03e9ab32be60014127dc373d78c1666 | 80 +++ .../.history/e3/f06f10cbdee50014109ec019d2f6c0dc | 93 +++ .../.history/e4/0043edd426de00141043c3025ec60dfc | 105 --- .../.history/e4/00bb5944dae50014109ec019d2f6c0dc | 62 ++ .../.history/e4/50ed324c0bde00141043c3025ec60dfc | 185 ----- .../.history/e4/9013b88010e60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/e4/a00b420edde50014109ec019d2f6c0dc | 92 +++ .../.history/e5/c0eb43b700e50014174fe663e69b8422 | 53 ++ .../.history/e6/00004ede9ae3001412c4c4819c88e86b | 95 +++ .../.history/e6/b04cd9362ede00141043c3025ec60dfc | 109 --- .../.history/e6/f00e0e670fe60014127dc373d78c1666 | 579 ++++++++++++++++ .../.history/e6/f095e7a126de00141043c3025ec60dfc | 105 --- .../.history/e7/d07f155726e60014127dc373d78c1666 | 74 ++ .../.history/e8/00dc62a998e3001412c4c4819c88e86b | 27 + .../.history/e8/70d65d9f29de00141043c3025ec60dfc | 122 ---- .../.history/e8/c04086ad26e60014127dc373d78c1666 | 97 +++ .../.history/e8/f0038df208de00141043c3025ec60dfc | 184 ----- .../.history/e9/a0901cd92dde00141043c3025ec60dfc | 106 --- .../.history/e9/d0507977c8df00141dc6c962aec96210 | 92 --- .../.history/ea/705e53cd96e3001412c4c4819c88e86b | 26 + .../.history/ea/80100efb96e3001412c4c4819c88e86b | 72 ++ .../.history/ea/a053aefe94e3001412c4c4819c88e86b | 74 ++ .../.history/eb/90c9eff2fce40014174fe663e69b8422 | 46 ++ .../.history/eb/e06464f935e100141e1cc3c3be242e56 | 63 ++ .../.history/eb/e0c7efa692e3001417b2e384bf7c3702 | 27 + .../.history/eb/e0f1689026e60014127dc373d78c1666 | 24 + .../.history/ec/509d9ad2cfdf00141dc6c962aec96210 | 102 --- .../.history/ec/90c6538936e100141e1cc3c3be242e56 | 260 +++++++ .../.history/ed/0092ec402de60014127dc373d78c1666 | 78 +++ .../.history/ed/50fc2bb229de00141043c3025ec60dfc | 466 ------------- .../.history/ee/101c29e799e3001412c4c4819c88e86b | 72 ++ .../.history/ef/b02994c8fce50014127dc373d78c1666 | 94 +++ .../.history/f/10c9048a91e3001417b2e384bf7c3702 | 25 + .../.history/f/702ef9a103e60014127dc373d78c1666 | 40 ++ .../.history/f0/1007be1adae50014109ec019d2f6c0dc | 62 ++ .../.history/f0/a0d9c8ff2ce60014127dc373d78c1666 | 78 +++ .../.history/f0/d0a08c8ed0df00141dc6c962aec96210 | 87 --- .../.history/f0/e0841f8b23e60014127dc373d78c1666 | 76 +++ .../.history/f1/60bb815703e50014174fe663e69b8422 | 57 ++ .../.history/f2/00f951d59ce3001412c4c4819c88e86b | 96 +++ .../.history/f2/b0a9941f9be3001412c4c4819c88e86b | 95 +++ .../.history/f2/d0b7446a2ee60014127dc373d78c1666 | 580 ++++++++++++++++ .../.history/f3/20c13d5102de00141043c3025ec60dfc | 272 -------- .../.history/f3/80522dbd25e60014127dc373d78c1666 | 24 + .../.history/f3/e07bb9c32ce60014127dc373d78c1666 | 78 +++ .../.history/f3/f03670018ee3001417b2e384bf7c3702 | 24 + .../.history/f4/40b7090927de00141043c3025ec60dfc | 105 --- .../.history/f4/a015049497e3001412c4c4819c88e86b | 75 ++ .../.history/f4/b08f72dafce40014174fe663e69b8422 | 46 ++ .../.history/f4/d05828652ce60014127dc373d78c1666 | 80 +++ .../.history/f4/f0200353dbe50014109ec019d2f6c0dc | 67 ++ .../.history/f5/20a6758b0ade00141043c3025ec60dfc | 185 ----- .../.history/f5/4093e81d8ee3001417b2e384bf7c3702 | 25 + .../.history/f5/60962c202ce60014127dc373d78c1666 | 81 +++ .../.history/f5/a0481eabfee50014127dc373d78c1666 | 94 +++ .../.history/f5/c0204a4dfde40014174fe663e69b8422 | 65 ++ .../.history/f6/2015b91c37e100141e1cc3c3be242e56 | 62 ++ .../.history/f7/50e88c160ade00141043c3025ec60dfc | 186 ----- .../.history/f7/80a33c36fde40014174fe663e69b8422 | 65 ++ .../.history/f8/007cb0a590e3001417b2e384bf7c3702 | 85 +++ .../.history/f8/00dc645002e50014174fe663e69b8422 | 56 ++ .../.history/f8/802b95f798e3001412c4c4819c88e86b | 27 + .../.history/f8/b0b6ee38c4df00141dc6c962aec96210 | 190 ------ .../.history/f9/201cfc0598e3001412c4c4819c88e86b | 75 ++ .../.history/fa/40cc55896edd001412dce27813e7be4a | 43 -- .../.history/fa/d0acf8ff27e500141c50bd6848c69dc6 | 57 ++ .../.history/fa/e0cd16ca92e3001417b2e384bf7c3702 | 27 + .../.history/fb/80bcb0aecfdf00141dc6c962aec96210 | 102 --- .../.history/fb/a00c68532dde00141043c3025ec60dfc | 106 --- .../.history/fc/005b783701e50014174fe663e69b8422 | 55 ++ .../.history/fc/109511b201e60014127dc373d78c1666 | 41 ++ .../.history/fc/10e7546d07e50014174fe663e69b8422 | 61 ++ .../.history/fd/900f624402e50014174fe663e69b8422 | 54 ++ .../.history/fe/30d8384237e100141e1cc3c3be242e56 | 454 ++++++++++++ .../.history/fe/603945450fe60014127dc373d78c1666 | 578 ++++++++++++++++ .../.history/fe/603b13fe21e60014127dc373d78c1666 | 12 + .../.history/fe/60f238f802de00141043c3025ec60dfc | 276 -------- .../.history/fe/c010f86d9ae3001412c4c4819c88e86b | 86 +++ .../.history/fe/c077e76102e60014127dc373d78c1666 | 77 +++ .../.history/fe/d0474cdb91e3001417b2e384bf7c3702 | 26 + .../.history/ff/b02f1331fce40014174fe663e69b8422 | 48 ++ .../.indexes/29/b9/22/1d/35/7e/history.index | Bin 0 -> 694 bytes .../.indexes/29/b9/22/1d/35/history.index | Bin 0 -> 943 bytes .../.indexes/e4/b9/22/7d/96/13/6a/history.index | Bin 99 -> 1275 bytes .../.indexes/e4/b9/22/7d/96/13/history.index | Bin 101 -> 3313 bytes .../.indexes/e4/b9/22/7d/96/2/history.index | Bin 116 -> 202 bytes .../.indexes/e4/b9/22/7d/96/29/history.index | Bin 1032 -> 0 bytes .../.indexes/e4/b9/22/7d/96/2e/history.index | Bin 108 -> 0 bytes .../.indexes/e4/b9/22/7d/96/35/3b/history.index | Bin 0 -> 1468 bytes .../.indexes/e4/b9/22/7d/96/35/history.index | Bin 0 -> 2316 bytes .../.indexes/e4/b9/22/7d/96/3f/history.index | Bin 289 -> 0 bytes .../.indexes/e4/b9/22/7d/96/5e/ac/history.index | Bin 0 -> 388 bytes .../.indexes/e4/b9/22/7d/96/6e/history.index | Bin 0 -> 382 bytes .../.indexes/e4/b9/22/7d/96/78/history.index | Bin 346 -> 0 bytes .../.indexes/e4/b9/22/7d/96/8d/history.index | Bin 121 -> 1797 bytes .../.indexes/e4/b9/22/7d/96/be/history.index | Bin 0 -> 1072 bytes .../.indexes/e4/b9/22/7d/96/df/history.index | Bin 0 -> 1275 bytes .../.indexes/e4/b9/22/7d/96/e7/history.index | Bin 2068 -> 678 bytes .../.indexes/e4/b9/22/7d/96/ef/9d/history.index | Bin 0 -> 1298 bytes .../.indexes/e4/b9/22/7d/96/ef/history.index | Bin 443 -> 496 bytes .../.indexes/e4/b9/22/7d/96/fe/history.index | Bin 1177 -> 0 bytes .../.indexes/e4/b9/22/7d/96/history.index | Bin 140 -> 188 bytes .../.projects/Minecraft/.markers | Bin 1034 -> 1034 bytes .../Minecraft/org.eclipse.jdt.core/state.dat | Bin 108414 -> 116967 bytes .../org.eclipse.core.resources/.root/50.tree | Bin 792182 -> 0 bytes .../org.eclipse.core.resources/.root/61.tree | Bin 0 -> 912596 bytes .../.safetable/org.eclipse.core.resources | Bin 1037 -> 1032 bytes .../.settings/org.eclipse.core.resources.prefs | 3 +- .../.settings/org.eclipse.jdt.ui.prefs | 2 +- .../org.eclipse.debug.ui/dialog_settings.xml | 8 +- .../org.eclipse.e4.workbench/workbench.xmi | 74 +- .../.plugins/org.eclipse.jdt.core/286606776.index | Bin 103876 -> 111100 bytes .../org.eclipse.jdt.core/externalLibsTimeStamps | Bin 10225 -> 10225 bytes .../QualifiedTypeNameHistory.xml | 44 +- .../Minecraft/2015/4/16/refactorings.history | 3 + .../Minecraft/2015/4/16/refactorings.index | 33 + .../org.eclipse.m2e.logback.configuration/0.log | 2 + .../dialog_settings.xml | 32 +- .../org.eclipse.ui.workbench/dialog_settings.xml | 4 +- 750 files changed, 62436 insertions(+), 33905 deletions(-) create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/60c4594705e50014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/805d1a320cde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/f026d60e2de60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/207a58e4fde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/20a8ecb810e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/806717930fe60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/f0fa8fa8cfdf00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/202fc46ed0df00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/803b287d0cde00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/d02d52592dde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/f023f9b6fce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/10e3134797e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/80418fb197e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/80d06da024e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/0037843510e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/208b7b02fce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/c07337da02e50014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/e0e3109acfdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/40a0b31607e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/503edced25e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/800cba6310e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/a08d42f22dde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/700de6a60fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/506cbafe2be60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/607a0b0a28de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/a002d0b6cedf00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/f0ded3dbcedf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/0027527092e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/00a2b6defce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/80383f3671e300141084bb8bfb075c08 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/908e94da36e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/a049720d0be60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/006abc9323e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/706949a171e300141084bb8bfb075c08 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/10513bc210e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/501314b626de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/a0cc56d4fbe40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/c0982a0792e3001417b2e384bf7c3702 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/d012a06acedf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/3003c407fee40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/c0db3b8431e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/f08e283892e3001417b2e384bf7c3702 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/4094f8e609de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/60cb78e111e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/003d2b0505de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/20405a71ccdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/304b2ee02be60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/4002026028de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/607789ae0fe60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/609f909029de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/700a88ac90e3001417b2e384bf7c3702 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/a0d5c9a72bde00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/5081dc2706de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/703581a771e300141084bb8bfb075c08 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/1057f5e202e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/30a1626704de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/30f15f9026e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/801465eccbdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/705d9b5b23e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/c036359431e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/c083e9b42bde00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/00c5f4c902de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/7059c98a6edd001412dce27813e7be4a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/90e61b1372e300141084bb8bfb075c08 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/609d74fbfde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/102009133ce100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/300cc20804e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/a0aafa332de60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/803e9d8d04e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/902ed2a826e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/00520c9504e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/40a4e6b92be60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/a01776bcfde50014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/30de043304de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/40247e5d2dde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/809e116607e50014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/9027920627de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/a04b7a8e91e3001417b2e384bf7c3702 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/b0c118102dde00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/6015a33bd1df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/707801098ee3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/80b60a3e27e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/c011836acadf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/c026412f36e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/d0f34296e1e50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/0026ada605e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/703a47a523e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/809d0e09cddf00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/b0ae616ecedf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/106f70bf01e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/50f61c022bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/c06ef67e91e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/c00d944e2de60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/e03f878f72e300141084bb8bfb075c08 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/10f36a6990e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/50d498da36e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/c07570fc8de3001417b2e384bf7c3702 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/20e2ed160cde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/b00f12e436e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/1096a2fac8df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/604048aa00e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/608a239c29e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/70358e7c0fe60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/201793702dde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/204db0c810e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/30675ea024e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/e04866d3fde50014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/f02810b507de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/206828078de3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/30ca78699ae3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/50aa567f09e50014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/609ee512cfdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/50d8454d2ce60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/808ebec629de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/f001bde393e3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/10925bf3cadf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/203b62722be60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/5069282604e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/60c4bcde2ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/201a8e4e08e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/4064f9042ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/70f6390a33e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/a08ceb03fee50014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/4027a5e129de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/600d023b95e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/8062bf2107e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/b01358c6fce40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/f0613fc4cfdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/10b4162c31e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/30cbc9efdde50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/c01a0a822be60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/f0c649af08de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/1068e79a01e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/5031a6ce32e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/60be6d7a67dd001412dce27813e7be4a delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/6000f6390ade00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/900cd0d2ccdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/10b462f7fce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/6096e9aedbe50014109ec019d2f6c0dc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a06f5eb026de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/209ecde827e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/20d6830327de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/801c40ebcbdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/a08b206401e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/d039874701e50014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/309bbd4008de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/7054379b0fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/70b5b24de0e50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/9062eb5626e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/f026c032fde40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/003a974204de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/a03afdd19ae3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/a0d154642be60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/c035952b36e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/900c963102e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/f061f27170e300141084bb8bfb075c08 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/3086cd9311e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/007d9fbe0ade00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/c043415c99e3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/c04764282ede00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/c0ddc4bd08e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/6018c4e6fce40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/f045d0fb2ede00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/10ad6cb191e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/60b9df5e2be60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/a0709cf62ae60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/d01a6b619ce3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/40949c9f36e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/6037f46203e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/c00ae4970fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/c01e000872e300141084bb8bfb075c08 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/e03e86c12ede00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/005b61f003e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/10b8eac006e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/40142c73fee50014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/e070a9a826e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/601566c636e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/608194048ee3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/80a948a2fce40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/a015113e04de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/009902e3fbe40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/b07b909e26de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/5014ba759ce3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/d0cfb46325e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/f028294b23e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/f0c241e602e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/a0532f0bfce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/b06750e295e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/2064f33d99e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/c0c8f29707e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/e0dae57e2ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/b08acbee01e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/5089f60bfee40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/7045388123e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/d0c8245c0fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/500f4e3704e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/5094c22ddce50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/702fad0522e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/707860379ce3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/c056dd602ee60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/e0ac941eccdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/b0dd171b36e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/d08a12f794e3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/509f12b8cfdf00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/70eb2ca3ccdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/b076e5188ee3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/f055598098e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/604b232936e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/70418fad26e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/108313903de100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/70f03ed40fe60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/90a153b367dd001412dce27813e7be4a delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/b095661a2ede00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/e0bfffad9ce3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/401fb0e42ae60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/c05809292ee60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d07c98730ade00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d07f51f1e1e50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/20ea69c702e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/3020e4818ee3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/5060e6c998e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/a0c899f616e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c078df6404de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/40a922fbcddf00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/5029f1a804de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/800cb89f9ce3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10c90e0b09e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/407a4588cadf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/40f3d19e91e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/70816d6f94e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/c05f30bd25e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/90359fe194e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/a045419026e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/50be335402e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/d0d224852ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/f0632658c0e50014122af9ad4a560236 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30f9e59108de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/e0ff939e02e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/0065cfc101e50014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/40b159950ade00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/a004e1a8c3e50014122af9ad4a560236 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/f045b1c8fce40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/8023076d28de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/d0336393dee50014109ec019d2f6c0dc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/d0d1c7060cde00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/507f105a2ede00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/c01a61492ede00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/204cfa240ade00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/a0890abe02de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/d03963b82ede00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/009346bd26de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/a0662de901e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/c06ac17c09de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/206e9fbfdce50014109ec019d2f6c0dc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/90070fc8cfdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/d0ebb9bd98e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/1063c37f8ee3001417b2e384bf7c3702 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/30591b0b27de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/600230f8fde50014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/702cdaf0ccdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/706f7de52ce60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/80f33350c9df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/502eece29ce3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/8018e58904e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/c0bee05e02e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/d0413c3339e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/e0b3c0d50bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/f076514d01e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/30cad6710ee60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/40551ae474e300141084bb8bfb075c08 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/705ae70e2ce60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/9054945503de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a011af0c03e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a0a1c6429ae3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/10a8e852ffe40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/80c87259cadf00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/f0fb303b0bde00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/00f1323d0cde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/700e006d95e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/8040daa897e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/90c73e68dfe50014109ec019d2f6c0dc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/b02224c467dd001412dce27813e7be4a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/1001cf0b72e300141084bb8bfb075c08 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/408da85a08e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/801db51c37e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/80909a0b36e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/809dbb21fde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/40cc91f125e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/00835d83fde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a0449c8093e3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a046bebfcfdf00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/f0a4797968dd001412dce27813e7be4a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/70d2e64cfae40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/b0690d9a2be60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/10543334ffe40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/80707ccf26de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/a012e7fa2ae60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/60061e9571e300141084bb8bfb075c08 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/80a334f7dee50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c0574f9791e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/1087a1e902e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/30500e3137e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/90d70d9e10e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/c0e5f1d298e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/d04b715902e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/902cfdee91e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/a02269c636e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e02cfa2c2ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e0673f4237e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/20dad64f2ede00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/60d7e68b6edd001412dce27813e7be4a delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/80e1a2afcbdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/a0dd791f2be60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/60834d1d9ce3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/d03da29126de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/e089d7410fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/103378ed2ae60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/603b1e1d20e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/305762850fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/90636f1ffde40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/f0abd173d0df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/70b22b2507e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/b096988c2be60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/1026e96300e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/10e3c302dee50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/30bcf87f94e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/402c65f927e500141c50bd6848c69dc6 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/8029efd19de3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/9000a4bccadf00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/9031349f2dde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/c03fc5e5dde50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/50271aa22ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/5081b1640fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/6082e39affe50014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/a06388ad26e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/b0bc2130cbdf00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/f0f277a80ade00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/b0ad63acfde40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/30c7389426de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/50e1e03570e300141084bb8bfb075c08 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/6040154608de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/80d136b994e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/1085f39501e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/10e9952ffde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/00f0902b36e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/40c942690fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/c002ba7395e3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/d0f4feb20ade00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e0f236a626de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/d03329bd25e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/9020848ffce40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/50fcae8bd0df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/60276c082de60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/00a3c9260cde00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/1025655c2bde00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/80aeb7fb26de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/209236d010e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/d06a48742ce60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/1013dbafccdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/30156ba910e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/8044082ffce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/f01e505a95e3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/20753b7905de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/209ca7a826e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/7075f1a529e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/90fa117a8de3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/e058c2a396e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/f09ccb8e23e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/6060ee470fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/10a39f8636e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/50e526fb2be60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/d01b82df0bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/d0e1834d23e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/f0467f9a2bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/1088932b36e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/30bf1d4c2dde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/50894d0b33e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/907dbd0a2ede00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/e0ba42a391e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/b0b8c8a826e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/e0c2b692fce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/70348a9a23e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/90b5ab67fee40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a05f8b8d6edd001412dce27813e7be4a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/e0cafc4603e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/1066a4a395e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/c006172337e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/d022da5e25e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/00e861e202e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/9018c447fde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/1062bc07fee40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/20dfbe86fde50014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/503f48a829de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/0020beb436e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/009ea381fde40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/3071082c4ae0001413f1950b5bdb0d24 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/d08cb0332ee60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/20ee800597e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/a0b6bcf374e300141084bb8bfb075c08 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/30d2e29d08de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/707c1e6f36e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/904b914b0ade00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/d0582ab82ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/50f79109fce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/a0bc584010e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/c02c41de21e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/f09f6139c8df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/505befdf08e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/009ded5190e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/108a9f5210e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/6077fb309be3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/c07d2bbd25e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/00cb774c9ce3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/105089d82ae60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/50ed421e04e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/70ce133137e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/80673fdbfae40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/30320ac0fde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/403b2d4afbe40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/9043b9010cde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/904d6c6392e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/10132f5697e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/60685a52dce50014109ec019d2f6c0dc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/60cd21f40bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/c07592ad26e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/8044e5d790e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/40594fd502e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/9009625127e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/a088aa6692e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/b074f8a10fe60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/d03d8f064ae0001413f1950b5bdb0d24 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/0094abb608de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/d0b0f0ab3de100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/504564742ee60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/200ef2fd26de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/30f1557c29de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/502b9fa69ce3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/60b5788803e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/e0f28f5e03e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/80728a19fde40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/101bc69d0bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/508cb5f72be60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/90e5a94627e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b09d7740fce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b0e9409a31e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b0f1fd2f02de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/e0de3db82bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/00bcf92d8ee3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/1058fac532e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/90919bf50ade00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/b02d0de436e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/c06f6dbf2be60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/d0d6ac8a2ce60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/e02833072fde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/30408fedfbe40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/804ba49f0fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/906a5c63fce40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/d09fd6372bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/2006adf198e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/e0530e5726e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/20e316d367dd001412dce27813e7be4a delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/b01141212bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/4031063499e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/705d0e479ae3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/a07a436227e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/d0d0f67107e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/000c08e404e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/90e8344505e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/e0b0ac5f2ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/5097d3042de60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/c0347e0403e50014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/e03fd2740bde00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/e0ae27cf28de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/00caa6936edd001412dce27813e7be4a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/1037e339dee50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/e0e1250efde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/408df7d236e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/5082774936e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/50dc9ef400e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/80253a9b9ce3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/d0ac8fe598e3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/e08d6da9c8df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/e09e0f810fe60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/5075577ed0df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/c067553a97e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/009077530fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/a02d9af974e300141084bb8bfb075c08 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/d0d7234a2ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/4012105328e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/40a9d3b7c9df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/602b567104e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/2037e31a2ee60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/2049de70fde50014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/5041281b2ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/a07d88ff3ce100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/c057434c00e50014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/e0125a0b06de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/e0b972a8fce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/f08dace103e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/60aefdf029de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/80c3ddc026de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/c088de560fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/003e90f5fce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/10eef35626e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/307c0486d0df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/4057874afde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/60396614fde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/706877bc92e3001417b2e384bf7c3702 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/a0900f1428de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/30275f77cadf00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/c00c84b926de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/10dd91b3fce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/a064cf8efee40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b0dd80ef11e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/4013300e27de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/4074a0d332e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/d04b122337e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/20e626ed27e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/802b92950fe60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/a080bd0705de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/e0c402be67dd001412dce27813e7be4a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/00f9e72d10e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/208d91aafae40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/3035f90c0cde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/70125005fde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/10b2fd5626e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/30ee099203de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/70c41ccd0fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/902e10a698e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/a02202f990e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/000e0f74fde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/205923f410e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/60f9f2d236e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/d097cbcdc9df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/f0452224fde50014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/50cdf66ecfdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/8031ad1933e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/a0107643fce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/b0134cea38e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/b0c9916cfde40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/c09197b00ade00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/30c6932ffde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/e007edb70fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/f0eac1132de60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/002a225726e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/10491e1095e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40572ab1dee50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40aec02197e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/a0fb3f132be60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/b0d0b3d167dd001412dce27813e7be4a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/c09495102ee60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/d08f4aa603de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/d0a333fafbe40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/2028a19f36e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/308908c731e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/309c6aa024e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/40e0dc622bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/609361c93ce100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/a003543c36e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/e0326bc32bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/90bc489493e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/f05c135726e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/b0ea5e5c03de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/f01a9f8d0fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/20a0aab003e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/40a455692be60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/40c3ebde71e300141084bb8bfb075c08 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/0091fdd79ce3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/80e3852ffde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/a03c4cbb97e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/206721badae50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/30297e3828e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/90cc7cc9c8df00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/20c24219cedf00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/700a357f67dd001412dce27813e7be4a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/80a6c431dae50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/9070315200e50014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/c061a2c326de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/008e9c8b2ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/905ab41326e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/a066fa7271e300141084bb8bfb075c08 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/60bee40466dd001412dce27813e7be4a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/909313c197e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/d0c430372ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/e0e674522ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/90de1e2936e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/102ad27afde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/203f4a6a07e50014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/905dc04d2bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/90c5727dfde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/a0f6c7b4fde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/201cc7f23ce100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/406cb68309de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/6037b5cdcedf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/b032073032e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/d0592b5d92e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/e027ffc10fe60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/1003962904de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/10f4b42522e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/10f60dd394e3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/8065ef51d1df00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/d0970b5004de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/504bd33404e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/70d86f778de3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/b00062e0ffe40014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/40cea7b326de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/904f212936e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f004df7701e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/b0f547c42be60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/e01fa45502e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/f08bbf16c9df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/30c5a0be10e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/6023bb4999e3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/802536bc07de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/e0c5a699fde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/70f5abaa35e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/50bc8a77d0df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/d063631307e50014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/a05f4f052dde00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/1035499a26de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/20231c3ffee50014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/20a9f8c891e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/706fd6f390e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/90e9856afce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/f0dbfc7597e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/3010dd8c3de100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/90df506301e50014174fe663e69b8422 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/10498d82cbdf00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/20ac2f520bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/308fca16fde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/7050e4ed2ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/d03e9ab32be60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/f06f10cbdee50014109ec019d2f6c0dc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/0043edd426de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/00bb5944dae50014109ec019d2f6c0dc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/50ed324c0bde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/9013b88010e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/a00b420edde50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/c0eb43b700e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/00004ede9ae3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/b04cd9362ede00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/f00e0e670fe60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/f095e7a126de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/d07f155726e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/00dc62a998e3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/70d65d9f29de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/c04086ad26e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/f0038df208de00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/a0901cd92dde00141043c3025ec60dfc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/d0507977c8df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/705e53cd96e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/80100efb96e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/a053aefe94e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/90c9eff2fce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e06464f935e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e0c7efa692e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e0f1689026e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/509d9ad2cfdf00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/90c6538936e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/0092ec402de60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/50fc2bb229de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/101c29e799e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/b02994c8fce50014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/10c9048a91e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/702ef9a103e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/1007be1adae50014109ec019d2f6c0dc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/a0d9c8ff2ce60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/d0a08c8ed0df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/e0841f8b23e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/60bb815703e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/00f951d59ce3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/b0a9941f9be3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/d0b7446a2ee60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/20c13d5102de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/80522dbd25e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/e07bb9c32ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/f03670018ee3001417b2e384bf7c3702 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/40b7090927de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/a015049497e3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/b08f72dafce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/d05828652ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/f0200353dbe50014109ec019d2f6c0dc delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/20a6758b0ade00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/4093e81d8ee3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/60962c202ce60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/a0481eabfee50014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/c0204a4dfde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/2015b91c37e100141e1cc3c3be242e56 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/50e88c160ade00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/80a33c36fde40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/007cb0a590e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/00dc645002e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/802b95f798e3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/b0b6ee38c4df00141dc6c962aec96210 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/201cfc0598e3001412c4c4819c88e86b delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/40cc55896edd001412dce27813e7be4a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/d0acf8ff27e500141c50bd6848c69dc6 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/e0cd16ca92e3001417b2e384bf7c3702 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/80bcb0aecfdf00141dc6c962aec96210 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/a00c68532dde00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/005b783701e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/109511b201e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/10e7546d07e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/900f624402e50014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/30d8384237e100141e1cc3c3be242e56 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/603945450fe60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/603b13fe21e60014127dc373d78c1666 delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/60f238f802de00141043c3025ec60dfc create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/c010f86d9ae3001412c4c4819c88e86b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/c077e76102e60014127dc373d78c1666 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/d0474cdb91e3001417b2e384bf7c3702 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/b02f1331fce40014174fe663e69b8422 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/29/b9/22/1d/35/7e/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/29/b9/22/1d/35/history.index delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/29/history.index delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/2e/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/35/3b/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/35/history.index delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/3f/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/5e/ac/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/6e/history.index delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/78/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/be/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/df/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/ef/9d/history.index delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/fe/history.index delete mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/50.tree create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/61.tree create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/4/16/refactorings.history create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/4/16/refactorings.index (limited to 'eclipse/.metadata/.plugins') diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/60c4594705e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/60c4594705e50014174fe663e69b8422 new file mode 100644 index 0000000..dc43646 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/60c4594705e50014174fe663e69b8422 @@ -0,0 +1,61 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + System.out.println(Block.getBlockFromItem(item.getItem()) + " " + item.getIconIndex()); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIcon(JewelryNBT.item(stack), pass); + else{ +// System.out.println(Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1)); + return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1); + } + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/805d1a320cde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/805d1a320cde00141043c3025ec60dfc deleted file mode 100644 index 39190ba..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/805d1a320cde00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; -// System.out.println(red + " " + green + " " + blue); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glColorMask(false, true, false, false); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/f026d60e2de60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/f026d60e2de60014127dc373d78c1666 new file mode 100644 index 0000000..ea0a2c6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/f026d60e2de60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0) - ((tabList.get(1).enabled)?2:0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/207a58e4fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/207a58e4fde40014174fe663e69b8422 new file mode 100644 index 0000000..d17def9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/207a58e4fde40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + public static Item goldifiedObject; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldObject().setUnlocalizedName(Variables.MODID + ".goldObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/20a8ecb810e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/20a8ecb810e60014127dc373d78c1666 new file mode 100644 index 0000000..73099b7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/20a8ecb810e60014127dc373d78c1666 @@ -0,0 +1,585 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.3F, 0.45F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/806717930fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/806717930fe60014127dc373d78c1666 new file mode 100644 index 0000000..b596034 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/806717930fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.6F); + GL11.glRotatef(75f, 0f, 1f, 0f); + GL11.glRotatef(-15f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/f0fa8fa8cfdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/f0fa8fa8cfdf00141dc6c962aec96210 deleted file mode 100644 index a057c00..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/f0fa8fa8cfdf00141dc6c962aec96210 +++ /dev/null @@ -1,102 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); -// if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(30, 8 + (size + 26) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); -// } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/202fc46ed0df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/202fc46ed0df00141dc6c962aec96210 deleted file mode 100644 index 89e2fab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/202fc46ed0df00141dc6c962aec96210 +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2 + JewelryNBT.numberOfModifiers(item) / 4)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 150 - JewelryNBT.numberOfModifiers(item) * 10, 2 - JewelryNBT.numberOfModifiers(item) / 5)); - // Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(520 - JewelryNBT.numberOfModifiers(item) * 20) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - // Negative ring - if (jewelry instanceof ItemRing && exists) Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 2F - JewelryNBT.numberOfModifiers(item) * 0.1F); - // Positive ring - if (jewelry instanceof ItemRing && exists && rand.nextInt(180 + JewelryNBT.numberOfModifiers(item)*20) == 12){ - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100 + JewelryNBT.numberOfModifiers(item)*30, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/803b287d0cde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/803b287d0cde00141043c3025ec60dfc deleted file mode 100644 index 32a7a1d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/803b287d0cde00141043c3025ec60dfc +++ /dev/null @@ -1,66 +0,0 @@ -package darkknight.jewelrycraft.item.render; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.client.IItemRenderer; -import org.lwjgl.opengl.GL11; - -public class ItemRender implements IItemRenderer -{ - TileEntitySpecialRenderer render; - public TileEntity entity; - ModelBase model; - - /** - * @param render - * @param entity - * @param model - */ - public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) - { - this.entity = entity; - this.render = render; - this.model = model; - } - - /** - * @param item - * @param type - * @return - */ - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) - { - return true; - } - - /** - * @param type - * @param item - * @param helper - * @return - */ - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) - { - return true; - } - - /** - * @param type - * @param item - * @param data - */ - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object ... data) - { - GL11.glColorMask(false, false, false, false); - if (type == IItemRenderer.ItemRenderType.ENTITY){ - GL11.glRotatef(180f, 0f, 1f, 0f); - GL11.glTranslatef(-0.5f, -0.5f, -0.4f); - } - render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/d02d52592dde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/d02d52592dde00141043c3025ec60dfc deleted file mode 100644 index 90cb2ed..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/d02d52592dde00141043c3025ec60dfc +++ /dev/null @@ -1,106 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() - 50 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5, resolution.getScaledHeight() - 50 + 16 * count, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + tagCache.getFloat("BlackHeart"), 15, resolution.getScaledHeight() - 50 + 16 * count, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() - 50 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/f023f9b6fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/f023f9b6fce40014174fe663e69b8422 new file mode 100644 index 0000000..391f21e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/f023f9b6fce40014174fe663e69b8422 @@ -0,0 +1,66 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; +import darkknight.jewelrycraft.item.ItemGoldifiedObject; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemGoldifiedObject goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = (ItemGoldifiedObject)new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/10e3134797e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/10e3134797e3001412c4c4819c88e86b new file mode 100644 index 0000000..d52a637 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/10e3134797e3001412c4c4819c88e86b @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.width); + this.setBlockBounds(0F, 0F, 0F, 1F, ((TileEntityMidasTouch)tile).target.height, 1F); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/80418fb197e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/80418fb197e3001412c4c4819c88e86b new file mode 100644 index 0000000..2c330f3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/80418fb197e3001412c4c4819c88e86b @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.width); + this.setBlockBounds(1f - ((TileEntityMidasTouch)tile).target.width/2, 0F, 1f -((TileEntityMidasTouch)tile).target.width/2, 1f -((TileEntityMidasTouch)tile).target.width/2, ((TileEntityMidasTouch)tile).target.height, 1f -((TileEntityMidasTouch)tile).target.width/2); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/80d06da024e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/80d06da024e60014127dc373d78c1666 new file mode 100644 index 0000000..6728181 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/80d06da024e60014127dc373d78c1666 @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/0037843510e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/0037843510e60014127dc373d78c1666 new file mode 100644 index 0000000..cdc8f54 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/0037843510e60014127dc373d78c1666 @@ -0,0 +1,581 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/208b7b02fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/208b7b02fce40014174fe663e69b8422 new file mode 100644 index 0000000..d970f43 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/208b7b02fce40014174fe663e69b8422 @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.*; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/c07337da02e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/c07337da02e50014174fe663e69b8422 new file mode 100644 index 0000000..4928cdf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/c07337da02e50014174fe663e69b8422 @@ -0,0 +1,57 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return Block.getBlockFromItem(item.getItem()).getIcon(6, 0); + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/e0e3109acfdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/e0e3109acfdf00141dc6c962aec96210 deleted file mode 100644 index 1574be4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/e0e3109acfdf00141dc6c962aec96210 +++ /dev/null @@ -1,102 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); -// if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); -// } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/40a0b31607e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/40a0b31607e50014174fe663e69b8422 new file mode 100644 index 0000000..9453d1e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/40a0b31607e50014174fe663e69b8422 @@ -0,0 +1,96 @@ +package darkknight.jewelrycraft.proxy; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.InventoryTabVanilla; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.TabRegistry; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.entities.renders.HeartRender; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.render.ItemRender; +import darkknight.jewelrycraft.model.ModelDisplayer; +import darkknight.jewelrycraft.model.ModelHalfHeart; +import darkknight.jewelrycraft.model.ModelHandPedestal; +import darkknight.jewelrycraft.model.ModelHeart; +import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; +import darkknight.jewelrycraft.model.ModelMolder; +import darkknight.jewelrycraft.model.ModelShadowEye; +import darkknight.jewelrycraft.model.ModelShadowHand; +import darkknight.jewelrycraft.model.ModelSmelter; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMidasTouchRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/ShadowHand.png"); + TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMidasTouch.class, new TileEntityMidasTouchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); + + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ItemList.goldObj), new ItemRender(); + + VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation(Variables.MODID, "textures/entities/jeweler.png")); + + RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); + + TabRegistry.registerTab(new InventoryTabVanilla()); + TabRegistry.registerTab(new TabJewelry()); + MinecraftForge.EVENT_BUS.register(new TabRegistry()); + MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); + ResourceLocation jeweleryTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/503edced25e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/503edced25e60014127dc373d78c1666 new file mode 100644 index 0000000..561f972 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/503edced25e60014127dc373d78c1666 @@ -0,0 +1,97 @@ +package darkknight.jewelrycraft.proxy; + +import main.java.tconstruct.client.tabs.InventoryTabVanilla; +import main.java.tconstruct.client.tabs.TabRegistry; +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.VillagerRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.entities.renders.HeartRender; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.render.ItemRender; +import darkknight.jewelrycraft.model.ModelDisplayer; +import darkknight.jewelrycraft.model.ModelHalfHeart; +import darkknight.jewelrycraft.model.ModelHandPedestal; +import darkknight.jewelrycraft.model.ModelHeart; +import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; +import darkknight.jewelrycraft.model.ModelMolder; +import darkknight.jewelrycraft.model.ModelShadowEye; +import darkknight.jewelrycraft.model.ModelShadowHand; +import darkknight.jewelrycraft.model.ModelSmelter; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMidasTouchRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/ShadowHand.png"); + TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMidasTouch.class, new TileEntityMidasTouchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); + + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); + MinecraftForgeClient.registerItemRenderer(ItemList.goldObj, new ItemRender()); + + VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation(Variables.MODID, "textures/entities/jeweler.png")); + + RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); + + if (!Loader.isModLoaded("TConstruct") && TabRegistry.getTabList().size() < 1) TabRegistry.registerTab(new InventoryTabVanilla()); + TabRegistry.registerTab(new TabJewelry()); + MinecraftForge.EVENT_BUS.register(new TabRegistry()); + MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); + ResourceLocation jeweleryTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/800cba6310e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/800cba6310e60014127dc373d78c1666 new file mode 100644 index 0000000..53e2d36 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/800cba6310e60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } +// else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ +// GL11.glTranslatef(-0.3F, 0.4F, 0.93F); +// GL11.glRotatef(45f, 0f, 1f, 0f); +// GL11.glRotatef(-25f, 0f, 0f, 1f); +// } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/a08d42f22dde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/a08d42f22dde00141043c3025ec60dfc deleted file mode 100644 index f017d1b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/a08d42f22dde00141043c3025ec60dfc +++ /dev/null @@ -1,107 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ -// for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(5, resolution.getScaledHeight() - 50 + 16 * count, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15, resolution.getScaledHeight() - 45 + 16 * count, 16777215); -// if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5, resolution.getScaledHeight() - 50 + 16 * count, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15, resolution.getScaledHeight() - 45 + 16 * count, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() - 50 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/700de6a60fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/700de6a60fe60014127dc373d78c1666 new file mode 100644 index 0000000..1ce9c6d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/700de6a60fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 1.0F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-15f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/506cbafe2be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/506cbafe2be60014127dc373d78c1666 new file mode 100644 index 0000000..03bce28 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/506cbafe2be60014127dc373d78c1666 @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla)){ + System.out.println(t); + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla)) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/607a0b0a28de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/607a0b0a28de00141043c3025ec60dfc deleted file mode 100644 index 1ff9c0d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/607a0b0a28de00141043c3025ec60dfc +++ /dev/null @@ -1,465 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss() && playerInfo.getInteger("cursePoints") > 0){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/a002d0b6cedf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/a002d0b6cedf00141dc6c962aec96210 deleted file mode 100644 index 8d14eb4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/a002d0b6cedf00141dc6c962aec96210 +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - if(rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2 + JewelryNBT.numberOfModifiers(item)/4)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX)*(rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0? 1:-1); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ)*(rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0? 1:-1); - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 150 - JewelryNBT.numberOfModifiers(item)*10, 2 - JewelryNBT.numberOfModifiers(item)/5)); - // Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(520 - JewelryNBT.numberOfModifiers(item)*20) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - if (jewelry instanceof ItemRing && exists && rand.nextInt(200) == 12){ - // Negative ring - Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 2.1F - JewelryNBT.numberOfModifiers(item)*0.1F); - // Positive ring - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/f0ded3dbcedf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/f0ded3dbcedf00141dc6c962aec96210 deleted file mode 100644 index fe92fcd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/f0ded3dbcedf00141dc6c962aec96210 +++ /dev/null @@ -1,185 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; -// System.out.println(red + " " + green + " " + blue); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/0027527092e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/0027527092e3001417b2e384bf7c3702 new file mode 100644 index 0000000..3ea8ce3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/0027527092e3001417b2e384bf7c3702 @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, 2D, 0D, 0D, 1F, 1F); +// RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, midas.target.posX - Minecraft.getMinecraft().thePlayer.posX, midas.target.posY - Minecraft.getMinecraft().thePlayer.posY, midas.target.posZ - Minecraft.getMinecraft().thePlayer.posZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/00a2b6defce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/00a2b6defce40014174fe663e69b8422 new file mode 100644 index 0000000..3293158 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/00a2b6defce40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/80383f3671e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/80383f3671e300141084bb8bfb075c08 new file mode 100644 index 0000000..a059832 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/80383f3671e300141084bb8bfb075c08 @@ -0,0 +1,72 @@ +package darkknight.jewelrycraft.tileentity; + +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityMidasTouch extends TileEntity +{ + public Entity target; + + public TileEntityMidasTouch() + { + target = null; + } + + /** + * @param nbt + */ + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + NBTTagCompound tag = new NBTTagCompound(); + target.writeToNBT(tag); + nbt.setTag("object", tag); + } + + /** + * @param nbt + */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + } + + /** + * + */ + @Override + public void updateEntity() + { + super.updateEntity(); + } + + /** + * @return + */ + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + /** + * @param net + * @param packet + */ + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + readFromNBT(packet.func_148857_g()); + worldObj.func_147479_m(xCoord, yCoord, zCoord); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/908e94da36e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/908e94da36e100141e1cc3c3be242e56 new file mode 100644 index 0000000..8867a73 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/908e94da36e100141e1cc3c3be242e56 @@ -0,0 +1,454 @@ +package darkknight.jewelrycraft.worldGen.village; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureVillagePieces; +import net.minecraft.world.gen.structure.StructureVillagePieces.Start; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.ItemMolds; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class ComponentJewelry extends StructureVillagePieces.House1 +{ + private int averageGroundLevel = -1; + + /** + * + */ + public ComponentJewelry() + {} + + /** + * @param par1ComponentVillageStartPiece + * @param par2 + * @param par3Random + * @param par4StructureBoundingBox + * @param par5 + */ + public ComponentJewelry(Start par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) + { + super(); + coordBaseMode = par5; + boundingBox = par4StructureBoundingBox; + } + + /** + * @param villagePiece + * @param pieces + * @param random + * @param p1 + * @param p2 + * @param p3 + * @param p4 + * @param p5 + * @return + */ + @SuppressWarnings ("rawtypes") + public static ComponentJewelry buildComponent(Start villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 11, 5, 12, p4); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentJewelry(villagePiece, p5, random, structureboundingbox, p4) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the end, it adds Fences... + * + * @param world + * @param random + * @param sbb + * @return + */ + @Override + public boolean addComponentParts(World world, Random random, StructureBoundingBox sbb) + { + if (averageGroundLevel < 0){ + averageGroundLevel = getAverageGroundLevel(world, sbb); + if (averageGroundLevel < 0) return true; + boundingBox.offset(0, averageGroundLevel - boundingBox.maxY + 3, 0); + } + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace) + */ + fillWithBlocks(world, sbb, 0, 0, 6, 10, 5, 11, Block.getBlockById(0), Block.getBlockById(0), false); + fillWithBlocks(world, sbb, 2, 0, 0, 8, 5, 5, Block.getBlockById(0), Block.getBlockById(0), false); + // Pillars + fillWithBlocks(world, sbb, 2, 0, 0, 2, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 2, 0, 3, 2, 3, 3, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 0, 8, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 3, 8, 3, 3, Blocks.log, Blocks.log, false); + // Walls + fillWithBlocks(world, sbb, 2, 0, 1, 2, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 2, 0, 4, 2, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 1, 8, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 4, 8, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 3, 0, 0, 7, 3, 0, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 3, 6, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 11, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 6, 0, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 10, 0, 6, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + // Roof + for(int i = 3; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 2, i, 4, j, sbb); + for(int i = 3; i <= 7; i++) + for(int j = 6; j <= 6; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, i, 4, j, sbb); + for(int i = 1; i <= 9; i++) + for(int j = 7; j <= 10; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 3, i, 4, j, sbb); + for(int i = 2; i <= 8; i++) + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, i, 4, 0, sbb); + for(int i = 1; i <= 5; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 2, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 8, 4, i, sbb); + } + for(int i = 0; i <= 2; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 6, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i + 8, 4, 6, sbb); + } + for(int i = 7; i <= 11; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 0, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 10, 4, i, sbb); + } + for(int i = 0; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 11, sbb); + // Base + for(int i = 2; i <= 8; i++) + for(int j = 0; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.planks, 1, i, 0, j, sbb); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 0, 11, Blocks.stonebrick, Blocks.stonebrick, false); + for(int i = 6; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 5, 0, i, sbb); + for(int i = 7; i <= 10; i++){ + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 1, 0, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 9, 0, i, sbb); + } + // Decorations + placeDoorAtCurrentPosition(world, sbb, random, 6, 1, 0, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeDoorAtCurrentPosition(world, sbb, random, 5, 1, 6, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 3, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 4, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 3, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 3, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 7, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 7, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 10, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 9, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 9, sbb); + int bgCarpetColor = random.nextInt(16); + for(int i = 4; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.carpet, bgCarpetColor, i, 1, j, sbb); + generateChest(world, 3, 1, 1, 0, random, sbb, ConfigHandler.jewelsChestMin, ConfigHandler.jewelsChestMax); + generateDisplayer(world, 3, 1, 2, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + placeBlockAtCurrentPosition(world, BlockList.jewelCraftingTable, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, 3, 1, 3, sbb); + generateDisplayer(world, 3, 1, 4, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + generateChest(world, 3, 1, 5, 0, random, sbb, ConfigHandler.jewelsChestMin, ConfigHandler.jewelsChestMax); + generateFurnace(world, 1, 1, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 1, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateSmelter(world, 1, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateSmelter(world, 1, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateMolder(world, 2, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + generateMolder(world, 2, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + for(int l = 0; l < 6; ++l) + for(int i1 = 2; i1 < 9; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + for(int l = 6; l < 12; ++l) + for(int i1 = 0; i1 < 11; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + spawnVillagers(world, sbb, 3, 1, 3, 1); + return true; + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + */ + public void generateChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, Blocks.chest, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + ItemStack jewels = JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size())); + chest.func_145976_a("Jeweler's Chest"); + if (jewels.getItem() == Items.nether_star && ConfigHandler.GENERATE_VILLAGE_NETHERSTAR) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + else if (random.nextBoolean() && jewels.getItem() != Items.nether_star) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateIngotChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ingot Chest"); + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), metal); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateOresChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ores Chest"); + int oreID = random.nextInt(JewelrycraftUtil.ores.size()); + ItemStack ores = JewelrycraftUtil.ores.get(oreID).copy(); + ores.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), ores); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + */ + public void generateDisplayer(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.displayer, metadata, i, j, k, sbb); + TileEntityDisplayer displayer = (TileEntityDisplayer)world.getTileEntity(i1, j1, k1); + if (displayer != null){ + Item[] jewels = {ItemList.ring, ItemList.necklace}; + ItemStack jewel = new ItemStack(jewels[random.nextInt(jewels.length)]); + JewelryNBT.addMetal(jewel, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()))); + JewelryNBT.addModifiers(jewel, JewelrycraftUtil.addRandomModifiers(random.nextInt(4))); + JewelryNBT.addGem(jewel, JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size()))); + displayer.object = jewel; + displayer.quantity = 1; + displayer.hasObject = true; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param isEmpty + */ + public void generateSmelter(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean isEmpty) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.smelter, metadata, i, j, k, sbb); + TileEntitySmelter smelter = (TileEntitySmelter)world.getTileEntity(i1, j1, k1); + if (smelter != null && !isEmpty){ + int metal = random.nextInt(JewelrycraftUtil.metal.size()); + smelter.moltenMetal = JewelrycraftUtil.metal.get(metal).copy(); + smelter.hasMoltenMetal = true; + int quantity = random.nextInt(9); + switch(quantity) + { + case 0: + smelter.quantity = 0.1f; + case 1: + smelter.quantity = 0.2f; + case 2: + smelter.quantity = 0.3f; + case 3: + smelter.quantity = 0.4f; + case 4: + smelter.quantity = 0.5f; + case 5: + smelter.quantity = 0.6f; + case 6: + smelter.quantity = 0.7f; + case 7: + smelter.quantity = 0.8f; + case 8: + smelter.quantity = 0.9f; + default: + smelter.quantity = 0.1f; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param hasMold + * @param hasStuff + */ + public void generateMolder(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean hasMold, boolean hasStuff) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.molder, metadata, i, j, k, sbb); + TileEntityMolder molder = (TileEntityMolder)world.getTileEntity(i1, j1, k1); + if (molder != null && !molder.hasMold) if (hasMold){ + int meta = random.nextInt(ItemMolds.moldsItemNames.length); + molder.mold = new ItemStack(ItemList.molds, 1, meta); + molder.hasMold = true; + if (hasStuff){ + ItemStack ring = new ItemStack(ItemList.ring); + JewelryNBT.addMetal(ring, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack necklace = new ItemStack(ItemList.necklace); + JewelryNBT.addMetal(necklace, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack bracelet = new ItemStack(ItemList.bracelet); + JewelryNBT.addMetal(bracelet, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack earrings = new ItemStack(ItemList.earrings); + JewelryNBT.addMetal(earrings, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + if (meta == 0) molder.jewelBase = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())); + else if (meta == 1) molder.jewelBase = ring; + else if (meta == 2) molder.jewelBase = necklace; + else if (meta == 3) molder.jewelBase = bracelet; + else if (meta == 4) molder.jewelBase = earrings; + molder.hasJewelBase = true; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param hasMetal + */ + public void generateFurnace(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, boolean hasMetal) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, Blocks.furnace, metadata, i, j, k, sbb); + TileEntityFurnace furnace = (TileEntityFurnace)world.getTileEntity(i1, j1, k1); + if (furnace != null){ + if (random.nextBoolean()) furnace.setInventorySlotContents(1, new ItemStack(Items.coal, 1 + random.nextInt(16))); + if (hasMetal){ + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = random.nextInt(max - min + 1) + min; + furnace.setInventorySlotContents(2, metal); + } + } + } + + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + * + * @param par1 + * @return + */ + @Override + protected int getVillagerType(int par1) + { + return 3000; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/a049720d0be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/a049720d0be60014127dc373d78c1666 new file mode 100644 index 0000000..7f1dad2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/a049720d0be60014127dc373d78c1666 @@ -0,0 +1,94 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockCompressed; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); +// player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("nugget ")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("ingot ")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockCompressed) return new ItemStack(Blocks.gold_block, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/006abc9323e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/006abc9323e60014127dc373d78c1666 new file mode 100644 index 0000000..e24f150 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/006abc9323e60014127dc373d78c1666 @@ -0,0 +1,76 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + GL11.glRotatef(90F, 1F, 0F, 0F); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); +// GL11.glRotatef(-90F, 1F, 0F, 0F); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/706949a171e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/706949a171e300141084bb8bfb075c08 new file mode 100644 index 0000000..dd4db0c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/706949a171e300141084bb8bfb075c08 @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.tileentity.TileEntityAltar; +import darkknight.jewelrycraft.tileentity.TileEntityBlockShadow; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.Variables; + +public class BlockList +{ + public static Block shadowOre, smelter, molder, displayer, jewelCraftingTable, shadowBlock, shadowEye, jewelAltar, handPedestal, shadowHand, midasTouchBlock; + public static BlockMoltenMetal moltenMetal; + public static Fluid moltenMetalFluid; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + shadowOre = new BlockJCOre().setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockTextureName(Variables.MODID + ":oreShadow").setBlockName(Variables.MODID + ".oreShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + smelter = new BlockSmelter().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".smelter").setCreativeTab(JewelrycraftMod.jewelrycraft); + molder = new BlockMolder(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".molder").setCreativeTab(JewelrycraftMod.jewelrycraft); + displayer = new BlockDisplayer(Material.iron).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypeMetal).setBlockName(Variables.MODID + ".displayer").setCreativeTab(JewelrycraftMod.jewelrycraft); + jewelCraftingTable = new BlockJewelrsCraftingTable(Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".jewelCraftingTable").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowBlock = new BlockShadow().setHardness(5.0F).setResistance(7.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName(Variables.MODID + ":blockShadow").setBlockName(Variables.MODID + ".blockShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + jewelAltar = new BlockJewelAltar().setHardness(5.0F).setResistance(2.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName(Variables.MODID + ":altar").setBlockName(Variables.MODID + ".altar").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowEye = new BlockShadowEye().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".shadowEye").setCreativeTab(JewelrycraftMod.jewelrycraft); + handPedestal = new BlockHandPedestal(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".handPedestal").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowHand = new BlockShadowHand(Material.rock).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".shadowHand").setCreativeTab(JewelrycraftMod.jewelrycraft).setBlockUnbreakable(); + midasTouchBlock = new BlockMidasTouch(Material.iron).setHardness(3.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal).setBlockName(Variables.MODID + ".midasTouchBlock").setCreativeTab(JewelrycraftMod.jewelrycraft); + + GameRegistry.registerBlock(shadowOre, "shadowOre"); + GameRegistry.registerBlock(shadowBlock, "shadowBlock"); + GameRegistry.registerBlock(smelter, "Smelter"); + GameRegistry.registerBlock(molder, "Molder"); + GameRegistry.registerBlock(jewelCraftingTable, "jewelCraftingTable"); + GameRegistry.registerBlock(displayer, "Displayer"); + GameRegistry.registerBlock(jewelAltar, "Altar"); + GameRegistry.registerBlock(shadowEye, "Shadow Eye"); + GameRegistry.registerBlock(handPedestal, "Stone Bricks Pedestal"); + GameRegistry.registerBlock(shadowHand, "Shadow Hand"); + GameRegistry.registerBlock(midasTouchBlock, "Midas Touch Block"); + + GameRegistry.registerTileEntity(TileEntitySmelter.class, Variables.MODID + ":smelter"); + GameRegistry.registerTileEntity(TileEntityMolder.class, Variables.MODID + ":molder"); + GameRegistry.registerTileEntity(TileEntityJewelrsCraftingTable.class, Variables.MODID + ":table"); + GameRegistry.registerTileEntity(TileEntityDisplayer.class, Variables.MODID + ":displayer"); + GameRegistry.registerTileEntity(TileEntityBlockShadow.class, Variables.MODID + ":blockShadow"); + GameRegistry.registerTileEntity(TileEntityAltar.class, Variables.MODID + ":altar"); + GameRegistry.registerTileEntity(TileEntityShadowEye.class, Variables.MODID + ":shadowEye"); + GameRegistry.registerTileEntity(TileEntityHandPedestal.class, Variables.MODID + ":handPedestal"); + GameRegistry.registerTileEntity(TileEntityShadowHand.class, Variables.MODID + ":shadowHand"); + + moltenMetalFluid = new Fluid("metal.molten").setLuminosity(15).setDensity(3000).setTemperature(2000).setViscosity(6000); + if (!FluidRegistry.registerFluid(moltenMetalFluid)) moltenMetalFluid = FluidRegistry.getFluid("metal.molten"); + moltenMetal = new BlockMoltenMetal(moltenMetalFluid, Material.lava); + GameRegistry.registerBlock(moltenMetal, "moltenMetalLiquid"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/10513bc210e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/10513bc210e60014127dc373d78c1666 new file mode 100644 index 0000000..42f7b48 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/10513bc210e60014127dc373d78c1666 @@ -0,0 +1,585 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.45F, 0.45F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/501314b626de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/501314b626de00141043c3025ec60dfc deleted file mode 100644 index bbcf482..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/501314b626de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(20, 16 + (size + 20) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/a0cc56d4fbe40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/a0cc56d4fbe40014174fe663e69b8422 new file mode 100644 index 0000000..4b85be6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/a0cc56d4fbe40014174fe663e69b8422 @@ -0,0 +1,68 @@ +package darkknight.jewelrycraft.item; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import javax.imageio.ImageIO; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.effects.ModifierEffects; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldifiedObject extends Item +{ + public ItemGoldifiedObject() + { + super(); + } + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/c0982a0792e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/c0982a0792e3001417b2e384bf7c3702 new file mode 100644 index 0000000..54ebba0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/c0982a0792e3001417b2e384bf7c3702 @@ -0,0 +1,26 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, te.xCoord - (int)Minecraft.getMinecraft().thePlayer.posX, te.yCoord - (int)Minecraft.getMinecraft().thePlayer.posY, te.zCoord - (int)Minecraft.getMinecraft().thePlayer.posZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/d012a06acedf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/d012a06acedf00141dc6c962aec96210 deleted file mode 100644 index f133a3b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/d012a06acedf00141dc6c962aec96210 +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - if(rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2 + JewelryNBT.numberOfModifiers(item)/4)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX)*(rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0? 1:-1); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ)*(rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0? 1:-1); - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 150 - JewelryNBT.numberOfModifiers(item)*10, 2 - JewelryNBT.numberOfModifiers(item)/5)); - // Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(520 - JewelryNBT.numberOfModifiers(item)*20) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - if (jewelry instanceof ItemRing && exists && rand.nextInt(200) == 12){ - // Negative ring - Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.0F); - // Positive ring - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/3003c407fee40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/3003c407fee40014174fe663e69b8422 new file mode 100644 index 0000000..cd510dc --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/3003c407fee40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + public static Item goldifiedObject; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldObj().setUnlocalizedName(Variables.MODID + ".goldObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/c0db3b8431e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/c0db3b8431e100141e1cc3c3be242e56 new file mode 100644 index 0000000..fc1a3b6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/c0db3b8431e100141e1cc3c3be242e56 @@ -0,0 +1,60 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static int ingotCoolingTime; + public static int ingotMeltingTime; + public static int jewelryCraftingTime; + public static boolean generateVillageNetherstar; + public static boolean canFurnacesGenerateIngots; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack = 2; + public static int jewelsChestMin = 2; + public static int jewelsChestMax = 5; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + ingotCoolingTime = config.get("Timers", "Molder Ingot Cooling Time", ingotCoolingTime, "This sets the number of ticks you need to wait before the mold is cooled.").getInt(100); + ingotMeltingTime = config.get("Timers", "Ingot Melting Time", ingotMeltingTime, "This sets the number of ticks you need to wait before an ingot is completely smelted.").getInt(1500); + jewelryCraftingTime = config.get("Timers", "Jewelry Crafting Time", jewelryCraftingTime, "This sets the number of ticks it takes for a jewel to be modified.").getInt(200); + generateVillageNetherstar = config.get("Village Generation", "Netherstar Generation", generateVillageNetherstar, "If set to true Nether Stars will be able to generate in Jewelers chests.").getBoolean(false); + canFurnacesGenerateIngots = config.get("Village Generation", "Furnace Ingots Generation", canFurnacesGenerateIngots, "If set to true jewelers will generate ingots in furnaces.").getBoolean(true); + maxVillageJewelers = config.get("Village Generation", "Maximum Jewelers", maxVillageJewelers, "Sets how many jewelers can be in a village.").getInt(1); + jewelerWeight = config.get("Village Generation", "Jewelers Weight", jewelerWeight, "Chance of getting a jeweler in a village. The higher the value, the higher the chance.").getInt(30); + ingotChestMin = config.get("Village Generation", "Ingot Chest Min", ingotChestMin, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)").getInt(1); + ingotChestMax = config.get("Village Generation", "Ingot Chest Max", ingotChestMax, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)").getInt(4); + ingotChestMaxStack = config.get("Village Generation", "Ingot Chest Max Stack", ingotChestMaxStack, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest.").getInt(2); + jewelsChestMin = config.get("Village Generation", "Jewelers Chest Min", jewelsChestMin, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler.").getInt(2); + jewelsChestMax = config.get("Village Generation", "Jewelers Chest Max", jewelsChestMax, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler.").getInt(5); + furnacesIngotStackMin = config.get("Village Generation", "Ingot Furnace Min", furnacesIngotStackMin, "Determines the minimum number of ingots that can generate in a furnace.").getInt(2); + furnacesIngotStackMax = config.get("Village Generation", "Ingot Furnace Max", furnacesIngotStackMax, "Determines the maximum number of ingots that can generate in a furnace.").getInt(5); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/f08e283892e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/f08e283892e3001417b2e384bf7c3702 new file mode 100644 index 0000000..15da89c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/f08e283892e3001417b2e384bf7c3702 @@ -0,0 +1,26 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, midas.target.posX - Minecraft.getMinecraft().thePlayer.posX, midas.target.posY - Minecraft.getMinecraft().thePlayer.posY, midas.target.posZ - Minecraft.getMinecraft().thePlayer.posZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/4094f8e609de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/4094f8e609de00141043c3025ec60dfc deleted file mode 100644 index ffd2967..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/4094f8e609de00141043c3025ec60dfc +++ /dev/null @@ -1,184 +0,0 @@ -package darkknight.jewelrycraft.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int red = ingotColor >> 16 & 0xff; - int green = ingotColor >> 8 & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/60cb78e111e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/60cb78e111e60014127dc373d78c1666 new file mode 100644 index 0000000..d46627e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/60cb78e111e60014127dc373d78c1666 @@ -0,0 +1,590 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + protected static RenderItem itemRender = new RenderItem(); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glPushMatrix(); + GL11.glColor3f(1F, 1F, 0F); +// renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + itemRender.renderItemAndEffectIntoGUI(mc.fontRenderer, this.mc.getTextureManager(), item, 0, 0); + GL11.glPopMatrix(); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/003d2b0505de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/003d2b0505de00141043c3025ec60dfc deleted file mode 100644 index 67723ad..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/003d2b0505de00141043c3025ec60dfc +++ /dev/null @@ -1,279 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (active && target != null && this.getDistanceFrom(target.posX, target.posY, target.posZ) > 30D){ - active = false; - timer = -1; - t = 20; - } - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(10D, 10D, 10D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(10D, 10D, 10D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - else if(pedestal != null && target != null) JewelrycraftUtil.addCursePoints(target, 20); - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/20405a71ccdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/20405a71ccdf00141dc6c962aec96210 deleted file mode 100644 index a7ef758..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/20405a71ccdf00141dc6c962aec96210 +++ /dev/null @@ -1,96 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if ((arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0) && rand.nextInt(2 + JewelryNBT.numberOfModifiers(item)) == 0) arrow.setDead(); - } - } - } - if (jewelry instanceof ItemBracelet && exists){ - // Positive bracelet - if (player.motionY < 0) player.motionY *= (0.6D + (JewelryNBT.numberOfModifiers(item) - 1) * 0.03D); - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) player.fallDistance = 0F; - // Negative bracelet - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80 + JewelryNBT.numberOfModifiers(item) * 10, 1 + JewelryNBT.numberOfModifiers(item) / 4)); - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - // Negative ring - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / (2F + (JewelryNBT.numberOfModifiers(item)-1)*0.1F)); - // Positive ring - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 51 - JewelryNBT.numberOfModifiers(item)); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/304b2ee02be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/304b2ee02be60014127dc373d78c1666 new file mode 100644 index 0000000..bcc8d2b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/304b2ee02be60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || tabList.get(1).visible){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || tabList.get(1).visible) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/4002026028de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/4002026028de00141043c3025ec60dfc deleted file mode 100644 index 1ff9c0d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/4002026028de00141043c3025ec60dfc +++ /dev/null @@ -1,465 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss() && playerInfo.getInteger("cursePoints") > 0){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/607789ae0fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/607789ae0fe60014127dc373d78c1666 new file mode 100644 index 0000000..55e6a1d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/607789ae0fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 1.0F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/609f909029de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/609f909029de00141043c3025ec60dfc deleted file mode 100644 index 7dee848..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/609f909029de00141043c3025ec60dfc +++ /dev/null @@ -1,122 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.commands; - -/** - * @author Sorin - * - */ -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; - -public class JewelrycraftCommands extends CommandBase -{ - private List aliases; - - public JewelrycraftCommands() - { - this.aliases = new ArrayList(); - this.aliases.add("jw"); - this.aliases.add("jewelry"); - } - - @Override - public String getCommandName() - { - return "jewelrycraft"; - } - - @Override - public String getCommandUsage(ICommandSender var1) - { - String use = "/jewelrycraft [points] | "; - use += "/jewelrycraft |"; - use += "/jewelrycraft "; - return use; - } - - @Override - public List getCommandAliases() - { - return aliases; - } - - @Override - public void processCommand(ICommandSender commandSender, String[] astring) - { - if (astring.length == 0 || astring[0].equals("help")) throw new WrongUsageException(getCommandUsage(commandSender)); - if (astring[0].equals("getCursePoints")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - commandSender.addChatMessage(new ChatComponentTranslation(Integer.toString(JewelrycraftUtil.getCursePoints(entityplayermp)))); - }else if (astring[0].equals("addCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points); - }else if (astring[0].equals("setCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points - JewelrycraftUtil.getCursePoints(entityplayermp)); - }else if (astring[0].equals("addModifier")){ - ItemStack item = new ItemStack(CommandBase.getItemByText(commandSender, astring[1])); - EntityPlayerMP entityplayermp = getPlayer(commandSender, commandSender.getCommandSenderName()); - ArrayList modifier = new ArrayList(); - modifier.add(item); - JewelryNBT.addModifiers(entityplayermp.getCurrentEquippedItem(), modifier); - }else if (astring[0].equals("addCurse")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - int curse = Integer.valueOf(astring[2]); - int grade = Integer.valueOf(astring[3]); - System.out.println("add curse " + curse + " " + grade); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(entityplayermp, "Jewelrycraft"); - if(curse < Curse.getCurseList().size() && grade <= 2) - { - EntityEventHandler.addCurse(entityplayermp, playerInfo, curse, grade); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - else if(curse >= Curse.getCurseList().size()) entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse ID exceedes the maximum value of " + (Curse.getCurseList().size() - 1))); - else entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse grade exceedes the maximum value of 2")); - - } - } - - @Override - public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring) - { - final List MATCHES = new LinkedList(); - final String ARG_LC = astring[astring.length - 1].toLowerCase(); - if (astring.length == 1){ - if ("addCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCursePoints"); - if ("getCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("getCursePoints"); - if ("setCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("setCursePoints"); - if ("addModifier".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addModifier"); - if ("addCurse".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCurse"); - }else if (astring.length == 2){ - if (!astring[0].equals("addModifier")){ - for(String un: MinecraftServer.getServer().getAllUsernames()) - if (un.toLowerCase().startsWith(ARG_LC)) MATCHES.add(un); - }else if (!astring[0].equals("addCurse")) return getListOfStringsFromIterableMatchingLastWord(astring, Item.itemRegistry.getKeys()); - } - return MATCHES.isEmpty() ? null : MATCHES; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/700a88ac90e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/700a88ac90e3001417b2e384bf7c3702 new file mode 100644 index 0000000..083f63f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/700a88ac90e3001417b2e384bf7c3702 @@ -0,0 +1,54 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(null); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/a0d5c9a72bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/a0d5c9a72bde00141043c3025ec60dfc deleted file mode 100644 index 03f6fe0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/a0d5c9a72bde00141043c3025ec60dfc +++ /dev/null @@ -1,121 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.commands; - -/** - * @author Sorin - * - */ -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; - -public class JewelrycraftCommands extends CommandBase -{ - private List aliases; - - public JewelrycraftCommands() - { - this.aliases = new ArrayList(); - this.aliases.add("jw"); - this.aliases.add("jewelry"); - } - - @Override - public String getCommandName() - { - return "jewelrycraft"; - } - - @Override - public String getCommandUsage(ICommandSender var1) - { - String use = "/jewelrycraft [points] | "; - use += "/jewelrycraft |"; - use += "/jewelrycraft "; - return use; - } - - @Override - public List getCommandAliases() - { - return aliases; - } - - @Override - public void processCommand(ICommandSender commandSender, String[] astring) - { - if (astring.length == 0 || astring[0].equals("help")) throw new WrongUsageException(getCommandUsage(commandSender)); - if (astring[0].equals("getCursePoints")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - commandSender.addChatMessage(new ChatComponentTranslation(Integer.toString(JewelrycraftUtil.getCursePoints(entityplayermp)))); - }else if (astring[0].equals("addCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points); - }else if (astring[0].equals("setCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points - JewelrycraftUtil.getCursePoints(entityplayermp)); - }else if (astring[0].equals("addModifier")){ - ItemStack item = new ItemStack(CommandBase.getItemByText(commandSender, astring[1])); - EntityPlayerMP entityplayermp = getPlayer(commandSender, commandSender.getCommandSenderName()); - ArrayList modifier = new ArrayList(); - modifier.add(item); - JewelryNBT.addModifiers(entityplayermp.getCurrentEquippedItem(), modifier); - }else if (astring[0].equals("addCurse")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - int curse = Integer.valueOf(astring[2]); - int grade = Integer.valueOf(astring[3]); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(entityplayermp, "Jewelrycraft"); - if(curse < Curse.getCurseList().size() && grade <= 2) - { - EntityEventHandler.addCurse(entityplayermp, playerInfo, curse, grade); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - else if(curse >= Curse.getCurseList().size()) entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse ID exceedes the maximum value of " + (Curse.getCurseList().size() - 1))); - else entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse grade exceedes the maximum value of 2")); - - } - } - - @Override - public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring) - { - final List MATCHES = new LinkedList(); - final String ARG_LC = astring[astring.length - 1].toLowerCase(); - if (astring.length == 1){ - if ("addCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCursePoints"); - if ("getCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("getCursePoints"); - if ("setCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("setCursePoints"); - if ("addModifier".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addModifier"); - if ("addCurse".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCurse"); - }else if (astring.length == 2){ - if (!astring[0].equals("addModifier")){ - for(String un: MinecraftServer.getServer().getAllUsernames()) - if (un.toLowerCase().startsWith(ARG_LC)) MATCHES.add(un); - }else if (!astring[0].equals("addCurse")) return getListOfStringsFromIterableMatchingLastWord(astring, Item.itemRegistry.getKeys()); - } - return MATCHES.isEmpty() ? null : MATCHES; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/5081dc2706de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/5081dc2706de00141043c3025ec60dfc deleted file mode 100644 index 086c177..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/5081dc2706de00141043c3025ec60dfc +++ /dev/null @@ -1,123 +0,0 @@ -package darkknight.jewelrycraft.events; - -import java.util.Iterator; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.entities.renders.RenderHelper; -import darkknight.jewelrycraft.item.render.BraceletRender; -import darkknight.jewelrycraft.item.render.EarringsRender; -import darkknight.jewelrycraft.item.render.MaskRender; -import darkknight.jewelrycraft.model.ModelBracelet; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class PlayerRenderHandler -{ - MaskRender mask = new MaskRender(); - EarringsRender earrings = new EarringsRender(); - BraceletRender bracelet = new BraceletRender(); - public static String[] infamyCache = new String[]{}; - - @SubscribeEvent - public void renderScreen(RenderPlayerEvent.Specials.Post event) - { - ModelBiped main = event.renderer.modelBipedMain; - Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); - if (infamyCache != null){ - while (players.hasNext()){ - EntityPlayer player = players.next(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); -// System.out.println(event.entityPlayer + " | " + player + " | " + playerInfo); - if (checkPlayerInfamy(player.getDisplayName()) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){ - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(1.6f, 1.6f, 1.6f); - GL11.glTranslatef(-0.25F, -0.25F, -0.25F); - mask.doRender(event.entityPlayer, 0F, 0F, 0F, 0F, 0F); - GL11.glPopMatrix(); - } - if (playerInfo.hasKey("ext17") && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext17"); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(0.07f, 0.07f, 0.07f); - GL11.glTranslatef(0.0F, 3.0F, -2.0F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - earrings.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - GL11.glPopMatrix(); - } - for(int i = 10; i <= 13; i++) - if (playerInfo.hasKey("ext" + i) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glTranslatef((i / 12 == 1) ? -0.275F : 0.475F, 0.2F + ((i / 12 == 1) ? (i - 12) * 0.08F : (i - 10) * 0.08F), 0F); - if (player.isSneaking()) GL11.glTranslatef(0F, 0F, -((i == 10 || i == 12) ? (0.1F) : 0.05F)); - if (i / 12 == 1){ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedRightArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0.0F); - }else{ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedLeftArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - } - GL11.glPopMatrix(); - } - } - } - } - - /** - * @param string - * @return - */ - private boolean checkPlayerInfamy(String string) - { - for(int i = 0; i < infamyCache.length; i++) - if (infamyCache[i].equals(string)) return true; - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/703581a771e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/703581a771e300141084bb8bfb075c08 new file mode 100644 index 0000000..4d506d3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/703581a771e300141084bb8bfb075c08 @@ -0,0 +1,56 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + Random rand = new Random(); + + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/1057f5e202e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/1057f5e202e60014127dc373d78c1666 new file mode 100644 index 0000000..7eb0cf6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/1057f5e202e60014127dc373d78c1666 @@ -0,0 +1,84 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + setHarvestLevel("ItemPickaxe.class", 2); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 0; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void onBlockHarvested(World world, int i, int j, int k, int meta, EntityPlayer player) + { + System.out.println("Harvest"); + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/30a1626704de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/30a1626704de00141043c3025ec60dfc deleted file mode 100644 index 22e2003..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/30a1626704de00141043c3025ec60dfc +++ /dev/null @@ -1,278 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (active && target != null && this.getDistanceFrom(target.posX, target.posY, target.posZ) > 27D){ - active = false; - timer = -1; - } - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(10D, 10D, 10D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(10D, 10D, 10D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - else if(pedestal != null && target != null) JewelrycraftUtil.addCursePoints(target, 20); - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/30f15f9026e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/30f15f9026e60014127dc373d78c1666 new file mode 100644 index 0000000..3358ba4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/30f15f9026e60014127dc373d78c1666 @@ -0,0 +1,69 @@ +package darkknight.jewelrycraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab; +import darkknight.jewelrycraft.events.KeyBindings; + +public class GuiJewelry extends GuiContainer +{ + ResourceLocation texture; + + /** + * @param containerJewelryTab + * @param texture + */ + public GuiJewelry(ContainerJewelryTab containerJewelryTab, ResourceLocation texture) + { + super(containerJewelryTab); + xSize = 194; + ySize = 166; + this.texture = texture; + } + + /** + * @param f + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) + { + GL11.glColor3f(1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + } + + /** + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + {} + + /** + * @param charecter + * @param key + */ + @Override + protected void keyTyped(char charecter, int key) + { + super.keyTyped(charecter, key); + if (key == KeyBindings.inventory.getKeyCode()) mc.thePlayer.closeScreen(); + } + + @Override + public void initGui () + { + super.initGui(); + int cornerX = guiLeft; + int cornerY = guiTop; + this.buttonList.clear(); + TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class); + TabRegistry.addTabsToList(this.buttonList); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/801465eccbdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/801465eccbdf00141dc6c962aec96210 deleted file mode 100644 index 02ffc1e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/801465eccbdf00141dc6c962aec96210 +++ /dev/null @@ -1,98 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if ((arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0) && rand.nextInt(2 + JewelryNBT.numberOfModifiers(item)) == 0) arrow.setDead(); - } - } - } - - if (jewelry instanceof ItemBracelet && exists){ - // Positive bracelet - if (player.motionY < 0) player.motionY *= (0.6D + (JewelryNBT.numberOfModifiers(item) - 1)*0.03D); - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) player.fallDistance = 0F; - // Negative bracelet - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) - player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80 + JewelryNBT.numberOfModifiers(item)*10, 1 + JewelryNBT.numberOfModifiers(item)/4)); - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - // Negative ring - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - // Positive ring - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/705d9b5b23e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/705d9b5b23e60014127dc373d78c1666 new file mode 100644 index 0000000..2fe1ead --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/705d9b5b23e60014127dc373d78c1666 @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + GL11.glRotatef(90F, 0F, 1F, 0F); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/c036359431e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/c036359431e100141e1cc3c3be242e56 new file mode 100644 index 0000000..b12cd38 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/c036359431e100141e1cc3c3be242e56 @@ -0,0 +1,12 @@ +/** + * + */ +package darkknight.jewelrycraft.config; + +/** + * @author Sorin + * + */ +public class ConfigGui +{ +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/c083e9b42bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/c083e9b42bde00141043c3025ec60dfc deleted file mode 100644 index 0faea2e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/c083e9b42bde00141043c3025ec60dfc +++ /dev/null @@ -1,122 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.commands; - -/** - * @author Sorin - * - */ -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; - -public class JewelrycraftCommands extends CommandBase -{ - private List aliases; - - public JewelrycraftCommands() - { - this.aliases = new ArrayList(); - this.aliases.add("jw"); - this.aliases.add("jewelry"); - } - - @Override - public String getCommandName() - { - return "jewelrycraft"; - } - - @Override - public String getCommandUsage(ICommandSender var1) - { - String use = "/jewelrycraft [points] | "; - use += "/jewelrycraft |"; -// use += "/jewelrycraft "; - return use; - } - - @Override - public List getCommandAliases() - { - return aliases; - } - - @Override - public void processCommand(ICommandSender commandSender, String[] astring) - { - if (astring.length == 0 || astring[0].equals("help")) throw new WrongUsageException(getCommandUsage(commandSender)); - if (astring[0].equals("getCursePoints")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - commandSender.addChatMessage(new ChatComponentTranslation(Integer.toString(JewelrycraftUtil.getCursePoints(entityplayermp)))); - }else if (astring[0].equals("addCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points); - }else if (astring[0].equals("setCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points - JewelrycraftUtil.getCursePoints(entityplayermp)); - }else if (astring[0].equals("addModifier")){ - ItemStack item = new ItemStack(CommandBase.getItemByText(commandSender, astring[1])); - EntityPlayerMP entityplayermp = getPlayer(commandSender, commandSender.getCommandSenderName()); - ArrayList modifier = new ArrayList(); - modifier.add(item); - JewelryNBT.addModifiers(entityplayermp.getCurrentEquippedItem(), modifier); - } -// else if (astring[0].equals("addCurse")){ -// EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); -// int curse = Integer.valueOf(astring[2]); -// int grade = Integer.valueOf(astring[3]); -// NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(entityplayermp, "Jewelrycraft"); -// if(curse < Curse.getCurseList().size() && grade <= 2) -// { -// EntityEventHandler.addCurse(entityplayermp, playerInfo, curse, grade); -// JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); -// } -// else if(curse >= Curse.getCurseList().size()) entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse ID exceedes the maximum value of " + (Curse.getCurseList().size() - 1))); -// else entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse grade exceedes the maximum value of 2")); -// -// } - } - - @Override - public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring) - { - final List MATCHES = new LinkedList(); - final String ARG_LC = astring[astring.length - 1].toLowerCase(); - if (astring.length == 1){ - if ("addCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCursePoints"); - if ("getCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("getCursePoints"); - if ("setCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("setCursePoints"); - if ("addModifier".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addModifier"); -// if ("addCurse".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCurse"); - }else if (astring.length == 2){ - if (!astring[0].equals("addModifier")){ - for(String un: MinecraftServer.getServer().getAllUsernames()) - if (un.toLowerCase().startsWith(ARG_LC)) MATCHES.add(un); - }else if (!astring[0].equals("addCurse")) return getListOfStringsFromIterableMatchingLastWord(astring, Item.itemRegistry.getKeys()); - } - return MATCHES.isEmpty() ? null : MATCHES; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/00c5f4c902de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/00c5f4c902de00141043c3025ec60dfc deleted file mode 100644 index 21075d9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/00c5f4c902de00141043c3025ec60dfc +++ /dev/null @@ -1,131 +0,0 @@ -package darkknight.jewelrycraft.block; - -import java.util.Random; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; - -public class BlockShadowEye extends BlockContainer -{ - Random rand = new Random(); - - protected BlockShadowEye() - { - super(Material.rock); - } - - /** - * @param world - * @param var2 - * @return - */ - @Override - public TileEntity createNewTileEntity(World world, int var2) - { - return new TileEntityShadowEye(); - } - - /** - * @return - */ - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - /** - * @param iblockaccess - * @param i - * @param j - * @param k - * @param l - * @return - */ - @Override - public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) - { - return false; - } - - /** - * @return - */ - @Override - public boolean isOpaqueCube() - { - return false; - } - - /** - * @return - */ - @Override - public int getRenderType() - { - return -1; - } - - /** - * @param world - * @param i - * @param j - * @param k - * @param entityPlayer - * @param par6 - * @param par7 - * @param par8 - * @param par9 - * @return - */ - @Override - public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) - { - TileEntityShadowEye tile = (TileEntityShadowEye)world.getTileEntity(i, j, k); - tile.active = true; - return true; - } - - /** - * @param world - * @param i - * @param j - * @param k - * @param player - */ - @Override - public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) - {} - - /** - * @param world - * @param i - * @param j - * @param k - * @param entityLiving - * @param par6ItemStack - */ - @Override - public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack) - { - int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - world.setBlockMetadataWithNotify(i, j, k, rotation, 2); - } - - /** - * @param icon - */ - @Override - public void registerBlockIcons(IIconRegister icon) - { - blockIcon = icon.registerIcon("minecraft:stonebrick"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/7059c98a6edd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/7059c98a6edd001412dce27813e7be4a deleted file mode 100644 index 7f00d29..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/7059c98a6edd001412dce27813e7be4a +++ /dev/null @@ -1,108 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.entities; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; - -/** - * @author Sorin - */ -public class EntityHeart extends EntityLiving -{ - public EntityHeart(World world) - { - super(world); - this.setSize(0.4F, 0.4F); - } - - public boolean isEntityInvulnerable() - { - return true; - } - - protected boolean canDespawn() - { - return false; - } - - @Override - public void onCollideWithPlayer(EntityPlayer player) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (getType() == "Red" && player.getHealth() < player.getMaxHealth()){ - player.heal(2f); - this.setDead(); - } - else if (getType() != "Red" && playerInfo.getFloat(getType() + "Heart") < 20f){ - playerInfo.setFloat(getType() + "Heart", playerInfo.getFloat(getType() + "Heart") + 2.0F <= 20f ? playerInfo.getFloat(getType() + "Heart") + 2.0F : 20f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo(player)); - this.setDead(); - } - } - - @Override - protected void updateEntityActionState() - { - } - - @SideOnly(Side.CLIENT) - public boolean canRenderOnFire() - { - return false; - } - - protected void entityInit() - { - super.entityInit(); - this.dataWatcher.addObject(16, "Red"); - } - - public void writeEntityToNBT(NBTTagCompound nbt) - { - super.writeEntityToNBT(nbt); - nbt.setString("Type", getType()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - public void readEntityFromNBT(NBTTagCompound nbt) - { - super.readEntityFromNBT(nbt); - setType(nbt.getString("Type")); - } - - public String getType() - { - return this.dataWatcher.getWatchableObjectString(16); - } - - public void setType(String type) - { - this.dataWatcher.updateObject(16, type); - } - - public EnumCreatureAttribute getCreatureAttribute() - { - return EnumCreatureAttribute.UNDEAD; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/90e61b1372e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/90e61b1372e300141084bb8bfb075c08 new file mode 100644 index 0000000..5d01be0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/90e61b1372e300141084bb8bfb075c08 @@ -0,0 +1,37 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && !(target instanceof EntityMob) && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart)){ + target.setDead(); + world.setBlock((int)target.posX, (int)target.posY, (int)target.posZ, BlockList.midasTouchBlock, 0, 2); + TileEntity midasTouchVictim = new TileEntityMidasTouch(target); + world.setTileEntity((int)target.posX, (int)target.posY, (int)target.posZ, midasTouchVictim); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/609d74fbfde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/609d74fbfde40014174fe663e69b8422 new file mode 100644 index 0000000..7f0dc41 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/609d74fbfde40014174fe663e69b8422 @@ -0,0 +1,46 @@ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldObject extends Item +{ + public ItemGoldObject() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/102009133ce100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/102009133ce100141e1cc3c3be242e56 new file mode 100644 index 0000000..f3d10a0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/102009133ce100141e1cc3c3be242e56 @@ -0,0 +1,26 @@ +package darkknight.jewelrycraft.config; + +import cpw.mods.fml.client.config.GuiConfig; +import cpw.mods.fml.client.config.IConfigElement; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.common.config.ConfigElement; +import java.util.ArrayList; +import java.util.List; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigGui extends GuiConfig +{ + public ConfigGui(GuiScreen parent) + { + super(parent, getElements(), Variables.MODID, Variables.MODID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.INSTANCE.config.toString())); + } + + @SuppressWarnings ({"rawtypes"}) + private static List getElements() + { + List list = new ArrayList(ConfigHandler.categories.length); + for(String category: ConfigHandler.categories) + list.add(new ConfigElement(ConfigHandler.INSTANCE.config.getCategory(category.toLowerCase()))); + return list; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/300cc20804e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/300cc20804e60014127dc373d78c1666 new file mode 100644 index 0000000..a2a6da7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/300cc20804e60014127dc373d78c1666 @@ -0,0 +1,94 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockCompressed; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("nugget ")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("ingot ")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockCompressed) return new ItemStack(Blocks.gold_block, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/a0aafa332de60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/a0aafa332de60014127dc373d78c1666 new file mode 100644 index 0000000..c1c2f41 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/a0aafa332de60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 1 : 0) - ((tabList.get(1).enabled)?1:0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/803e9d8d04e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/803e9d8d04e50014174fe663e69b8422 new file mode 100644 index 0000000..1aefce2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/803e9d8d04e50014174fe663e69b8422 @@ -0,0 +1,61 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + System.out.println(Block.getBlockFromItem(item.getItem()) + " " + item.getIconIndex()); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else{ +// System.out.println(Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1)); + return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1); + } + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/902ed2a826e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/902ed2a826e60014127dc373d78c1666 new file mode 100644 index 0000000..7ff068a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/902ed2a826e60014127dc373d78c1666 @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/00520c9504e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/00520c9504e50014174fe663e69b8422 new file mode 100644 index 0000000..fa89a3b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/00520c9504e50014174fe663e69b8422 @@ -0,0 +1,61 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); +// System.out.println(Block.getBlockFromItem(item.getItem()) + " " + item.getIconIndex()); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else{ +// System.out.println(Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1)); + return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1); + } + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/40a4e6b92be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/40a4e6b92be60014127dc373d78c1666 new file mode 100644 index 0000000..b0028ed --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/40a4e6b92be60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || !tabList.get(1).visible){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).visible) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/a01776bcfde50014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/a01776bcfde50014127dc373d78c1666 new file mode 100644 index 0000000..e69de29 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/30de043304de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/30de043304de00141043c3025ec60dfc deleted file mode 100644 index 5195e86..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/30de043304de00141043c3025ec60dfc +++ /dev/null @@ -1,278 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (active && target != null && this.getDistanceFrom(target.posX, target.posY, target.posZ) > 8D){ - active = false; - timer = -1; - } - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - else if(pedestal != null && target != null) JewelrycraftUtil.addCursePoints(target, 20); - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/40247e5d2dde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/40247e5d2dde00141043c3025ec60dfc deleted file mode 100644 index 2850188..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/40247e5d2dde00141043c3025ec60dfc +++ /dev/null @@ -1,106 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() - 50 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5, resolution.getScaledHeight() - 50 + 16 * count, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + tagCache.getFloat("BlackHeart"), 15, resolution.getScaledHeight() - 40 + 16 * count, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() - 50 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/809e116607e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/809e116607e50014174fe663e69b8422 new file mode 100644 index 0000000..27f0233 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/809e116607e50014174fe663e69b8422 @@ -0,0 +1,63 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIcon(JewelryNBT.item(stack), pass); + else return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1); + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/9027920627de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/9027920627de00141043c3025ec60dfc deleted file mode 100644 index cb4c99f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/9027920627de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 15 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/a04b7a8e91e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/a04b7a8e91e3001417b2e384bf7c3702 new file mode 100644 index 0000000..189332b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/a04b7a8e91e3001417b2e384bf7c3702 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(0F, 1.0F, 1.0F); + RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, 0D, 0D, 0D, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/b0c118102dde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/b0c118102dde00141043c3025ec60dfc deleted file mode 100644 index ed28c34..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/b0c118102dde00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/6015a33bd1df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/6015a33bd1df00141dc6c962aec96210 deleted file mode 100644 index dc682d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/6015a33bd1df00141dc6c962aec96210 +++ /dev/null @@ -1,122 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.commands; - -/** - * @author Sorin - * - */ -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; - -public class JewelrycraftCommands extends CommandBase -{ - private List aliases; - - public JewelrycraftCommands() - { - this.aliases = new ArrayList(); - this.aliases.add("jw"); - this.aliases.add("jewelry"); - } - - @Override - public String getCommandName() - { - return "jewelrycraft"; - } - - @Override - public String getCommandUsage(ICommandSender var1) - { - String use = "/jewelrycraft [points]"; - // use += "/jewelrycraft |"; - // use += "/jewelrycraft "; - return use; - } - - @Override - public List getCommandAliases() - { - return aliases; - } - - @Override - public void processCommand(ICommandSender commandSender, String[] astring) - { - if (astring.length == 0 || astring[0].equals("help")) throw new WrongUsageException(getCommandUsage(commandSender)); - if (astring[0].equals("getCursePoints")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - commandSender.addChatMessage(new ChatComponentTranslation(Integer.toString(JewelrycraftUtil.getCursePoints(entityplayermp)))); - }else if (astring[0].equals("addCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points); - }else if (astring[0].equals("setCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points - JewelrycraftUtil.getCursePoints(entityplayermp)); - } - // else if (astring[0].equals("addModifier")){ - // ItemStack item = new ItemStack(CommandBase.getItemByText(commandSender, astring[1])); - // EntityPlayerMP entityplayermp = getPlayer(commandSender, commandSender.getCommandSenderName()); - // ArrayList modifier = new ArrayList(); - // modifier.add(item); - // JewelryNBT.addModifiers(entityplayermp.getCurrentEquippedItem(), modifier); - // } - // else if (astring[0].equals("addCurse")){ - // EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - // int curse = Integer.valueOf(astring[2]); - // int grade = Integer.valueOf(astring[3]); - // NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(entityplayermp, "Jewelrycraft"); - // if(curse < Curse.getCurseList().size() && grade <= 2) - // { - // EntityEventHandler.addCurse(entityplayermp, playerInfo, curse, grade); - // JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - // } - // else if(curse >= Curse.getCurseList().size()) entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse ID exceedes the maximum value of " + (Curse.getCurseList().size() - 1))); - // else entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse grade exceedes the maximum value of 2")); - // - // } - } - - @Override - public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring) - { - final List MATCHES = new LinkedList(); - final String ARG_LC = astring[astring.length - 1].toLowerCase(); - if (astring.length == 1){ - if ("addCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCursePoints"); - if ("getCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("getCursePoints"); - if ("setCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("setCursePoints"); - // if ("addModifier".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addModifier"); - // if ("addCurse".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCurse"); - }else if (astring.length == 2){ - for(String un: MinecraftServer.getServer().getAllUsernames()) - if (un.toLowerCase().startsWith(ARG_LC)) MATCHES.add(un); - // else if (!astring[0].equals("addCurse")) return getListOfStringsFromIterableMatchingLastWord(astring, Item.itemRegistry.getKeys()); - } - return MATCHES.isEmpty() ? null : MATCHES; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/707801098ee3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/707801098ee3001417b2e384bf7c3702 new file mode 100644 index 0000000..e357f13 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/707801098ee3001417b2e384bf7c3702 @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor4f(1F, 0.0F, 1.0F, 0.3F); + RenderManager.instance.renderEntityStatic(midas.target, 1F, false); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/80b60a3e27e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/80b60a3e27e60014127dc373d78c1666 new file mode 100644 index 0000000..981fbfd --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/80b60a3e27e60014127dc373d78c1666 @@ -0,0 +1,70 @@ +package darkknight.jewelrycraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.TabRegistry; +import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab; +import darkknight.jewelrycraft.events.KeyBindings; + +public class GuiJewelry extends GuiContainer +{ + ResourceLocation texture; + + /** + * @param containerJewelryTab + * @param texture + */ + public GuiJewelry(ContainerJewelryTab containerJewelryTab, ResourceLocation texture) + { + super(containerJewelryTab); + xSize = 194; + ySize = 166; + this.texture = texture; + } + + /** + * @param f + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) + { + GL11.glColor3f(1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + } + + /** + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + {} + + /** + * @param charecter + * @param key + */ + @Override + protected void keyTyped(char charecter, int key) + { + super.keyTyped(charecter, key); + if (key == KeyBindings.inventory.getKeyCode()) mc.thePlayer.closeScreen(); + } + + @Override + public void initGui () + { + super.initGui(); + int cornerX = guiLeft; + int cornerY = guiTop; + this.buttonList.clear(); + TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class); + TabRegistry.addTabsToList(this.buttonList); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/c011836acadf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/c011836acadf00141dc6c962aec96210 deleted file mode 100644 index a3c375d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/c011836acadf00141dc6c962aec96210 +++ /dev/null @@ -1,94 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if (rand.nextInt(3) == 0 && (arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0)) arrow.setDead(); - } - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists){ - if (player.motionY < 0) player.motionY *= 0.6D; -// player.capabilities.setPlayerWalkSpeed(0.1F); -// player.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.001D); - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80, 1)); - player.fallDistance = 0F; - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/c026412f36e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/c026412f36e100141e1cc3c3be242e56 new file mode 100644 index 0000000..2453924 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/c026412f36e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int ingotMeltingTime; + public static int jewelryCraftingTime; + public static boolean generateVillageNetherstar; + public static boolean canFurnacesGenerateIngots; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + ingotMeltingTime = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + jewelryCraftingTime = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + generateVillageNetherstar = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + canFurnacesGenerateIngots = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + maxVillageJewelers = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + jewelerWeight = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + ingotChestMin = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMax = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/d0f34296e1e50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/d0f34296e1e50014109ec019d2f6c0dc new file mode 100644 index 0000000..df1a1cf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/d0f34296e1e50014109ec019d2f6c0dc @@ -0,0 +1,60 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) + if(JewelryNBT.item(stack).getItem() instanceof ItemFood) list.add(EnumChatFormatting.DARK_PURPLE + "It's made of metal. How are you suppose to eat this?"); + else list.add(EnumChatFormatting.DARK_PURPLE + "Shiny, but useless :("); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/0026ada605e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/0026ada605e50014174fe663e69b8422 new file mode 100644 index 0000000..4bb6fb3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/0026ada605e50014174fe663e69b8422 @@ -0,0 +1,60 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIcon(JewelryNBT.item(stack), pass); + else{ +// System.out.println(Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1)); + return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1); + } + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/703a47a523e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/703a47a523e60014127dc373d78c1666 new file mode 100644 index 0000000..7b5b065 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/703a47a523e60014127dc373d78c1666 @@ -0,0 +1,76 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); +// GL11.glRotatef(90F, 0F, 1F, 0F); +// this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); +// GL11.glRotatef(-90F, 1F, 0F, 0F); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/809d0e09cddf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/809d0e09cddf00141dc6c962aec96210 deleted file mode 100644 index 04bc351..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/809d0e09cddf00141dc6c962aec96210 +++ /dev/null @@ -1,85 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ); - } - } - //Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 140, 1)); - //Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(500) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - if (jewelry instanceof ItemRing && exists && rand.nextInt(200) == 12){ - Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.0F); - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - //Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/b0ae616ecedf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/b0ae616ecedf00141dc6c962aec96210 deleted file mode 100644 index 4c12da5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/b0ae616ecedf00141dc6c962aec96210 +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - if(rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2 + JewelryNBT.numberOfModifiers(item)/4)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX)*(rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0? 1:-1); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ)*(rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0? 1:-1); - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 150 - JewelryNBT.numberOfModifiers(item)*10, 2 - JewelryNBT.numberOfModifiers(item)/5)); - // Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(520 - JewelryNBT.numberOfModifiers(item)*20) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - if (jewelry instanceof ItemRing && exists && rand.nextInt(200) == 12){ - // Negative ring - Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 2.2F - JewelryNBT.numberOfModifiers(item)*0.1F); - // Positive ring - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/106f70bf01e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/106f70bf01e60014127dc373d78c1666 new file mode 100644 index 0000000..748bacc --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/106f70bf01e60014127dc373d78c1666 @@ -0,0 +1,41 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.block.BlockMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +/** + * @author Sorin + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + // System.out.println("Broken " + event.getResult()); + ItemStack item = event.getPlayer().inventory.getCurrentItem(); + if (event.block instanceof BlockMidasTouch && item != null && item.getItem().canHarvestBlock(event.block, item)){ + System.out.println(event.block.getHarvestLevel(event.blockMetadata) + " " + item.getItem().getHarvestLevel(item, "pickaxe")); + TileEntityMidasTouch te = (TileEntityMidasTouch)event.world.getTileEntity(event.x, event.y, event.z); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + } + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/50f61c022bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/50f61c022bde00141043c3025ec60dfc deleted file mode 100644 index a31abd4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/50f61c022bde00141043c3025ec60dfc +++ /dev/null @@ -1,466 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - System.out.println("add curse " + cur + " " + grade + " " + Curse.availableCurses); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss()){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/c06ef67e91e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/c06ef67e91e3001417b2e384bf7c3702 new file mode 100644 index 0000000..17f8dd6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/c06ef67e91e3001417b2e384bf7c3702 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1F, 0.0F, 1.0F); + RenderManager.instance.renderEntityStatic(midas.target, 1F, false); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/c00d944e2de60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/c00d944e2de60014127dc373d78c1666 new file mode 100644 index 0000000..673a720 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/c00d944e2de60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 1 : 0) - ((!tabList.get(1).enabled)?2:0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/e03f878f72e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/e03f878f72e300141084bb8bfb075c08 new file mode 100644 index 0000000..fe769ce --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/e03f878f72e300141084bb8bfb075c08 @@ -0,0 +1,54 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/10f36a6990e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/10f36a6990e3001417b2e384bf7c3702 new file mode 100644 index 0000000..0824233 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/10f36a6990e3001417b2e384bf7c3702 @@ -0,0 +1,36 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart)){ + world.setBlock((int)target.posX, (int)target.posY, (int)target.posZ, BlockList.midasTouchBlock, 0, 2); + ((EntityLiving)target).hurtTime = 0; + TileEntity midasTouchVictim = new TileEntityMidasTouch(target); + world.setTileEntity((int)target.posX, (int)target.posY, (int)target.posZ, midasTouchVictim); + target.setDead(); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/50d498da36e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/50d498da36e100141e1cc3c3be242e56 new file mode 100644 index 0000000..849ea4d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/50d498da36e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int MAX_VILLAGE_JEWELERS; + public static int JEWELER_WEIGHT; + public static int INGOT_CHEST_MIN; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + JEWELER_WEIGHT = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + INGOT_CHEST_MIN = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMax = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/c07570fc8de3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/c07570fc8de3001417b2e384bf7c3702 new file mode 100644 index 0000000..4ea7332 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/c07570fc8de3001417b2e384bf7c3702 @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glColor4f(0F, 0.0F, 0.0F, 1F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + RenderManager.instance.renderEntityStatic(midas.target, 1F, false); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/20e2ed160cde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/20e2ed160cde00141043c3025ec60dfc deleted file mode 100644 index f02cc4b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/20e2ed160cde00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; -// System.out.println(red + " " + green + " " + blue); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glColorMask(false, true, true, true); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/b00f12e436e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/b00f12e436e100141e1cc3c3be242e56 new file mode 100644 index 0000000..6198ae2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/b00f12e436e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int MAX_VILLAGE_JEWELERS; + public static int JEWELER_WEIGHT; + public static int INGOT_CHEST_MIN; + public static int INGOT_CHEST_MAX; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + JEWELER_WEIGHT = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + INGOT_CHEST_MIN = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/1096a2fac8df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/1096a2fac8df00141dc6c962aec96210 deleted file mode 100644 index ca17bbe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/1096a2fac8df00141dc6c962aec96210 +++ /dev/null @@ -1,93 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectBlazePowder extends ModifierEffects -{ - public EffectBlazePowder() - { - super(new ItemStack(Items.blaze_powder)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemNecklace && pos != -1){ - // Positive for necklace - if (player.isBurning() && rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) player.extinguish(); - // Negative for necklace - if (player.isInWater()) player.attackEntityFrom(DamageSource.drown, 1f + (JewelryNBT.numberOfModifiers(item) - 1) * 0.1F); - } - // Negative for bracelet - if (jewelry instanceof ItemBracelet && pos != -1 && player.isInWater()){ - double slowAmount = 0.6D + (JewelryNBT.numberOfModifiers(item) - 1)*0.05D; - player.motionX *= slowAmount; - player.motionY *= slowAmount; - player.motionZ *= slowAmount; - player.motionY -= 0.02D; - if (player.isCollidedHorizontally) player.motionY = 0.30000001192092896D; - } - // Negative for earrings - if (jewelry instanceof ItemEarrings && pos != -1){ - if (player.getAir() >= 300) player.setAir(player.getAir() / 2); - else player.setAir(player.getAir() - 1); - } - } - - @Override - public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - // Balanced for ring - if (jewelry instanceof ItemRing && pos != -1 && !player.isInWater()) target.setFire(2); - return false; - } - - @Override - public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - // int pos = JewelryNBT.doesModifierExist(item, modifier); - // if (jewelry instanceof ItemEarrings && pos != -1 && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){ - // //Positive for earrings - // int stackSize = JewelryNBT.modifier(item).get(pos).stackSize; - // player.heal((float)(0.05 * stackSize)); - // return true; - // } - // //Positive for bracelet - // if (jewelry instanceof ItemBracelet && pos != -1) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) return true; - return false; - } - - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - {} - - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (jewelry instanceof ItemEarrings && pos != -1 && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){ - // Positive for earrings - int stackSize = JewelryNBT.modifier(item).get(pos).stackSize; - player.heal((float)(0.05 * stackSize)); - playerInfo.setBoolean("negateDamage", true); - } - // Positive for bracelet - if (jewelry instanceof ItemBracelet && pos != -1) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) playerInfo.setBoolean("negateDamage", true); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/604048aa00e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/604048aa00e50014174fe663e69b8422 new file mode 100644 index 0000000..c55e71b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/604048aa00e50014174fe663e69b8422 @@ -0,0 +1,53 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.item(stack) != null && pass >= 0) return JewelryNBT.item(stack).getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/608a239c29e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/608a239c29e60014127dc373d78c1666 new file mode 100644 index 0000000..c8d598c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/608a239c29e60014127dc373d78c1666 @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class InventoryTabVanilla extends AbstractTab +{ + public InventoryTabVanilla() + { + super(0, 0, 0, new ItemStack(Blocks.crafting_table)); + } + + @Override + public void onTabClicked () + { + TabRegistry.openInventoryGui(); + } + + @Override + public boolean shouldAddToList () + { + return true; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/70358e7c0fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/70358e7c0fe60014127dc373d78c1666 new file mode 100644 index 0000000..b596034 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/70358e7c0fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.6F); + GL11.glRotatef(75f, 0f, 1f, 0f); + GL11.glRotatef(-15f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/201793702dde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/201793702dde00141043c3025ec60dfc deleted file mode 100644 index d1f9286..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/201793702dde00141043c3025ec60dfc +++ /dev/null @@ -1,106 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() - 50 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5, resolution.getScaledHeight() - 50 + 16 * count, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + tagCache.getFloat("BlackHeart"), 15, resolution.getScaledHeight() - 45 + 16 * count, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() - 50 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/204db0c810e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/204db0c810e60014127dc373d78c1666 new file mode 100644 index 0000000..e2a43e9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/204db0c810e60014127dc373d78c1666 @@ -0,0 +1,585 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.45F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/30675ea024e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/30675ea024e60014127dc373d78c1666 new file mode 100644 index 0000000..20da581 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/30675ea024e60014127dc373d78c1666 @@ -0,0 +1,96 @@ +package darkknight.jewelrycraft.proxy; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.InventoryTabVanilla; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.TabRegistry; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.entities.renders.HeartRender; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.render.ItemRender; +import darkknight.jewelrycraft.model.ModelDisplayer; +import darkknight.jewelrycraft.model.ModelHalfHeart; +import darkknight.jewelrycraft.model.ModelHandPedestal; +import darkknight.jewelrycraft.model.ModelHeart; +import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; +import darkknight.jewelrycraft.model.ModelMolder; +import darkknight.jewelrycraft.model.ModelShadowEye; +import darkknight.jewelrycraft.model.ModelShadowHand; +import darkknight.jewelrycraft.model.ModelSmelter; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMidasTouchRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/ShadowHand.png"); + TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMidasTouch.class, new TileEntityMidasTouchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); + + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); + MinecraftForgeClient.registerItemRenderer(ItemList.goldObj, new ItemRender()); + + VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation(Variables.MODID, "textures/entities/jeweler.png")); + + RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); + + TabRegistry.registerTab(new InventoryTabVanilla()); + TabRegistry.registerTab(new TabJewelry()); + MinecraftForge.EVENT_BUS.register(new TabRegistry()); + MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); + ResourceLocation jeweleryTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/e04866d3fde50014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/e04866d3fde50014127dc373d78c1666 new file mode 100644 index 0000000..a82a6bb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/e04866d3fde50014127dc373d78c1666 @@ -0,0 +1,12 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +/** + * @author Sorin + * + */ +public class BlockEventHandler +{ +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/f02810b507de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/f02810b507de00141043c3025ec60dfc deleted file mode 100644 index 28ccdca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/f02810b507de00141043c3025ec60dfc +++ /dev/null @@ -1,183 +0,0 @@ -package darkknight.jewelrycraft.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = ingotColor >> 16 & 0xff; - int green = ingotColor >> 8 & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/206828078de3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/206828078de3001417b2e384bf7c3702 new file mode 100644 index 0000000..9687636 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/206828078de3001417b2e384bf7c3702 @@ -0,0 +1,37 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart)){ + world.setBlock((int)target.posX, (int)target.posY, (int)target.posZ, BlockList.midasTouchBlock, 0, 2); + TileEntity midasTouchVictim = new TileEntityMidasTouch(target); + world.setTileEntity((int)target.posX, (int)target.posY, (int)target.posZ, midasTouchVictim); + target.setDead(); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/30ca78699ae3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/30ca78699ae3001412c4c4819c88e86b new file mode 100644 index 0000000..3ac4004 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/30ca78699ae3001412c4c4819c88e86b @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + + TileEntity tile = world.getTileEntity(x, y, z); + if (tile != null && ((TileEntityMidasTouch)tile).target != null) + ret.add(new ItemStack(Items.gold_nugget, (int)(((TileEntityMidasTouch)tile).target.width*((TileEntityMidasTouch)tile).target.height), 0)); + + return ret; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/50aa567f09e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/50aa567f09e50014174fe663e69b8422 new file mode 100644 index 0000000..180f11f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/50aa567f09e50014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + public static Item goldObj; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldObj = new ItemGoldObj().setUnlocalizedName(Variables.MODID + ".goldObject").setTextureName(Variables.MODID + ":goldObj"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldObj, "goldObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/609ee512cfdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/609ee512cfdf00141dc6c962aec96210 deleted file mode 100644 index 2002d5d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/609ee512cfdf00141dc6c962aec96210 +++ /dev/null @@ -1,109 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ -// for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); -// if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/50d8454d2ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/50d8454d2ce60014127dc373d78c1666 new file mode 100644 index 0000000..c1de9eb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/50d8454d2ce60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || !tabList.get(0).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(0).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/808ebec629de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/808ebec629de00141043c3025ec60dfc deleted file mode 100644 index 1c2caa0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/808ebec629de00141043c3025ec60dfc +++ /dev/null @@ -1,466 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - System.out.println("add curse " + cur + " " + grade); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss()){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/f001bde393e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/f001bde393e3001412c4c4819c88e86b new file mode 100644 index 0000000..fe769ce --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/f001bde393e3001412c4c4819c88e86b @@ -0,0 +1,54 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/10925bf3cadf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/10925bf3cadf00141dc6c962aec96210 deleted file mode 100644 index 34c72eb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/10925bf3cadf00141dc6c962aec96210 +++ /dev/null @@ -1,96 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if (rand.nextInt(3) == 0 && (arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0)) arrow.setDead(); - } - } - } - - if (jewelry instanceof ItemBracelet && exists){ - // Positive bracelet - if (player.motionY < 0) player.motionY *= 0.6D; - // Negative bracelet - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80, 1)); - player.fallDistance = 0F; - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - // Positive ring - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/203b62722be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/203b62722be60014127dc373d78c1666 new file mode 100644 index 0000000..a3c5378 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/203b62722be60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || !tabList.get(1).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/5069282604e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/5069282604e50014174fe663e69b8422 new file mode 100644 index 0000000..d3ac3b6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/5069282604e50014174fe663e69b8422 @@ -0,0 +1,58 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + System.out.println(item.getItem().getIconIndex(JewelryNBT.item(stack))); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1); + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/60c4bcde2ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/60c4bcde2ce60014127dc373d78c1666 new file mode 100644 index 0000000..1ac137c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/60c4bcde2ce60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2 - (t instanceof TabJewelry?2:-2)) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/201a8e4e08e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/201a8e4e08e60014127dc373d78c1666 new file mode 100644 index 0000000..df1a1cf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/201a8e4e08e60014127dc373d78c1666 @@ -0,0 +1,60 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) + if(JewelryNBT.item(stack).getItem() instanceof ItemFood) list.add(EnumChatFormatting.DARK_PURPLE + "It's made of metal. How are you suppose to eat this?"); + else list.add(EnumChatFormatting.DARK_PURPLE + "Shiny, but useless :("); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/4064f9042ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/4064f9042ce60014127dc373d78c1666 new file mode 100644 index 0000000..4c71775 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/4064f9042ce60014127dc373d78c1666 @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + System.out.println(t); + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla)){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla)) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/70f6390a33e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/70f6390a33e100141e1cc3c3be242e56 new file mode 100644 index 0000000..957cd67 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/70f6390a33e100141e1cc3c3be242e56 @@ -0,0 +1,11 @@ +package darkknight.jewelrycraft.util; + +public class Variables +{ + public static final String MODID = "jewelrycraft2"; + public static final String MODNAME = "Jewelrycraft 2"; + public static final String VERSION = "1.0"; + public static final String PACKET_CHANNEL = "jewelrycraft2"; + public static final int MAX_CURSES = 10; + public static final String CONFIG_GUI = "darkknight.jewelrycraft.config.ConfigGuiFactory"; +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/a08ceb03fee50014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/a08ceb03fee50014127dc373d78c1666 new file mode 100644 index 0000000..2e9df49 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/a08ceb03fee50014127dc373d78c1666 @@ -0,0 +1,19 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +/** + * @author Sorin + * + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/4027a5e129de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/4027a5e129de00141043c3025ec60dfc deleted file mode 100644 index 2353237..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/4027a5e129de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/600d023b95e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/600d023b95e3001412c4c4819c88e86b new file mode 100644 index 0000000..898a587 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/600d023b95e3001412c4c4819c88e86b @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntity tile = world.getTileEntity(x, y, z); + if(((TileEntityMidasTouch)tile).target != null){ + System.out.println(this.getBlockBoundsMinY()); +// this.setBlockBounds((float)((TileEntityMidasTouch)tile).target.boundingBox.minX, (float)((TileEntityMidasTouch)tile).target.boundingBox.minY, (float)((TileEntityMidasTouch)tile).target.boundingBox.minZ, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxX, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxY, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxZ); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/8062bf2107e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/8062bf2107e50014174fe663e69b8422 new file mode 100644 index 0000000..71b20ff --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/8062bf2107e50014174fe663e69b8422 @@ -0,0 +1,96 @@ +package darkknight.jewelrycraft.proxy; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.InventoryTabVanilla; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.TabRegistry; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.entities.renders.HeartRender; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.render.ItemRender; +import darkknight.jewelrycraft.model.ModelDisplayer; +import darkknight.jewelrycraft.model.ModelHalfHeart; +import darkknight.jewelrycraft.model.ModelHandPedestal; +import darkknight.jewelrycraft.model.ModelHeart; +import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; +import darkknight.jewelrycraft.model.ModelMolder; +import darkknight.jewelrycraft.model.ModelShadowEye; +import darkknight.jewelrycraft.model.ModelShadowHand; +import darkknight.jewelrycraft.model.ModelSmelter; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMidasTouchRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/ShadowHand.png"); + TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMidasTouch.class, new TileEntityMidasTouchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); + + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ItemList.goldObj), new ItemRender()); + + VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation(Variables.MODID, "textures/entities/jeweler.png")); + + RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); + + TabRegistry.registerTab(new InventoryTabVanilla()); + TabRegistry.registerTab(new TabJewelry()); + MinecraftForge.EVENT_BUS.register(new TabRegistry()); + MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); + ResourceLocation jeweleryTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/b01358c6fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/b01358c6fce40014174fe663e69b8422 new file mode 100644 index 0000000..62c96d7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/b01358c6fce40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemGoldifiedObject goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = (ItemGoldifiedObject)new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/f0613fc4cfdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/f0613fc4cfdf00141dc6c962aec96210 deleted file mode 100644 index 8c0596b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/f0613fc4cfdf00141dc6c962aec96210 +++ /dev/null @@ -1,102 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); -// if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(90, 5 + (size + 10) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); -// } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/10b4162c31e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/10b4162c31e100141e1cc3c3be242e56 new file mode 100644 index 0000000..e69de29 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/30cbc9efdde50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/30cbc9efdde50014109ec019d2f6c0dc new file mode 100644 index 0000000..e86d906 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/30cbc9efdde50014109ec019d2f6c0dc @@ -0,0 +1,93 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget ") || currItem.getItem().getUnlocalizedName().toLowerCase().contains(" nugget")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot ") || currItem.getItem().getUnlocalizedName().toLowerCase().contains(" ingot")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/c01a0a822be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/c01a0a822be60014127dc373d78c1666 new file mode 100644 index 0000000..486f204 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/c01a0a822be60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!tabList.get(1).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/f0c649af08de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/f0c649af08de00141043c3025ec60dfc deleted file mode 100644 index cf02394..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/f0c649af08de00141043c3025ec60dfc +++ /dev/null @@ -1,184 +0,0 @@ -package darkknight.jewelrycraft.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = (int)f3; -// int red = ingotColor >> 16 & 0xff; -// int green = ingotColor >> 8 & 0xff; -// int blue = ingotColor & 0xff; - GL11.glColor3f((float)ingotColor % 256, ((float)ingotColor / 256) % 256, ((float)ingotColor / 256 / 256) % 256); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/1068e79a01e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/1068e79a01e60014127dc373d78c1666 new file mode 100644 index 0000000..2c24d79 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/1068e79a01e60014127dc373d78c1666 @@ -0,0 +1,41 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.block.BlockMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +/** + * @author Sorin + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + // System.out.println("Broken " + event.getResult()); + ItemStack item = event.getPlayer().inventory.getCurrentItem(); + if (event.block instanceof BlockMidasTouch && item != null && item.getItem().canHarvestBlock(event.block, item)){ + TileEntityMidasTouch te = (TileEntityMidasTouch)event.world.getTileEntity(event.x, event.y, event.z); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + } + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/5031a6ce32e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/5031a6ce32e100141e1cc3c3be242e56 new file mode 100644 index 0000000..47c874e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/5031a6ce32e100141e1cc3c3be242e56 @@ -0,0 +1,12 @@ +/** + * + */ +package darkknight.jewelrycraft.config; + +/** + * @author Sorin + * + */ +public class ConfigGuiFactory +{ +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/60be6d7a67dd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/60be6d7a67dd001412dce27813e7be4a deleted file mode 100644 index f90727e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/60be6d7a67dd001412dce27813e7be4a +++ /dev/null @@ -1,123 +0,0 @@ -package darkknight.jewelrycraft.events; - -import java.util.Iterator; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.entities.renders.RenderHelper; -import darkknight.jewelrycraft.item.render.BraceletRender; -import darkknight.jewelrycraft.item.render.EarringsRender; -import darkknight.jewelrycraft.item.render.MaskRender; -import darkknight.jewelrycraft.model.ModelBracelet; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class PlayerRenderHandler -{ - MaskRender mask = new MaskRender(); - EarringsRender earrings = new EarringsRender(); - BraceletRender bracelet = new BraceletRender(); - public static String[] infamyCache = new String[]{}; - - @SubscribeEvent - public void renderScreen(RenderPlayerEvent.Specials.Post event) - { - ModelBiped main = event.renderer.modelBipedMain; - Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); - if (infamyCache != null){ - while (players.hasNext()){ - EntityPlayer player = players.next(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - System.out.println(playerInfo); - if (checkPlayerInfamy(player.getDisplayName()) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){ - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(1.6f, 1.6f, 1.6f); - GL11.glTranslatef(-0.25F, -0.25F, -0.25F); - mask.doRender(event.entityPlayer, 0F, 0F, 0F, 0F, 0F); - GL11.glPopMatrix(); - } - if (playerInfo.hasKey("ext17")){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext17"); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(0.07f, 0.07f, 0.07f); - GL11.glTranslatef(0.0F, 3.0F, -2.0F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - earrings.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - GL11.glPopMatrix(); - } - for(int i = 10; i <= 13; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glTranslatef((i / 12 == 1) ? -0.275F : 0.475F, 0.2F + ((i / 12 == 1) ? (i - 12) * 0.08F : (i - 10) * 0.08F), 0F); - if (player.isSneaking()) GL11.glTranslatef(0F, 0F, -((i == 10 || i == 12) ? (0.1F) : 0.05F)); - if (i / 12 == 1){ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedRightArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0.0F); - }else{ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedLeftArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - } - GL11.glPopMatrix(); - } - } - } - } - - /** - * @param string - * @return - */ - private boolean checkPlayerInfamy(String string) - { - for(int i = 0; i < infamyCache.length; i++) - if (infamyCache[i].equals(string)) return true; - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/6000f6390ade00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/6000f6390ade00141043c3025ec60dfc deleted file mode 100644 index 5f2a423..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/6000f6390ade00141043c3025ec60dfc +++ /dev/null @@ -1,185 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/900cd0d2ccdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/900cd0d2ccdf00141dc6c962aec96210 deleted file mode 100644 index 8f2da1a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/900cd0d2ccdf00141dc6c962aec96210 +++ /dev/null @@ -1,79 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - enderman.setTarget(null); - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2)); - } - } - } - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ); - } - } - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 140, 1)); - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(500) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30)*(rand.nextBoolean()?-1:1), player.posY, player.posZ + rand.nextInt(30)*(rand.nextBoolean()?-1:1)); - if (jewelry instanceof ItemRing && exists && rand.nextInt(200) == 12){ - Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.0F); - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if(player.worldObj.getBlock(i, j, k) instanceof BlockOre) - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/10b462f7fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/10b462f7fce40014174fe663e69b8422 new file mode 100644 index 0000000..974f7e5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/10b462f7fce40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); +// goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/6096e9aedbe50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/6096e9aedbe50014109ec019d2f6c0dc new file mode 100644 index 0000000..77f1315 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/6096e9aedbe50014109ec019d2f6c0dc @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.*; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a06f5eb026de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a06f5eb026de00141043c3025ec60dfc deleted file mode 100644 index 2a9dca7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a06f5eb026de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.5f, 0.5f, 0.0f); - drawTexturedModalRect(20, 14 + (size + 20) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/209ecde827e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/209ecde827e60014127dc373d78c1666 new file mode 100644 index 0000000..6728181 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/209ecde827e60014127dc373d78c1666 @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/20d6830327de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/20d6830327de00141043c3025ec60dfc deleted file mode 100644 index 69becce..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/20d6830327de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/801c40ebcbdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/801c40ebcbdf00141dc6c962aec96210 deleted file mode 100644 index 5cbc1c4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/801c40ebcbdf00141dc6c962aec96210 +++ /dev/null @@ -1,97 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if ((arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0) && rand.nextInt(2 + JewelryNBT.numberOfModifiers(item)) == 0) arrow.setDead(); - } - } - } - - if (jewelry instanceof ItemBracelet && exists){ - // Positive bracelet - if (player.motionY < 0) player.motionY *= (0.6D + (JewelryNBT.numberOfModifiers(item) - 1)*0.03D); - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) player.fallDistance = 0F; - // Negative bracelet - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80, 1)); - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - // Negative ring - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - // Positive ring - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/a08b206401e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/a08b206401e50014174fe663e69b8422 new file mode 100644 index 0000000..3cf6eb4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/a08b206401e50014174fe663e69b8422 @@ -0,0 +1,55 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) + return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/d039874701e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/d039874701e50014174fe663e69b8422 new file mode 100644 index 0000000..49dbe25 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/d039874701e50014174fe663e69b8422 @@ -0,0 +1,54 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null && Item.getIdFromItem(item.getItem()) > 0) + return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/309bbd4008de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/309bbd4008de00141043c3025ec60dfc deleted file mode 100644 index f873789..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/309bbd4008de00141043c3025ec60dfc +++ /dev/null @@ -1,183 +0,0 @@ -package darkknight.jewelrycraft.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = ingotColor >> 16 & 0xff; - int green = ingotColor >> 8 & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/7054379b0fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/7054379b0fe60014127dc373d78c1666 new file mode 100644 index 0000000..71fb995 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/7054379b0fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.9F); + GL11.glRotatef(75f, 0f, 1f, 0f); + GL11.glRotatef(-15f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/70b5b24de0e50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/70b5b24de0e50014109ec019d2f6c0dc new file mode 100644 index 0000000..cdfa90f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/70b5b24de0e50014109ec019d2f6c0dc @@ -0,0 +1,57 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Shiny, but useless :("); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/9062eb5626e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/9062eb5626e60014127dc373d78c1666 new file mode 100644 index 0000000..77cc5f9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/9062eb5626e60014127dc373d78c1666 @@ -0,0 +1,97 @@ +package darkknight.jewelrycraft.proxy; + +import main.java.tconstruct.client.InventoryTabVanilla; +import main.java.tconstruct.client.TabRegistry; +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.VillagerRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.entities.renders.HeartRender; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.render.ItemRender; +import darkknight.jewelrycraft.model.ModelDisplayer; +import darkknight.jewelrycraft.model.ModelHalfHeart; +import darkknight.jewelrycraft.model.ModelHandPedestal; +import darkknight.jewelrycraft.model.ModelHeart; +import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; +import darkknight.jewelrycraft.model.ModelMolder; +import darkknight.jewelrycraft.model.ModelShadowEye; +import darkknight.jewelrycraft.model.ModelShadowHand; +import darkknight.jewelrycraft.model.ModelSmelter; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMidasTouchRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/ShadowHand.png"); + TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMidasTouch.class, new TileEntityMidasTouchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); + + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); + MinecraftForgeClient.registerItemRenderer(ItemList.goldObj, new ItemRender()); + + VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation(Variables.MODID, "textures/entities/jeweler.png")); + + RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); + + if (!Loader.isModLoaded("TConstruct") && TabRegistry.getTabList().size() < 1) TabRegistry.registerTab(new InventoryTabVanilla()); + TabRegistry.registerTab(new TabJewelry()); + MinecraftForge.EVENT_BUS.register(new TabRegistry()); + MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); + ResourceLocation jeweleryTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/f026c032fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/f026c032fde40014174fe663e69b8422 new file mode 100644 index 0000000..07bb2b6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/f026c032fde40014174fe663e69b8422 @@ -0,0 +1,46 @@ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldObject extends Item +{ + public ItemGoldifiedObject() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/003a974204de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/003a974204de00141043c3025ec60dfc deleted file mode 100644 index 889f109..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/003a974204de00141043c3025ec60dfc +++ /dev/null @@ -1,278 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (active && target != null && this.getDistanceFrom(target.posX, target.posY, target.posZ) > 20D){ - active = false; - timer = -1; - } - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - else if(pedestal != null && target != null) JewelrycraftUtil.addCursePoints(target, 20); - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/a03afdd19ae3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/a03afdd19ae3001412c4c4819c88e86b new file mode 100644 index 0000000..3ac4004 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/a03afdd19ae3001412c4c4819c88e86b @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + + TileEntity tile = world.getTileEntity(x, y, z); + if (tile != null && ((TileEntityMidasTouch)tile).target != null) + ret.add(new ItemStack(Items.gold_nugget, (int)(((TileEntityMidasTouch)tile).target.width*((TileEntityMidasTouch)tile).target.height), 0)); + + return ret; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/a0d154642be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/a0d154642be60014127dc373d78c1666 new file mode 100644 index 0000000..9b1999b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/a0d154642be60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || !tabList.get(0).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tab.enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/c035952b36e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/c035952b36e100141e1cc3c3be242e56 new file mode 100644 index 0000000..83f2cb2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/c035952b36e100141e1cc3c3be242e56 @@ -0,0 +1,186 @@ +package darkknight.jewelrycraft.tileentity; + +import java.util.Random; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class TileEntitySmelter extends TileEntity +{ + public int melting, flow, n = 0, p = 0; + public boolean hasMetal, hasMoltenMetal, isDirty, pouring; + public ItemStack metal, moltenMetal; + public float quantity, pouredQuantity = 0.1f; + + /** + * + */ + public TileEntitySmelter() + { + melting = 0; + pouring = false; + flow = 0; + quantity = 0f; + hasMetal = false; + hasMoltenMetal = false; + metal = new ItemStack(Item.getItemById(0), 0, 0); + moltenMetal = new ItemStack(Item.getItemById(0), 0, 0); + isDirty = false; + } + + /** + * @param nbt + */ + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + nbt.setInteger("melting", melting); + nbt.setFloat("quantity", quantity); + nbt.setBoolean("hasMetal", hasMetal); + nbt.setBoolean("hasMoltenMetal", hasMoltenMetal); + nbt.setBoolean("pouring", pouring); + NBTTagCompound tag = new NBTTagCompound(); + NBTTagCompound tag1 = new NBTTagCompound(); + metal.writeToNBT(tag); + nbt.setTag("metal", tag); + moltenMetal.writeToNBT(tag1); + nbt.setTag("moltenMetal", tag1); + } + + /** + * @param nbt + */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + melting = nbt.getInteger("melting"); + quantity = nbt.getFloat("quantity"); + hasMetal = nbt.getBoolean("hasMetal"); + hasMoltenMetal = nbt.getBoolean("hasMoltenMetal"); + pouring = nbt.getBoolean("pouring"); + metal = new ItemStack(Item.getItemById(0), 0, 0); + metal.readFromNBT(nbt.getCompoundTag("metal")); + moltenMetal = new ItemStack(Item.getItemById(0), 0, 0); + moltenMetal.readFromNBT(nbt.getCompoundTag("moltenMetal")); + } + + /** + * + */ + @Override + public void updateEntity() + { + super.updateEntity(); + Random rand = new Random(); + if (isDirty){ + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + isDirty = false; + } + if (p > 0) --p; + else p = 5; + if (n == 0 && p == 0){ + flow += 16; + if (flow >= 16 * 20) n = 1; + } + if (n == 1 && p == 0){ + flow -= 16; + if (flow <= 0) n = 0; + } + if (hasMetal) for(int l = 0; l < 2; ++l) + worldObj.spawnParticle("flame", xCoord + rand.nextFloat(), (double)yCoord + 0.3F, zCoord + rand.nextFloat(), 0.0D, 0.0D, 0.0D); + if (rand.nextInt(65) == 0){ + double d5 = xCoord + rand.nextFloat(); + double d7 = yCoord; + double d6 = zCoord + rand.nextFloat(); + worldObj.playSound(d5, d7, d6, "liquid.lavapop", 0.2F + rand.nextFloat() * 0.2F, 0.9F + rand.nextFloat() * 0.15F, false); + } + if (hasMetal && !hasMoltenMetal){ + boolean isOre = JewelrycraftUtil.isOre(metal); + if (melting > 0) melting--; + if (melting == 0){ + hasMetal = false; + if (!isOre) moltenMetal = metal; + else{ + moltenMetal = JewelrycraftUtil.getIngotFromOre(metal.getItem()); + moltenMetal.stackSize *= 2; + } + hasMoltenMetal = true; + if (!isOre) quantity = 0.1f * metal.stackSize; + else quantity = 0.2f * metal.stackSize; + metal = new ItemStack(Item.getItemById(0), 0, 0); + melting = -1; + isDirty = true; + } + }else if (hasMoltenMetal){ + boolean isOre = JewelrycraftUtil.isOre(metal); + if (melting > 0) melting--; + if (melting == 0){ + hasMetal = false; + if (!isOre) moltenMetal.stackSize += metal.stackSize; + else moltenMetal.stackSize += metal.stackSize * 2; + if (!isOre) quantity += 0.1f * metal.stackSize; + else quantity += 0.2f * metal.stackSize; + metal = new ItemStack(Item.getItemById(0), 0, 0); + melting = -1; + isDirty = true; + } + } + TileEntityMolder me = null; + if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 0 && worldObj.getTileEntity(xCoord, yCoord, zCoord - 1) != null && worldObj.getTileEntity(xCoord, yCoord, zCoord - 1) instanceof TileEntityMolder) me = (TileEntityMolder)worldObj.getTileEntity(xCoord, yCoord, zCoord - 1); + else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 1 && worldObj.getTileEntity(xCoord + 1, yCoord, zCoord) != null && worldObj.getTileEntity(xCoord + 1, yCoord, zCoord) instanceof TileEntityMolder) me = (TileEntityMolder)worldObj.getTileEntity(xCoord + 1, yCoord, zCoord); + else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 2 && worldObj.getTileEntity(xCoord, yCoord, zCoord + 1) != null && worldObj.getTileEntity(xCoord, yCoord, zCoord + 1) instanceof TileEntityMolder) me = (TileEntityMolder)worldObj.getTileEntity(xCoord, yCoord, zCoord + 1); + else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 3 && worldObj.getTileEntity(xCoord - 1, yCoord, zCoord) != null && worldObj.getTileEntity(xCoord - 1, yCoord, zCoord) instanceof TileEntityMolder) me = (TileEntityMolder)worldObj.getTileEntity(xCoord - 1, yCoord, zCoord); + if (pouring && pouredQuantity > 0f){ + quantity -= 0.01f; + pouredQuantity -= 0.01f; + me.quantity += 0.01f; + if (!me.hasMoltenMetal){ + me.moltenMetal = moltenMetal; + me.hasMoltenMetal = true; + } + if (pouredQuantity <= 0f){ + pouring = false; + pouredQuantity = 0.1f; + me.cooling = ConfigHandler.ingotCoolingTime; + } + if (quantity <= 0f){ + quantity = 0f; + hasMoltenMetal = false; + moltenMetal = new ItemStack(Item.getItemById(0), 0, 0); + // pouring = false; + me.cooling = ConfigHandler.ingotCoolingTime; + } + me.isDirty = true; + } + } + + /** + * @return + */ + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + /** + * @param net + * @param packet + */ + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + readFromNBT(packet.func_148857_g()); + worldObj.func_147479_m(xCoord, yCoord, zCoord); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/900c963102e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/900c963102e50014174fe663e69b8422 new file mode 100644 index 0000000..5bf09b9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/900c963102e50014174fe663e69b8422 @@ -0,0 +1,55 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && Block.getBlockFromItem(curItem.getItem()) == Blocks.air){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/f061f27170e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/f061f27170e300141084bb8bfb075c08 new file mode 100644 index 0000000..2ecf660 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/f061f27170e300141084bb8bfb075c08 @@ -0,0 +1,12 @@ +/** + * + */ +package darkknight.jewelrycraft.tileentity; + +/** + * @author Sorin + * + */ +public class TileEntityMidasTouch +{ +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/3086cd9311e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/3086cd9311e60014127dc373d78c1666 new file mode 100644 index 0000000..c1bfcb1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/3086cd9311e60014127dc373d78c1666 @@ -0,0 +1,587 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glPushMatrix(); + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + GL11.glPopMatrix(); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/007d9fbe0ade00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/007d9fbe0ade00141043c3025ec60dfc deleted file mode 100644 index a771686..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/007d9fbe0ade00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int alpha = (ingotColor >> 24) & 0xff; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/c043415c99e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/c043415c99e3001412c4c4819c88e86b new file mode 100644 index 0000000..48e2915 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/c043415c99e3001412c4c4819c88e86b @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; +// System.out.println(midas.target.rotationYaw); +// GL11.glRotatef(, 0.0F, 1.0F, 0.0F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.xCoord - RenderManager.instance.renderPosX, midas.yCoord - RenderManager.instance.renderPosY, midas.zCoord - RenderManager.instance.renderPosZ, midas.target.rotationYaw, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/c04764282ede00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/c04764282ede00141043c3025ec60dfc deleted file mode 100644 index 59fc89c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/c04764282ede00141043c3025ec60dfc +++ /dev/null @@ -1,109 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ -// for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(5 + 16*count, resolution.getScaledHeight() - 10, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15, resolution.getScaledHeight() - 45 + 16 * count, 16777215); -// if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5 + 16*count, resolution.getScaledHeight() - 10, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15, resolution.getScaledHeight() - 45 + 16 * count, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 16*count, resolution.getScaledHeight() - 10, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/c0ddc4bd08e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/c0ddc4bd08e60014127dc373d78c1666 new file mode 100644 index 0000000..10c2079 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/c0ddc4bd08e60014127dc373d78c1666 @@ -0,0 +1,60 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack) != null?JewelryNBT.item(stack).getDisplayName():"Object"; + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) + if(JewelryNBT.item(stack).getItem() instanceof ItemFood) list.add(EnumChatFormatting.DARK_PURPLE + "It's made of solid gold. How are you suppose to eat this?"); + else list.add(EnumChatFormatting.DARK_PURPLE + "Shiny, but useless :("); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/6018c4e6fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/6018c4e6fce40014174fe663e69b8422 new file mode 100644 index 0000000..9fb6a5d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/6018c4e6fce40014174fe663e69b8422 @@ -0,0 +1,47 @@ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldifiedObject extends Item +{ + public ItemGoldifiedObject() + { + super();} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/f045d0fb2ede00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/f045d0fb2ede00141043c3025ec60dfc deleted file mode 100644 index dcf7459..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/f045d0fb2ede00141043c3025ec60dfc +++ /dev/null @@ -1,108 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.entities; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; - -/** - * @author Sorin - */ -public class EntityHeart extends EntityLiving -{ - public EntityHeart(World world) - { - super(world); - this.setSize(0.4F, 0.4F); - } - - public boolean isEntityInvulnerable() - { - return true; - } - - protected boolean canDespawn() - { - return false; - } - - @Override - public void onCollideWithPlayer(EntityPlayer player) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (getType() == "Red" && player.getHealth() < player.getMaxHealth()){ - player.heal(2f); - this.setDead(); - } - else if (getType() != "Red"){ - playerInfo.setFloat(getType() + "Heart", playerInfo.getFloat(getType() + "Heart") + 2.0F <= 20f ? playerInfo.getFloat(getType() + "Heart") + 2.0F : 20f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - this.setDead(); - } - } - - @Override - protected void updateEntityActionState() - { - } - - @SideOnly(Side.CLIENT) - public boolean canRenderOnFire() - { - return false; - } - - protected void entityInit() - { - super.entityInit(); - this.dataWatcher.addObject(16, "Red"); - } - - public void writeEntityToNBT(NBTTagCompound nbt) - { - super.writeEntityToNBT(nbt); - nbt.setString("Type", getType()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - public void readEntityFromNBT(NBTTagCompound nbt) - { - super.readEntityFromNBT(nbt); - setType(nbt.getString("Type")); - } - - public String getType() - { - return this.dataWatcher.getWatchableObjectString(16); - } - - public void setType(String type) - { - this.dataWatcher.updateObject(16, type); - } - - public EnumCreatureAttribute getCreatureAttribute() - { - return EnumCreatureAttribute.UNDEAD; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/10ad6cb191e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/10ad6cb191e3001417b2e384bf7c3702 new file mode 100644 index 0000000..6685fc4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/10ad6cb191e3001417b2e384bf7c3702 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, 0D, 0D, 0D, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/60b9df5e2be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/60b9df5e2be60014127dc373d78c1666 new file mode 100644 index 0000000..605f4f2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/60b9df5e2be60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || !t.enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tab.enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/a0709cf62ae60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/a0709cf62ae60014127dc373d78c1666 new file mode 100644 index 0000000..605f4f2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/a0709cf62ae60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || !t.enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tab.enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/d01a6b619ce3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/d01a6b619ce3001412c4c4819c88e86b new file mode 100644 index 0000000..70b60fe --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/d01a6b619ce3001412c4c4819c88e86b @@ -0,0 +1,33 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + EntityLiving target = ((EntityLiving)midas.target); + target.hurtTime = 0; + float yaw = target.prevRotationYawHead + (target.rotationYawHead - target.prevRotationYawHead); + float yawOffset = target.prevRenderYawOffset + (target.renderYawOffset - target.prevRenderYawOffset); + float pitch = target.prevRotationPitch + (target.rotationPitch - target.prevRotationPitch); + GL11.glRotatef(yawOffset, 0, -1, 0); + GL11.glRotatef(yaw - 90, 0, 1, 0); + GL11.glRotatef(pitch, 0, 0, -1); + GL11.glTranslatef(0.5F, 0.0F, 0.5F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.xCoord, midas.yCoord, midas.zCoord, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/40949c9f36e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/40949c9f36e100141e1cc3c3be242e56 new file mode 100644 index 0000000..1702871 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/40949c9f36e100141e1cc3c3be242e56 @@ -0,0 +1,454 @@ +package darkknight.jewelrycraft.worldGen.village; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureVillagePieces; +import net.minecraft.world.gen.structure.StructureVillagePieces.Start; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.ItemMolds; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class ComponentJewelry extends StructureVillagePieces.House1 +{ + private int averageGroundLevel = -1; + + /** + * + */ + public ComponentJewelry() + {} + + /** + * @param par1ComponentVillageStartPiece + * @param par2 + * @param par3Random + * @param par4StructureBoundingBox + * @param par5 + */ + public ComponentJewelry(Start par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) + { + super(); + coordBaseMode = par5; + boundingBox = par4StructureBoundingBox; + } + + /** + * @param villagePiece + * @param pieces + * @param random + * @param p1 + * @param p2 + * @param p3 + * @param p4 + * @param p5 + * @return + */ + @SuppressWarnings ("rawtypes") + public static ComponentJewelry buildComponent(Start villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 11, 5, 12, p4); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentJewelry(villagePiece, p5, random, structureboundingbox, p4) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the end, it adds Fences... + * + * @param world + * @param random + * @param sbb + * @return + */ + @Override + public boolean addComponentParts(World world, Random random, StructureBoundingBox sbb) + { + if (averageGroundLevel < 0){ + averageGroundLevel = getAverageGroundLevel(world, sbb); + if (averageGroundLevel < 0) return true; + boundingBox.offset(0, averageGroundLevel - boundingBox.maxY + 3, 0); + } + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace) + */ + fillWithBlocks(world, sbb, 0, 0, 6, 10, 5, 11, Block.getBlockById(0), Block.getBlockById(0), false); + fillWithBlocks(world, sbb, 2, 0, 0, 8, 5, 5, Block.getBlockById(0), Block.getBlockById(0), false); + // Pillars + fillWithBlocks(world, sbb, 2, 0, 0, 2, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 2, 0, 3, 2, 3, 3, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 0, 8, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 3, 8, 3, 3, Blocks.log, Blocks.log, false); + // Walls + fillWithBlocks(world, sbb, 2, 0, 1, 2, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 2, 0, 4, 2, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 1, 8, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 4, 8, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 3, 0, 0, 7, 3, 0, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 3, 6, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 11, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 6, 0, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 10, 0, 6, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + // Roof + for(int i = 3; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 2, i, 4, j, sbb); + for(int i = 3; i <= 7; i++) + for(int j = 6; j <= 6; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, i, 4, j, sbb); + for(int i = 1; i <= 9; i++) + for(int j = 7; j <= 10; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 3, i, 4, j, sbb); + for(int i = 2; i <= 8; i++) + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, i, 4, 0, sbb); + for(int i = 1; i <= 5; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 2, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 8, 4, i, sbb); + } + for(int i = 0; i <= 2; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 6, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i + 8, 4, 6, sbb); + } + for(int i = 7; i <= 11; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 0, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 10, 4, i, sbb); + } + for(int i = 0; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 11, sbb); + // Base + for(int i = 2; i <= 8; i++) + for(int j = 0; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.planks, 1, i, 0, j, sbb); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 0, 11, Blocks.stonebrick, Blocks.stonebrick, false); + for(int i = 6; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 5, 0, i, sbb); + for(int i = 7; i <= 10; i++){ + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 1, 0, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 9, 0, i, sbb); + } + // Decorations + placeDoorAtCurrentPosition(world, sbb, random, 6, 1, 0, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeDoorAtCurrentPosition(world, sbb, random, 5, 1, 6, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 3, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 4, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 3, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 3, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 7, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 7, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 10, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 9, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 9, sbb); + int bgCarpetColor = random.nextInt(16); + for(int i = 4; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.carpet, bgCarpetColor, i, 1, j, sbb); + generateChest(world, 3, 1, 1, 0, random, sbb, ConfigHandler.jewelsChestMin, ConfigHandler.jewelsChestMax); + generateDisplayer(world, 3, 1, 2, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + placeBlockAtCurrentPosition(world, BlockList.jewelCraftingTable, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, 3, 1, 3, sbb); + generateDisplayer(world, 3, 1, 4, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + generateChest(world, 3, 1, 5, 0, random, sbb, ConfigHandler.jewelsChestMin, ConfigHandler.jewelsChestMax); + generateFurnace(world, 1, 1, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.canFurnacesGenerateIngots); + generateFurnace(world, 1, 2, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.canFurnacesGenerateIngots); + generateFurnace(world, 1, 3, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.canFurnacesGenerateIngots); + generateFurnace(world, 1, 1, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.canFurnacesGenerateIngots); + generateFurnace(world, 1, 2, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.canFurnacesGenerateIngots); + generateFurnace(world, 1, 3, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.canFurnacesGenerateIngots); + generateSmelter(world, 1, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateSmelter(world, 1, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateMolder(world, 2, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + generateMolder(world, 2, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + for(int l = 0; l < 6; ++l) + for(int i1 = 2; i1 < 9; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + for(int l = 6; l < 12; ++l) + for(int i1 = 0; i1 < 11; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + spawnVillagers(world, sbb, 3, 1, 3, 1); + return true; + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + */ + public void generateChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, Blocks.chest, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + ItemStack jewels = JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size())); + chest.func_145976_a("Jeweler's Chest"); + if (jewels.getItem() == Items.nether_star && ConfigHandler.GENERATE_VILLAGE_NETHERSTAR) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + else if (random.nextBoolean() && jewels.getItem() != Items.nether_star) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateIngotChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ingot Chest"); + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), metal); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateOresChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ores Chest"); + int oreID = random.nextInt(JewelrycraftUtil.ores.size()); + ItemStack ores = JewelrycraftUtil.ores.get(oreID).copy(); + ores.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), ores); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + */ + public void generateDisplayer(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.displayer, metadata, i, j, k, sbb); + TileEntityDisplayer displayer = (TileEntityDisplayer)world.getTileEntity(i1, j1, k1); + if (displayer != null){ + Item[] jewels = {ItemList.ring, ItemList.necklace}; + ItemStack jewel = new ItemStack(jewels[random.nextInt(jewels.length)]); + JewelryNBT.addMetal(jewel, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()))); + JewelryNBT.addModifiers(jewel, JewelrycraftUtil.addRandomModifiers(random.nextInt(4))); + JewelryNBT.addGem(jewel, JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size()))); + displayer.object = jewel; + displayer.quantity = 1; + displayer.hasObject = true; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param isEmpty + */ + public void generateSmelter(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean isEmpty) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.smelter, metadata, i, j, k, sbb); + TileEntitySmelter smelter = (TileEntitySmelter)world.getTileEntity(i1, j1, k1); + if (smelter != null && !isEmpty){ + int metal = random.nextInt(JewelrycraftUtil.metal.size()); + smelter.moltenMetal = JewelrycraftUtil.metal.get(metal).copy(); + smelter.hasMoltenMetal = true; + int quantity = random.nextInt(9); + switch(quantity) + { + case 0: + smelter.quantity = 0.1f; + case 1: + smelter.quantity = 0.2f; + case 2: + smelter.quantity = 0.3f; + case 3: + smelter.quantity = 0.4f; + case 4: + smelter.quantity = 0.5f; + case 5: + smelter.quantity = 0.6f; + case 6: + smelter.quantity = 0.7f; + case 7: + smelter.quantity = 0.8f; + case 8: + smelter.quantity = 0.9f; + default: + smelter.quantity = 0.1f; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param hasMold + * @param hasStuff + */ + public void generateMolder(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean hasMold, boolean hasStuff) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.molder, metadata, i, j, k, sbb); + TileEntityMolder molder = (TileEntityMolder)world.getTileEntity(i1, j1, k1); + if (molder != null && !molder.hasMold) if (hasMold){ + int meta = random.nextInt(ItemMolds.moldsItemNames.length); + molder.mold = new ItemStack(ItemList.molds, 1, meta); + molder.hasMold = true; + if (hasStuff){ + ItemStack ring = new ItemStack(ItemList.ring); + JewelryNBT.addMetal(ring, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack necklace = new ItemStack(ItemList.necklace); + JewelryNBT.addMetal(necklace, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack bracelet = new ItemStack(ItemList.bracelet); + JewelryNBT.addMetal(bracelet, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack earrings = new ItemStack(ItemList.earrings); + JewelryNBT.addMetal(earrings, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + if (meta == 0) molder.jewelBase = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())); + else if (meta == 1) molder.jewelBase = ring; + else if (meta == 2) molder.jewelBase = necklace; + else if (meta == 3) molder.jewelBase = bracelet; + else if (meta == 4) molder.jewelBase = earrings; + molder.hasJewelBase = true; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param hasMetal + */ + public void generateFurnace(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, boolean hasMetal) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, Blocks.furnace, metadata, i, j, k, sbb); + TileEntityFurnace furnace = (TileEntityFurnace)world.getTileEntity(i1, j1, k1); + if (furnace != null){ + if (random.nextBoolean()) furnace.setInventorySlotContents(1, new ItemStack(Items.coal, 1 + random.nextInt(16))); + if (hasMetal){ + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = random.nextInt(max - min + 1) + min; + furnace.setInventorySlotContents(2, metal); + } + } + } + + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + * + * @param par1 + * @return + */ + @Override + protected int getVillagerType(int par1) + { + return 3000; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/6037f46203e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/6037f46203e60014127dc373d78c1666 new file mode 100644 index 0000000..4120ca7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/6037f46203e60014127dc373d78c1666 @@ -0,0 +1,84 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + setHarvestLevel("pickaxe", 2); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 0; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void onBlockHarvested(World world, int i, int j, int k, int meta, EntityPlayer player) + { + System.out.println("Harvest"); + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/c00ae4970fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/c00ae4970fe60014127dc373d78c1666 new file mode 100644 index 0000000..bd63740 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/c00ae4970fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.8F); + GL11.glRotatef(75f, 0f, 1f, 0f); + GL11.glRotatef(-15f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/c01e000872e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/c01e000872e300141084bb8bfb075c08 new file mode 100644 index 0000000..98ec2cb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/c01e000872e300141084bb8bfb075c08 @@ -0,0 +1,85 @@ +package darkknight.jewelrycraft.tileentity; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityMidasTouch extends TileEntity +{ + public Entity target; + + public TileEntityMidasTouch() + { + target = null; + } + + /** + * @param nbt + */ + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + NBTTagCompound tag = new NBTTagCompound(); + target.writeToNBT(tag); + int id = EntityList.getEntityID(target); + nbt.setInteger("entityID", id); + nbt.setTag("entity", tag); + } + + /** + * @param nbt + */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + if (nbt.hasKey("entityID") && nbt.hasKey("entity")){ + NBTTagCompound en = (NBTTagCompound)nbt.getTag("entity"); + int entityID = nbt.getInteger("entityID"); + EntityLivingBase entity = (EntityLivingBase)EntityList.createEntityByID(entityID, worldObj); + if (entity != null && entity instanceof EntityLivingBase){ + entity.readFromNBT(en); + target = entity; + } + } + } + + /** + * + */ + @Override + public void updateEntity() + { + super.updateEntity(); + } + + /** + * @return + */ + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + /** + * @param net + * @param packet + */ + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + readFromNBT(packet.func_148857_g()); + worldObj.func_147479_m(xCoord, yCoord, zCoord); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/e03e86c12ede00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/e03e86c12ede00141043c3025ec60dfc deleted file mode 100644 index 974cea0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/e03e86c12ede00141043c3025ec60dfc +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.entities; - -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * @author Sorin - */ -public class EntityHalfHeart extends EntityHeart -{ - public EntityHalfHeart(World world) - { - super(world); - } - - @Override - public void onCollideWithPlayer(EntityPlayer player) - { - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (getType().equals("Red") && player.getHealth() < player.getMaxHealth()){ - player.heal(1f); - this.setDead(); - }else if (getType().equals("White") && playerInfo.getFloat("WhiteHeart") > 0.1F){ - playerInfo.setFloat(getType() + "Heart", 0F); - player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() + 2f); - this.setDead(); - }else if (!getType().equals("Red") && playerInfo.getFloat(getType() + "Heart") < 20f){ - playerInfo.setFloat(getType() + "Heart", playerInfo.getFloat(getType() + "Heart") + 1.0F <= 20f ? playerInfo.getFloat(getType() + "Heart") + 1.0F : 20f); - this.setDead(); - } - } - else JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/005b61f003e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/005b61f003e60014127dc373d78c1666 new file mode 100644 index 0000000..7f1dad2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/005b61f003e60014127dc373d78c1666 @@ -0,0 +1,94 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockCompressed; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); +// player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("nugget ")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("ingot ")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockCompressed) return new ItemStack(Blocks.gold_block, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/10b8eac006e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/10b8eac006e50014174fe663e69b8422 new file mode 100644 index 0000000..b29bb85 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/10b8eac006e50014174fe663e69b8422 @@ -0,0 +1,63 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIcon(JewelryNBT.item(stack), pass); + else return Block.getBlockFromItem(item.).getBlockTextureFromSide(1); + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/40142c73fee50014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/40142c73fee50014127dc373d78c1666 new file mode 100644 index 0000000..78284a6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/40142c73fee50014127dc373d78c1666 @@ -0,0 +1,20 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +/** + * @author Sorin + * + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + System.out.println("Broken " + event.getResult()); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/e070a9a826e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/e070a9a826e60014127dc373d78c1666 new file mode 100644 index 0000000..ac1591c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/e070a9a826e60014127dc373d78c1666 @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.client.gui.AbstractTab; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketKeyPressEvent; + +public class TabJewelry extends AbstractTab +{ + public TabJewelry() + { + super(0, 0, 0, new ItemStack(ItemList.necklace)); + } + + @Override + public void onTabClicked () + { + JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(0)); + } + + @Override + public boolean shouldAddToList () + { + return true; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/601566c636e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/601566c636e100141e1cc3c3be242e56 new file mode 100644 index 0000000..514a129 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/601566c636e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int MAX_VILLAGE_JEWELERS; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + jewelerWeight = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + ingotChestMin = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMax = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/608194048ee3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/608194048ee3001417b2e384bf7c3702 new file mode 100644 index 0000000..ab988e7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/608194048ee3001417b2e384bf7c3702 @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor4f(1F, 0.0F, 0.0F, 0.3F); + RenderManager.instance.renderEntityStatic(midas.target, 1F, false); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/80a948a2fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/80a948a2fce40014174fe663e69b8422 new file mode 100644 index 0000000..3293158 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/80a948a2fce40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/a015113e04de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/a015113e04de00141043c3025ec60dfc deleted file mode 100644 index aac4272..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/a015113e04de00141043c3025ec60dfc +++ /dev/null @@ -1,278 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (active && target != null && this.getDistanceFrom(target.posX, target.posY, target.posZ) > 18D){ - active = false; - timer = -1; - } - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - else if(pedestal != null && target != null) JewelrycraftUtil.addCursePoints(target, 20); - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/009902e3fbe40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/009902e3fbe40014174fe663e69b8422 new file mode 100644 index 0000000..41d620d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/009902e3fbe40014174fe663e69b8422 @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/b07b909e26de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/b07b909e26de00141043c3025ec60dfc deleted file mode 100644 index 1ed30a1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/b07b909e26de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.5f, 0.5f, 0.0f); - drawTexturedModalRect(20, 20 + (size + 12) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/5014ba759ce3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/5014ba759ce3001412c4c4819c88e86b new file mode 100644 index 0000000..73d2ad6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/5014ba759ce3001412c4c4819c88e86b @@ -0,0 +1,33 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + EntityLiving target = ((EntityLiving)midas.target); + target.hurtTime = 0; + float yaw = target.prevRotationYawHead + (target.rotationYawHead - target.prevRotationYawHead); + float yawOffset = target.prevRenderYawOffset + (target.renderYawOffset - target.prevRenderYawOffset); + float pitch = target.prevRotationPitch + (target.rotationPitch - target.prevRotationPitch); + GL11.glRotatef(yawOffset, 0, -1, 0); + GL11.glRotatef(yaw - 90, 0, 1, 0); + GL11.glRotatef(pitch, 0, 0, -1); + GL11.glTranslatef(0.5F, 0.0F, 0.5F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(target, target.posX - RenderManager.instance.renderPosX, target.posY - RenderManager.instance.renderPosY, target.posZ - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/d0cfb46325e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/d0cfb46325e60014127dc373d78c1666 new file mode 100644 index 0000000..0a4810f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/d0cfb46325e60014127dc373d78c1666 @@ -0,0 +1,100 @@ +package darkknight.jewelrycraft.proxy; + +import main.java.tconstruct.client.tabs.InventoryTabVanilla; +import main.java.tconstruct.client.tabs.TabRegistry; +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.VillagerRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.entities.renders.HeartRender; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.render.ItemRender; +import darkknight.jewelrycraft.model.ModelDisplayer; +import darkknight.jewelrycraft.model.ModelHalfHeart; +import darkknight.jewelrycraft.model.ModelHandPedestal; +import darkknight.jewelrycraft.model.ModelHeart; +import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; +import darkknight.jewelrycraft.model.ModelMolder; +import darkknight.jewelrycraft.model.ModelShadowEye; +import darkknight.jewelrycraft.model.ModelShadowHand; +import darkknight.jewelrycraft.model.ModelSmelter; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMidasTouchRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/ShadowHand.png"); + TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMidasTouch.class, new TileEntityMidasTouchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); + + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); + MinecraftForgeClient.registerItemRenderer(ItemList.goldObj, new ItemRender()); + + VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation(Variables.MODID, "textures/entities/jeweler.png")); + + RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); + + if (!Loader.isModLoaded("TConstruct") && TabRegistry.getTabList().size() < 1) + { + TabRegistry.registerTab(new InventoryTabVanilla()); + } + TabRegistry.registerTab(new TabJewelry()); + MinecraftForge.EVENT_BUS.register(new TabRegistry()); + MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); + ResourceLocation jeweleryTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/f028294b23e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/f028294b23e60014127dc373d78c1666 new file mode 100644 index 0000000..9cc9bd3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/f028294b23e60014127dc373d78c1666 @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glRotatef(90F, 0F, 1F, 0F); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/f0c241e602e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/f0c241e602e60014127dc373d78c1666 new file mode 100644 index 0000000..d294b71 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/f0c241e602e60014127dc373d78c1666 @@ -0,0 +1,193 @@ +package darkknight.jewelrycraft.block; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.tileentity.TileEntityBlockShadow; + +public class BlockShadow extends BlockContainer +{ + private IIcon[] iconArray; + + /** + * + */ + public BlockShadow() + { + super(Material.iron); + setHarvestLevel("ItemPickaxe.class", 3); + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * @return + */ + @Override + public int getRenderBlockPass() + { + return 1; + } + + /** + * @param worldObj + * @param x + * @param y + * @param z + * @param beaconX + * @param beaconY + * @param beaconZ + * @return + */ + public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) + { + return true; + } + + /** + * @return + */ + @Override + public boolean isOpaqueCube() + { + return false; + } + + /** + * @return + */ + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * @param world + * @param x + * @param y + * @param z + * @param side + * @return + */ + public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side) + { + return false; + } + + /** + * @param par0 + * @return + */ + public static boolean isNormalCube(int par0) + { + return true; + } + + /** + * @param world + * @param var2 + * @return + */ + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityBlockShadow(); + } + + /** + * @param par1IconRegister + */ + @Override + public void registerBlockIcons(IIconRegister par1IconRegister) + { + iconArray = new IIcon[16]; + for(int i = 0; i < iconArray.length; ++i) + iconArray[i] = par1IconRegister.registerIcon(getTextureName() + (15 - i)); + } + + /** + * @param world + * @param x + * @param y + * @param z + * @return + */ + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) + { + if (world.getBlockMetadata(x, y, z) == 15) return null; + return super.getCollisionBoundingBoxFromPool(world, x, y, z); + } + + /** + * @param par1IBlockAccess + * @param par2 + * @param par3 + * @param par4 + */ + @Override + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + { + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * @param p_149646_1_ + * @param p_149646_2_ + * @param p_149646_3_ + * @param p_149646_4_ + * @param p_149646_5_ + * @return + */ + @Override + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) + { + Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_); + if (this == BlockList.shadowBlock) if (block == this) return false; + return block == this ? false : super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + } + + /** + * @return + */ + @Override + public boolean hasComparatorInputOverride() + { + return true; + } + + /** + * @param world + * @param x + * @param y + * @param z + * @param meta + * @return + */ + @Override + public int getComparatorInputOverride(World world, int x, int y, int z, int meta) + { + return world.getBlockMetadata(x, y, z); + } + + /** + * @param side + * @param meta + * @return + */ + @Override + @SideOnly (Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return iconArray[meta]; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/a0532f0bfce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/a0532f0bfce40014174fe663e69b8422 new file mode 100644 index 0000000..c682c5b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/a0532f0bfce40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.*; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject").setTextureName(Variables.MODID + ":jewelryModifier"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/b06750e295e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/b06750e295e3001412c4c4819c88e86b new file mode 100644 index 0000000..0dfaaf8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/b06750e295e3001412c4c4819c88e86b @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.tileentity; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityMidasTouch extends TileEntity +{ + public Entity target; + + public TileEntityMidasTouch() + {} + + public void setEntity(Entity ent) + { + target = ent; + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + if (target != null){ + int id = EntityList.getEntityID(target); + NBTTagCompound tag = new NBTTagCompound(); + target.writeToNBT(tag); + nbt.setInteger("entityID", id); + nbt.setTag("entity", tag); + } + } + + /** + * @param nbt + */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + NBTTagCompound en = (NBTTagCompound)nbt.getTag("entity"); + int entityID = nbt.getInteger("entityID"); + EntityLivingBase entity = (EntityLivingBase)EntityList.createEntityByID(entityID, worldObj); + entity.readFromNBT(en); + target = entity; + } + + /** + * + */ + @Override + public boolean canUpdate() + { + return false; + } + + /** + * @return + */ + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + /** + * @param net + * @param packet + */ + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + readFromNBT(packet.func_148857_g()); + worldObj.func_147479_m(xCoord, yCoord, zCoord); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/2064f33d99e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/2064f33d99e3001412c4c4819c88e86b new file mode 100644 index 0000000..2667fe6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/2064f33d99e3001412c4c4819c88e86b @@ -0,0 +1,28 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; +// System.out.println(midas.target.rotationYaw); +// GL11.glRotatef(, 0.0F, 1.0F, 0.0F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, MathHelper.floor_double(midas.target.posX - RenderManager.instance.renderPosX), MathHelper.floor_double(midas.target.posY - RenderManager.instance.renderPosY), MathHelper.floor_double(midas.target.posZ - RenderManager.instance.renderPosZ), midas.target.rotationYaw, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/c0c8f29707e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/c0c8f29707e50014174fe663e69b8422 new file mode 100644 index 0000000..ec1b0c0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/c0c8f29707e50014174fe663e69b8422 @@ -0,0 +1,96 @@ +package darkknight.jewelrycraft.proxy; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.InventoryTabVanilla; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.TabRegistry; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.entities.renders.HeartRender; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.render.ItemRender; +import darkknight.jewelrycraft.model.ModelDisplayer; +import darkknight.jewelrycraft.model.ModelHalfHeart; +import darkknight.jewelrycraft.model.ModelHandPedestal; +import darkknight.jewelrycraft.model.ModelHeart; +import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; +import darkknight.jewelrycraft.model.ModelMolder; +import darkknight.jewelrycraft.model.ModelShadowEye; +import darkknight.jewelrycraft.model.ModelShadowHand; +import darkknight.jewelrycraft.model.ModelSmelter; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMidasTouchRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/ShadowHand.png"); + TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMidasTouch.class, new TileEntityMidasTouchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); + + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); + MinecraftForgeClient.registerItemRenderer(ItemList.goldObj, new ItemRender(null)); + + VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation(Variables.MODID, "textures/entities/jeweler.png")); + + RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); + + TabRegistry.registerTab(new InventoryTabVanilla()); + TabRegistry.registerTab(new TabJewelry()); + MinecraftForge.EVENT_BUS.register(new TabRegistry()); + MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); + ResourceLocation jeweleryTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/e0dae57e2ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/e0dae57e2ce60014127dc373d78c1666 new file mode 100644 index 0000000..a3c5378 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/e0dae57e2ce60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || !tabList.get(1).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/b08acbee01e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/b08acbee01e60014127dc373d78c1666 new file mode 100644 index 0000000..47efd46 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/b08acbee01e60014127dc373d78c1666 @@ -0,0 +1,41 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.block.BlockMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +/** + * @author Sorin + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + // System.out.println("Broken " + event.getResult()); + ItemStack item = event.getPlayer().inventory.getCurrentItem(); + if (event.block instanceof BlockMidasTouch && item != null && item.getItem().canHarvestBlock(event.block, item)){ + System.out.println(event.block.getHarvestLevel(0) + " " + item.getItem().getHarvestLevel(item, "ItemPickaxe.class")); + TileEntityMidasTouch te = (TileEntityMidasTouch)event.world.getTileEntity(event.x, event.y, event.z); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + } + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/5089f60bfee40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/5089f60bfee40014174fe663e69b8422 new file mode 100644 index 0000000..ddd7e9b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/5089f60bfee40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + public static Item goldObj; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldObj = new ItemGoldObj().setUnlocalizedName(Variables.MODID + ".goldObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldObj, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/7045388123e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/7045388123e60014127dc373d78c1666 new file mode 100644 index 0000000..63bb858 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/7045388123e60014127dc373d78c1666 @@ -0,0 +1,76 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + GL11.glRotatef(90F, 0F, 1F, 0F); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + GL11.glRotatef(-90F, 0F, 1F, 0F); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/d0c8245c0fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/d0c8245c0fe60014127dc373d78c1666 new file mode 100644 index 0000000..42e58aa --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/d0c8245c0fe60014127dc373d78c1666 @@ -0,0 +1,578 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.6F); + GL11.glRotatef(90f, 0f, 1f, 0f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/500f4e3704e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/500f4e3704e50014174fe663e69b8422 new file mode 100644 index 0000000..3478a71 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/500f4e3704e50014174fe663e69b8422 @@ -0,0 +1,61 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); +// System.out.println(item.getItem().getIconIndex(JewelryNBT.item(stack))); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else{ + System.out.println(Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1)); + return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1); + } + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/5094c22ddce50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/5094c22ddce50014109ec019d2f6c0dc new file mode 100644 index 0000000..5c3c47a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/5094c22ddce50014109ec019d2f6c0dc @@ -0,0 +1,77 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.*; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/702fad0522e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/702fad0522e60014127dc373d78c1666 new file mode 100644 index 0000000..d58366d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/702fad0522e60014127dc373d78c1666 @@ -0,0 +1,195 @@ +/* + * Mod made by DarkKnight during the Modjam 3 + * It's an awesome mod + * I love me! :D + */ +package darkknight.jewelrycraft; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Logger; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; +import cpw.mods.fml.relauncher.Side; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.gui.GuiHandler; +import darkknight.jewelrycraft.commands.JewelrycraftCommands; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.curses.CurseList; +import darkknight.jewelrycraft.damage.DamageSourceList; +import darkknight.jewelrycraft.effects.EffectsList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.events.BlockEventHandler; +import darkknight.jewelrycraft.events.BucketHandler; +import darkknight.jewelrycraft.events.EntityEventHandler; +import darkknight.jewelrycraft.events.KeyBindings; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketClearColorCache; +import darkknight.jewelrycraft.network.PacketKeyPressEvent; +import darkknight.jewelrycraft.network.PacketRequestLiquidData; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; +import darkknight.jewelrycraft.network.PacketRequestSetSlot; +import darkknight.jewelrycraft.network.PacketSendCurseStats; +import darkknight.jewelrycraft.network.PacketSendLiquidData; +import darkknight.jewelrycraft.network.PacketSendPlayerInfo; +import darkknight.jewelrycraft.proxy.CommonProxy; +import darkknight.jewelrycraft.recipes.CraftingRecipes; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; +import darkknight.jewelrycraft.worldGen.Generation; +import darkknight.jewelrycraft.worldGen.village.ComponentJewelry; +import darkknight.jewelrycraft.worldGen.village.JCTrades; +import darkknight.jewelrycraft.worldGen.village.VillageJewelryHandler; + +@Mod (modid = Variables.MODID, name = Variables.MODNAME, version = Variables.VERSION, guiFactory = Variables.CONFIG_GUI) +public class JewelrycraftMod +{ + @Instance (Variables.MODID) + public static JewelrycraftMod instance; + + @SidedProxy (clientSide = Variables.CLIENT_PROXY, serverSide = Variables.SERVER_PROXY) + public static CommonProxy proxy; + public static final Logger logger = Logger.getLogger("Jewelrycraft"); + public static File dir; + + public static CreativeTabs jewelrycraft = new CreativeTabs(Variables.MODID){ + @Override + public Item getTabIconItem() + { + return Item.getItemFromBlock(BlockList.jewelCraftingTable); + } + }; + + public static CreativeTabs liquids = new CreativeTabLiquids("Liquids"); + public static NBTTagCompound saveData = new NBTTagCompound(); + public static NBTTagCompound clientData = new NBTTagCompound(); + public static File liquidsConf; + public static SimpleNetworkWrapper netWrapper; + public static boolean fancyRender; + + /** + * Pre initialization of mod stuff. + * + * @param e FMLPreInitializationEvent + * @throws IOException Signals that an I/O exception has occurred. + */ + @EventHandler + public void preInit(FMLPreInitializationEvent e) throws IOException + { + ConfigHandler.INSTANCE.loadConfig(e); + BlockList.preInit(e); + ItemList.preInit(e); + CraftingRecipes.preInit(e); + CurseList.preInit(e); + OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot)); + OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre)); + VillagerRegistry.instance().registerVillagerId(3000); + VillagerRegistry.instance().registerVillageTradeHandler(3000, new JCTrades()); + VillagerRegistry.instance().registerVillageCreationHandler(new VillageJewelryHandler()); + try{ + MapGenStructureIO.func_143031_a(ComponentJewelry.class, Variables.MODID + ":Jewelry"); + } + catch(Throwable e2){ + logger.severe("Error registering Jewelrycraft Structures with Vanilla Minecraft: this is expected in versions earlier than 1.7.10"); + } + MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); + MinecraftForge.EVENT_BUS.register(new BlockEventHandler()); + MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE); + BucketHandler.INSTANCE.buckets.put(BlockList.moltenMetal, ItemList.bucket); + + ModMetadata metadata = e.getModMetadata(); + List authorList = new ArrayList(); + + authorList.add("OnyxDarkKnight"); + authorList.add("bspkrs"); + authorList.add("domi1819"); + + dir = e.getModConfigurationDirectory(); + proxy.preInit(); + netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Variables.MODID); + netWrapper.registerMessage(PacketRequestLiquidData.class, PacketRequestLiquidData.class, 0, Side.SERVER); + netWrapper.registerMessage(PacketSendLiquidData.class, PacketSendLiquidData.class, 1, Side.CLIENT); + netWrapper.registerMessage(PacketClearColorCache.class, PacketClearColorCache.class, 2, Side.CLIENT); + netWrapper.registerMessage(PacketKeyPressEvent.class, PacketKeyPressEvent.class, 3, Side.SERVER); + netWrapper.registerMessage(PacketRequestPlayerInfo.class, PacketRequestPlayerInfo.class, 4, Side.SERVER); + netWrapper.registerMessage(PacketSendPlayerInfo.class, PacketSendPlayerInfo.class, 5, Side.CLIENT); + netWrapper.registerMessage(PacketSendCurseStats.class, PacketSendCurseStats.class, 6, Side.CLIENT); + netWrapper.registerMessage(PacketRequestSetSlot.class, PacketRequestSetSlot.class, 7, Side.SERVER); + + metadata.autogenerated = false; + metadata.authorList = authorList; + metadata.url = "https://github.com/sor1n/Jewelrycraft"; + + createEntity(EntityHeart.class, Variables.MODID + ".Heart", 0xFF0000, 0xFF0000, false); + createEntity(EntityHalfHeart.class, Variables.MODID + ".Half-Heart", 0x000000, 0xFF0000, false); + + } + + public void createEntity(Class entity, String entityName, int solidColor, int spotColor, boolean hasSpawnEgg) + { + int randomID = EntityRegistry.findGlobalUniqueEntityId(); + if(hasSpawnEgg) EntityRegistry.registerGlobalEntityID(entity, entityName, randomID, solidColor, spotColor); + else EntityRegistry.registerGlobalEntityID(entity, entityName, randomID); + EntityRegistry.registerModEntity(entity, entityName, randomID, this, 40, 3, true); + } + + /** + * Initializes the world generation and key bindings. + * + * @param e FMLInitializationEvent + */ + @EventHandler + public void init(FMLInitializationEvent e) + { + GameRegistry.registerWorldGenerator(new Generation(), 0); + if (FMLCommonHandler.instance().getSide() == Side.CLIENT) FMLCommonHandler.instance().bus().register(new KeyBindings()); + new GuiHandler(); + FMLCommonHandler.instance().bus().register(ConfigHandler.INSTANCE); + } + + /** + * Post initialization of metals, modifiers and others. + * + * @param e FMLPostInitializationEvent + */ + @EventHandler + public void postInit(FMLPostInitializationEvent e) + { + JewelrycraftUtil.addMetals(); + JewelrycraftUtil.jamcrafters(); + EffectsList.postInit(e); + DamageSourceList.postInit(e); + proxy.postInit(); + } + + @Mod.EventHandler + public void serverLoad(FMLServerStartingEvent event) + { + event.registerServerCommand(new JewelrycraftCommands()); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/707860379ce3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/707860379ce3001412c4c4819c88e86b new file mode 100644 index 0000000..79e5667 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/707860379ce3001412c4c4819c88e86b @@ -0,0 +1,33 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + EntityLiving target = ((EntityLiving)midas.target); + target.hurtTime = 0; + float yaw = target.prevRotationYawHead + (target.rotationYawHead - target.prevRotationYawHead); + float yawOffset = target.prevRenderYawOffset + (target.renderYawOffset - target.prevRenderYawOffset); + float pitch = target.prevRotationPitch + (target.rotationPitch - target.prevRotationPitch); + GL11.glRotatef(yawOffset, 0, -1, 0); + GL11.glRotatef(yaw - 90, 0, 1, 0); + GL11.glRotatef(pitch, 0, 0, -1); + GL11.glTranslatef(0.5F, 0.0F, 0.5F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.xCoord - RenderManager.instance.renderPosX, midas.yCoord - RenderManager.instance.renderPosY, midas.zCoord - RenderManager.instance.renderPosZ, midas.target.rotationYaw, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/c056dd602ee60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/c056dd602ee60014127dc373d78c1666 new file mode 100644 index 0000000..b6e8818 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/c056dd602ee60014127dc373d78c1666 @@ -0,0 +1,580 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.*; +import net.minecraft.client.renderer.tileentity.*; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.*; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.*; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glPushMatrix(); + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + GL11.glPopMatrix(); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + RenderHelper.enableStandardItemLighting(); + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + RenderHelper.disableStandardItemLighting(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/e0ac941eccdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/e0ac941eccdf00141dc6c962aec96210 deleted file mode 100644 index 7b86357..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/e0ac941eccdf00141dc6c962aec96210 +++ /dev/null @@ -1,96 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if ((arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0) && rand.nextInt(2 + JewelryNBT.numberOfModifiers(item)) == 0) arrow.setDead(); - } - } - } - if (jewelry instanceof ItemBracelet && exists){ - // Positive bracelet - if (player.motionY < 0) player.motionY *= (0.6D + (JewelryNBT.numberOfModifiers(item) - 1) * 0.03D); - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) player.fallDistance = 0F; - // Negative bracelet - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80 + JewelryNBT.numberOfModifiers(item) * 10, 1 + JewelryNBT.numberOfModifiers(item) / 4)); - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - // Negative ring - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - // Positive ring - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/b0dd171b36e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/b0dd171b36e100141e1cc3c3be242e56 new file mode 100644 index 0000000..3233a23 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/b0dd171b36e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int ingotCoolingTime; + public static int ingotMeltingTime; + public static int jewelryCraftingTime; + public static boolean generateVillageNetherstar; + public static boolean canFurnacesGenerateIngots; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + ingotCoolingTime = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + ingotMeltingTime = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + jewelryCraftingTime = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + generateVillageNetherstar = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + canFurnacesGenerateIngots = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + maxVillageJewelers = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + jewelerWeight = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + ingotChestMin = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMax = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/d08a12f794e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/d08a12f794e3001412c4c4819c88e86b new file mode 100644 index 0000000..58c8981 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/d08a12f794e3001412c4c4819c88e86b @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntity tile = world.getTileEntity(x, y, z); + if(((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.boundingBox.minX); + this.setBlockBounds((float)((TileEntityMidasTouch)tile).target.boundingBox.minX, (float)((TileEntityMidasTouch)tile).target.boundingBox.minY, (float)((TileEntityMidasTouch)tile).target.boundingBox.minZ, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxX, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxY, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxZ); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/509f12b8cfdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/509f12b8cfdf00141dc6c962aec96210 deleted file mode 100644 index c04ae60..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/509f12b8cfdf00141dc6c962aec96210 +++ /dev/null @@ -1,102 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); -// if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(130, (size + 26) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); -// } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/70eb2ca3ccdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/70eb2ca3ccdf00141dc6c962aec96210 deleted file mode 100644 index b3976ba..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/70eb2ca3ccdf00141dc6c962aec96210 +++ /dev/null @@ -1,96 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if ((arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0) && rand.nextInt(2 + JewelryNBT.numberOfModifiers(item)) == 0) arrow.setDead(); - } - } - } - if (jewelry instanceof ItemBracelet && exists){ - // Positive bracelet - if (player.motionY < 0) player.motionY *= (0.6D + (JewelryNBT.numberOfModifiers(item) - 1) * 0.03D); - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) player.fallDistance = 0F; - // Negative bracelet - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80 + JewelryNBT.numberOfModifiers(item) * 10, 1 + JewelryNBT.numberOfModifiers(item) / 4)); - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - // Negative ring - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / (2F + (JewelryNBT.numberOfModifiers(item)-1)*0.1F)); - // Positive ring - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 51 - JewelryNBT.numberOfModifiers(item)); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(3 + JewelryNBT.numberOfModifiers(item)) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/b076e5188ee3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/b076e5188ee3001417b2e384bf7c3702 new file mode 100644 index 0000000..85db83f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/b076e5188ee3001417b2e384bf7c3702 @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glColor4f(1F, 0.0F, 1.0F, 0.3F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + RenderManager.instance.renderEntityStatic(midas.target, 1F, false); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/f055598098e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/f055598098e3001412c4c4819c88e86b new file mode 100644 index 0000000..59f4f6c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/f055598098e3001412c4c4819c88e86b @@ -0,0 +1,37 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart)){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/604b232936e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/604b232936e100141e1cc3c3be242e56 new file mode 100644 index 0000000..8c152e3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/604b232936e100141e1cc3c3be242e56 @@ -0,0 +1,206 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.util.Variables; + +public class BlockMolder extends BlockContainer +{ + Random rand = new Random(); + + /** + * @param par2Material + */ + protected BlockMolder(Material par2Material) + { + super(par2Material); + setBlockBounds(0.1F, 0F, 0.1F, 0.9F, 0.2F, 0.9F); + } + + /** + * @param world + * @param var2 + * @return + */ + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMolder(); + } + + /** + * @return + */ + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param entityPlayer + * @param par6 + * @param par7 + * @param par8 + * @param par9 + * @return + */ + @Override + public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) + { + TileEntityMolder te = (TileEntityMolder)world.getTileEntity(i, j, k); + ItemStack item = entityPlayer.inventory.getCurrentItem(); + if (te != null && !world.isRemote){ + if (item != null && !te.hasMold && item.getItem() == ItemList.molds){ + te.mold = item.copy(); + te.hasMold = true; + if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize; + entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage." + Variables.MODID + ".molder.addedmold", te.mold.getDisplayName()))); + te.isDirty = true; + } + if (te.hasMold && entityPlayer.isSneaking() && !te.hasMoltenMetal){ + dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.mold.copy()); + te.mold = new ItemStack(Item.getItemById(0), 0, 0); + te.hasMold = false; + te.isDirty = true; + }else if (te.hasMoltenMetal) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".molder.hasmoltenmetal"))); + } + return true; + } + + /** + * @param world + * @param x + * @param y + * @param z + * @param stack + */ + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param par5 + * @param par6 + */ + @Override + public void breakBlock(World world, int i, int j, int k, Block par5, int par6) + { + TileEntityMolder te = (TileEntityMolder)world.getTileEntity(i, j, k); + if (te != null){ + if (te.hasJewelBase) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, te.jewelBase.copy()); + if (te.hasMold) dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.mold.copy()); + world.removeTileEntity(i, j, k); + } + super.breakBlock(world, i, j, k, par5, par6); + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param entityLiving + * @param par6ItemStack + */ + @Override + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack) + { + int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + world.setBlockMetadataWithNotify(i, j, k, rotation, 2); + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param player + */ + @Override + public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) + { + TileEntityMolder me = (TileEntityMolder)world.getTileEntity(i, j, k); + if (me != null && !world.isRemote){ + if (me.hasJewelBase){ + dropItem(me.getWorldObj(), me.xCoord, me.yCoord, me.zCoord, me.jewelBase.copy()); + me.jewelBase = new ItemStack(Item.getItemById(0), 0, 0); + me.hasJewelBase = false; + }else if (me.hasMoltenMetal && me.cooling >= 0) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".molder.metaliscooling") + " (" + (ConfigHandler.INGOT_COOLING_TIME - me.cooling) * 100 / ConfigHandler.INGOT_COOLING_TIME + "%)")); + else if (me.mold.getItem() == ItemList.molds && !me.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".molder.moldisempty"))); + else if (me.mold.getItem() != ItemList.molds) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".molder.moldismissing"))); + me.isDirty = true; + } + } + + /** + * @param iblockaccess + * @param i + * @param j + * @param k + * @param l + * @return + */ + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + /** + * @return + */ + @Override + public boolean isOpaqueCube() + { + return false; + } + + /** + * @return + */ + @Override + public int getRenderType() + { + return -1; + } + + /** + * @param icon + */ + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon(Variables.MODID + ":molder"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/70418fad26e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/70418fad26e60014127dc373d78c1666 new file mode 100644 index 0000000..e65bf88 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/70418fad26e60014127dc373d78c1666 @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft.client.gui; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class InventoryTabVanilla extends AbstractTab +{ + public InventoryTabVanilla() + { + super(0, 0, 0, new ItemStack(Blocks.crafting_table)); + } + + @Override + public void onTabClicked () + { + TabRegistry.openInventoryGui(); + } + + @Override + public boolean shouldAddToList () + { + return true; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/108313903de100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/108313903de100141e1cc3c3be242e56 new file mode 100644 index 0000000..adaddd3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/108313903de100141e1cc3c3be242e56 @@ -0,0 +1,66 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static int RITUAL_TIME; + + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int MAX_VILLAGE_JEWELERS; + public static int JEWELER_WEIGHT; + public static int INGOT_CHEST_MIN; + public static int INGOT_CHEST_MAX; + public static int INGOT_CHEST_MAX_STACK; + public static int GEM_CHEST_MIN; + public static int GEM_CHEST_MAX; + public static int FURNACE_MIN_INGOT_STACK; + public static int FURNACE_MAX_INGOT_STACK; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + RITUAL_TIME = config.getInt( "Ritual Time", categories[0], 1000, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for the ritual to end."); + + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + JEWELER_WEIGHT = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + INGOT_CHEST_MIN = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX_STACK = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + GEM_CHEST_MIN = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + GEM_CHEST_MAX = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + FURNACE_MIN_INGOT_STACK = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + FURNACE_MAX_INGOT_STACK = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/70f03ed40fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/70f03ed40fe60014127dc373d78c1666 new file mode 100644 index 0000000..b7bfca5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/70f03ed40fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.4F, 0.92F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/90a153b367dd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/90a153b367dd001412dce27813e7be4a deleted file mode 100644 index 2424491..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/90a153b367dd001412dce27813e7be4a +++ /dev/null @@ -1,123 +0,0 @@ -package darkknight.jewelrycraft.events; - -import java.util.Iterator; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.entities.renders.RenderHelper; -import darkknight.jewelrycraft.item.render.BraceletRender; -import darkknight.jewelrycraft.item.render.EarringsRender; -import darkknight.jewelrycraft.item.render.MaskRender; -import darkknight.jewelrycraft.model.ModelBracelet; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class PlayerRenderHandler -{ - MaskRender mask = new MaskRender(); - EarringsRender earrings = new EarringsRender(); - BraceletRender bracelet = new BraceletRender(); - public static String[] infamyCache = new String[]{}; - - @SubscribeEvent - public void renderScreen(RenderPlayerEvent.Specials.Post event) - { - ModelBiped main = event.renderer.modelBipedMain; - Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); - if (infamyCache != null){ - while (players.hasNext()){ - EntityPlayer player = players.next(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); -// System.out.println(playerInfo); - if (checkPlayerInfamy(player.getDisplayName()) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){ - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(1.6f, 1.6f, 1.6f); - GL11.glTranslatef(-0.25F, -0.25F, -0.25F); - mask.doRender(event.entityPlayer, 0F, 0F, 0F, 0F, 0F); - GL11.glPopMatrix(); - } - if (playerInfo.hasKey("ext17") && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext17"); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(0.07f, 0.07f, 0.07f); - GL11.glTranslatef(0.0F, 3.0F, -2.0F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - earrings.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - GL11.glPopMatrix(); - } - for(int i = 10; i <= 13; i++) - if (playerInfo.hasKey("ext" + i) && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glTranslatef((i / 12 == 1) ? -0.275F : 0.475F, 0.2F + ((i / 12 == 1) ? (i - 12) * 0.08F : (i - 10) * 0.08F), 0F); - if (player.isSneaking()) GL11.glTranslatef(0F, 0F, -((i == 10 || i == 12) ? (0.1F) : 0.05F)); - if (i / 12 == 1){ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedRightArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0.0F); - }else{ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedLeftArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - } - GL11.glPopMatrix(); - } - } - } - } - - /** - * @param string - * @return - */ - private boolean checkPlayerInfamy(String string) - { - for(int i = 0; i < infamyCache.length; i++) - if (infamyCache[i].equals(string)) return true; - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/b095661a2ede00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/b095661a2ede00141043c3025ec60dfc deleted file mode 100644 index 9deff95..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/b095661a2ede00141043c3025ec60dfc +++ /dev/null @@ -1,109 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ -// for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(5 + 16*count, resolution.getScaledHeight(), 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15, resolution.getScaledHeight() - 45 + 16 * count, 16777215); -// if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5 + 16*count, resolution.getScaledHeight(), 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15, resolution.getScaledHeight() - 45 + 16 * count, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 16*count, resolution.getScaledHeight() - 50, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/e0bfffad9ce3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/e0bfffad9ce3001412c4c4819c88e86b new file mode 100644 index 0000000..9104ba3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/e0bfffad9ce3001412c4c4819c88e86b @@ -0,0 +1,33 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + EntityLiving target = ((EntityLiving)midas.target); + target.hurtTime = 0; + float yaw = target.prevRotationYawHead + (target.rotationYawHead - target.prevRotationYawHead); + float yawOffset = target.prevRenderYawOffset + (target.renderYawOffset - target.prevRenderYawOffset); + float pitch = target.prevRotationPitch + (target.rotationPitch - target.prevRotationPitch); +// GL11.glRotatef(yawOffset, 0, -1, 0); +// GL11.glRotatef(pitch, 0, 0, -1); + GL11.glTranslatef(0.5F, 0.0F, 0.5F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + GL11.glRotatef(yaw - 90, 0, 1, 0); + RenderManager.instance.renderEntityWithPosYaw(target, midas.xCoord - RenderManager.instance.renderPosX, midas.yCoord - RenderManager.instance.renderPosY, midas.zCoord - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/401fb0e42ae60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/401fb0e42ae60014127dc373d78c1666 new file mode 100644 index 0000000..c9f5309 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/401fb0e42ae60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (()!(Loader.isModLoaded("TConstruct")) && t instanceof InventoryTabVanilla) || !t.enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (()!(Loader.isModLoaded("TConstruct")) && tab instanceof InventoryTabVanilla) || !tab.enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/c05809292ee60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/c05809292ee60014127dc373d78c1666 new file mode 100644 index 0000000..d77aff5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/c05809292ee60014127dc373d78c1666 @@ -0,0 +1,580 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.*; +import net.minecraft.client.renderer.tileentity.*; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.*; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.*; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glPushMatrix(); + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + GL11.glPopMatrix(); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + RenderHelper.enableStandardItemLighting(); + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); +// RenderHelper.disableStandardItemLighting(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d07c98730ade00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d07c98730ade00141043c3025ec60dfc deleted file mode 100644 index 5f2a423..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d07c98730ade00141043c3025ec60dfc +++ /dev/null @@ -1,185 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d07f51f1e1e50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d07f51f1e1e50014109ec019d2f6c0dc new file mode 100644 index 0000000..d88b3d3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d07f51f1e1e50014109ec019d2f6c0dc @@ -0,0 +1,60 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffffff; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) + if(JewelryNBT.item(stack).getItem() instanceof ItemFood) list.add(EnumChatFormatting.DARK_PURPLE + "It's made of metal. How are you suppose to eat this?"); + else list.add(EnumChatFormatting.DARK_PURPLE + "Shiny, but useless :("); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/20ea69c702e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/20ea69c702e50014174fe663e69b8422 new file mode 100644 index 0000000..7babda2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/20ea69c702e50014174fe663e69b8422 @@ -0,0 +1,57 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(0); + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/3020e4818ee3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/3020e4818ee3001417b2e384bf7c3702 new file mode 100644 index 0000000..a274f20 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/3020e4818ee3001417b2e384bf7c3702 @@ -0,0 +1,82 @@ +package darkknight.jewelrycraft.tileentity; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityMidasTouch extends TileEntity +{ + public Entity target; + + public TileEntityMidasTouch(Entity target) + { + this.target = target; + } + + /** + * @param nbt + */ + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + NBTTagCompound tag = new NBTTagCompound(); + target.writeToNBT(tag); + int id = EntityList.getEntityID(target); + nbt.setInteger("entityID", id); + nbt.setTag("entity", tag); + } + + /** + * @param nbt + */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + if (nbt.hasKey("entityID") && nbt.hasKey("entity")){ + NBTTagCompound en = (NBTTagCompound)nbt.getTag("entity"); + int entityID = nbt.getInteger("entityID"); + EntityLivingBase entity = (EntityLivingBase)EntityList.createEntityByID(entityID, worldObj); + entity.readFromNBT(en); + target = entity; + } + } + + /** + * + */ + @Override + public void updateEntity() + { + super.updateEntity(); + System.out.println(target); + } + + /** + * @return + */ + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + /** + * @param net + * @param packet + */ + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + readFromNBT(packet.func_148857_g()); + worldObj.func_147479_m(xCoord, yCoord, zCoord); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/5060e6c998e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/5060e6c998e3001412c4c4819c88e86b new file mode 100644 index 0000000..784d37e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/5060e6c998e3001412c4c4819c88e86b @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; +// System.out.println(midas.target.rotationYaw); + GL11.glRotatef(midas.target.rotationYaw, 0.0F, 1.0F, 0.0F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.target.posX - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/a0c899f616e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/a0c899f616e60014127dc373d78c1666 new file mode 100644 index 0000000..ae4561c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/a0c899f616e60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.*; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.*; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.*; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.*; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glPushMatrix(); + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + GL11.glPopMatrix(); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c078df6404de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c078df6404de00141043c3025ec60dfc deleted file mode 100644 index fa07b7e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c078df6404de00141043c3025ec60dfc +++ /dev/null @@ -1,278 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (active && target != null && this.getDistanceFrom(target.posX, target.posY, target.posZ) > 27D){ - active = false; - timer = -1; - } - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - else if(pedestal != null && target != null) JewelrycraftUtil.addCursePoints(target, 20); - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/40a922fbcddf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/40a922fbcddf00141dc6c962aec96210 deleted file mode 100644 index 67c996f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/40a922fbcddf00141dc6c962aec96210 +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ); - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 140, 1)); - // Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(500) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - if (jewelry instanceof ItemRing && exists && rand.nextInt(200) == 12){ - // Negative ring - Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.0F); - // Positive ring - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/5029f1a804de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/5029f1a804de00141043c3025ec60dfc deleted file mode 100644 index efc4169..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/5029f1a804de00141043c3025ec60dfc +++ /dev/null @@ -1,278 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (active && target != null && this.getDistanceFrom(target.posX, target.posY, target.posZ) > 30D){ - active = false; - timer = -1; - } - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(10D, 10D, 10D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(10D, 10D, 10D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - else if(pedestal != null && target != null) JewelrycraftUtil.addCursePoints(target, 20); - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/800cb89f9ce3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/800cb89f9ce3001412c4c4819c88e86b new file mode 100644 index 0000000..10bf6e3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/800cb89f9ce3001412c4c4819c88e86b @@ -0,0 +1,33 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + EntityLiving target = ((EntityLiving)midas.target); + target.hurtTime = 0; + float yaw = target.prevRotationYawHead + (target.rotationYawHead - target.prevRotationYawHead); + float yawOffset = target.prevRenderYawOffset + (target.renderYawOffset - target.prevRenderYawOffset); + float pitch = target.prevRotationPitch + (target.rotationPitch - target.prevRotationPitch); +// GL11.glRotatef(yawOffset, 0, -1, 0); +// GL11.glRotatef(yaw - 90, 0, 1, 0); + GL11.glRotatef(pitch, 0, 0, -1); + GL11.glTranslatef(0.5F, 0.0F, 0.5F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(target, midas.xCoord - RenderManager.instance.renderPosX, midas.yCoord - RenderManager.instance.renderPosY, midas.zCoord - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10c90e0b09e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10c90e0b09e60014127dc373d78c1666 new file mode 100644 index 0000000..1360b73 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10c90e0b09e60014127dc373d78c1666 @@ -0,0 +1,61 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + ((JewelryNBT.item(stack) != null) ? + JewelryNBT.item(stack).getDisplayName() : "Object"); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) + if(JewelryNBT.item(stack).getItem() instanceof ItemFood) list.add(EnumChatFormatting.DARK_PURPLE + "It's made of solid gold. How are you suppose to eat this?"); + else list.add(EnumChatFormatting.DARK_PURPLE + "Shiny, but useless :("); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/407a4588cadf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/407a4588cadf00141dc6c962aec96210 deleted file mode 100644 index f33178e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/407a4588cadf00141dc6c962aec96210 +++ /dev/null @@ -1,96 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if (rand.nextInt(3) == 0 && (arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0)) arrow.setDead(); - } - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists){ - if (player.motionY < 0) player.motionY *= 0.6D; -// player.capabilities.setPlayerWalkSpeed(0.1F); -// player.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.001D); - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80, 1)); - player.fallDistance = 0F; - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - // Positive ring - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/40f3d19e91e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/40f3d19e91e3001417b2e384bf7c3702 new file mode 100644 index 0000000..75b0e69 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/40f3d19e91e3001417b2e384bf7c3702 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 0.8F, 0.0F); + RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, 0D, 0D, 0D, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/70816d6f94e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/70816d6f94e3001412c4c4819c88e86b new file mode 100644 index 0000000..f7e9cc2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/70816d6f94e3001412c4c4819c88e86b @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/c05f30bd25e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/c05f30bd25e60014127dc373d78c1666 new file mode 100644 index 0000000..6a6830d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/c05f30bd25e60014127dc373d78c1666 @@ -0,0 +1,24 @@ +package main.java.tconstruct.client.tabs; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class InventoryTabVanilla extends AbstractTab +{ + public InventoryTabVanilla() + { + super(0, 0, 0, new ItemStack(Blocks.crafting_table)); + } + + @Override + public void onTabClicked () + { + TabRegistry.openInventoryGui(); + } + + @Override + public boolean shouldAddToList () + { + return true; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/90359fe194e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/90359fe194e3001412c4c4819c88e86b new file mode 100644 index 0000000..9c492f3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/90359fe194e3001412c4c4819c88e86b @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntity tile = world.getTileEntity(x, y, z); + if(((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.boundingBox); + this.setBlockBounds((float)((TileEntityMidasTouch)tile).target.boundingBox.minX, (float)((TileEntityMidasTouch)tile).target.boundingBox.minY, (float)((TileEntityMidasTouch)tile).target.boundingBox.minZ, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxX, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxY, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxZ); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/a045419026e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/a045419026e60014127dc373d78c1666 new file mode 100644 index 0000000..a22052c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/a045419026e60014127dc373d78c1666 @@ -0,0 +1,97 @@ +package darkknight.jewelrycraft.proxy; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.VillagerRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.gui.InventoryTabVanilla; +import darkknight.jewelrycraft.client.gui.TabRegistry; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.entities.renders.HeartRender; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.render.ItemRender; +import darkknight.jewelrycraft.model.ModelDisplayer; +import darkknight.jewelrycraft.model.ModelHalfHeart; +import darkknight.jewelrycraft.model.ModelHandPedestal; +import darkknight.jewelrycraft.model.ModelHeart; +import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; +import darkknight.jewelrycraft.model.ModelMolder; +import darkknight.jewelrycraft.model.ModelShadowEye; +import darkknight.jewelrycraft.model.ModelShadowHand; +import darkknight.jewelrycraft.model.ModelSmelter; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMidasTouchRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/ShadowHand.png"); + TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMidasTouch.class, new TileEntityMidasTouchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); + + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); + MinecraftForgeClient.registerItemRenderer(ItemList.goldObj, new ItemRender()); + + VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation(Variables.MODID, "textures/entities/jeweler.png")); + + RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); + + if (!Loader.isModLoaded("TConstruct") && TabRegistry.getTabList().size() < 1) TabRegistry.registerTab(new InventoryTabVanilla()); + TabRegistry.registerTab(new TabJewelry()); + MinecraftForge.EVENT_BUS.register(new TabRegistry()); + MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); + ResourceLocation jeweleryTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/50be335402e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/50be335402e50014174fe663e69b8422 new file mode 100644 index 0000000..bcc6cff --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/50be335402e50014174fe663e69b8422 @@ -0,0 +1,56 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) if (Block.getBlockFromItem(item.getItem()) != Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return Block.getBlockFromItem(item.getItem()).getIcon(0, 0); + else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/d0d224852ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/d0d224852ce60014127dc373d78c1666 new file mode 100644 index 0000000..62c625e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/d0d224852ce60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla)){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/f0632658c0e50014122af9ad4a560236 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/f0632658c0e50014122af9ad4a560236 new file mode 100644 index 0000000..4628831 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/f0632658c0e50014122af9ad4a560236 @@ -0,0 +1,55 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30f9e59108de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30f9e59108de00141043c3025ec60dfc deleted file mode 100644 index 7faaa17..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30f9e59108de00141043c3025ec60dfc +++ /dev/null @@ -1,184 +0,0 @@ -package darkknight.jewelrycraft.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = ingotColor >> 16 & 0xff; - int green = ingotColor >> 8 & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/e0ff939e02e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/e0ff939e02e60014127dc373d78c1666 new file mode 100644 index 0000000..dc8b81f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/e0ff939e02e60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + setHarvestLevel("ItemPickaxe.class", 2); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 0; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/0065cfc101e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/0065cfc101e50014174fe663e69b8422 new file mode 100644 index 0000000..27f3bbc --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/0065cfc101e50014174fe663e69b8422 @@ -0,0 +1,53 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && Item.getIdFromItem(curItem.getItem()) > 0){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/40b159950ade00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/40b159950ade00141043c3025ec60dfc deleted file mode 100644 index b276345..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/40b159950ade00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int alpha = (ingotColor >> 24) & 0xff; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor4f((float)red / 255, (float)green / 255, (float)blue / 255, (float)alpha / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/a004e1a8c3e50014122af9ad4a560236 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/a004e1a8c3e50014122af9ad4a560236 new file mode 100644 index 0000000..b7ad32e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/a004e1a8c3e50014122af9ad4a560236 @@ -0,0 +1,55 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { +// ItemStack curItem = player.inventory.getCurrentItem(); +// if(curItem != null && curItem.getItem() != ItemList.goldObj){ +// int index = player.inventory.currentItem; +// ItemStack item = curItem; +// ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); +// JewelryNBT.addItem(result, item); +// player.inventory.setInventorySlotContents(index, result); +// } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/f045b1c8fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/f045b1c8fce40014174fe663e69b8422 new file mode 100644 index 0000000..bb0a4a6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/f045b1c8fce40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static Item ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/8023076d28de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/8023076d28de00141043c3025ec60dfc deleted file mode 100644 index 3a08f3c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/8023076d28de00141043c3025ec60dfc +++ /dev/null @@ -1,465 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss() && playerInfo.getInteger("cursePoints") > 0){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/d0336393dee50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/d0336393dee50014109ec019d2f6c0dc new file mode 100644 index 0000000..1c5451a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/d0336393dee50014109ec019d2f6c0dc @@ -0,0 +1,93 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/d0d1c7060cde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/d0d1c7060cde00141043c3025ec60dfc deleted file mode 100644 index b81fb7c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/d0d1c7060cde00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; -// System.out.println(red + " " + green + " " + blue); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glColorMask(true, false, true, true); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/507f105a2ede00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/507f105a2ede00141043c3025ec60dfc deleted file mode 100644 index 52da51e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/507f105a2ede00141043c3025ec60dfc +++ /dev/null @@ -1,109 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ -// for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); -// if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/c01a61492ede00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/c01a61492ede00141043c3025ec60dfc deleted file mode 100644 index f9979fc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/c01a61492ede00141043c3025ec60dfc +++ /dev/null @@ -1,109 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ -// for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(5 + 24*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 24*count, resolution.getScaledHeight() - 20, 16777215); -// if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5 + 24*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 24*count, resolution.getScaledHeight() - 20, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 24*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/204cfa240ade00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/204cfa240ade00141043c3025ec60dfc deleted file mode 100644 index 6dc7a84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/204cfa240ade00141043c3025ec60dfc +++ /dev/null @@ -1,185 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int red = ingotColor >> 16 & 0xff; - int green = ingotColor >> 8 & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/a0890abe02de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/a0890abe02de00141043c3025ec60dfc deleted file mode 100644 index 7e13246..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/a0890abe02de00141043c3025ec60dfc +++ /dev/null @@ -1,272 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/d03963b82ede00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/d03963b82ede00141043c3025ec60dfc deleted file mode 100644 index 59c1a5b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/d03963b82ede00141043c3025ec60dfc +++ /dev/null @@ -1,108 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.entities; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; - -/** - * @author Sorin - */ -public class EntityHeart extends EntityLiving -{ - public EntityHeart(World world) - { - super(world); - this.setSize(0.4F, 0.4F); - } - - public boolean isEntityInvulnerable() - { - return true; - } - - protected boolean canDespawn() - { - return false; - } - - @Override - public void onCollideWithPlayer(EntityPlayer player) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (getType() == "Red" && player.getHealth() < player.getMaxHealth()){ - player.heal(2f); - this.setDead(); - } - else if (getType() != "Red" && playerInfo.getFloat(getType() + "Heart") < 20f){ - playerInfo.setFloat(getType() + "Heart", playerInfo.getFloat(getType() + "Heart") + 2.0F <= 20f ? playerInfo.getFloat(getType() + "Heart") + 2.0F : 20f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - this.setDead(); - } - } - - @Override - protected void updateEntityActionState() - { - } - - @SideOnly(Side.CLIENT) - public boolean canRenderOnFire() - { - return false; - } - - protected void entityInit() - { - super.entityInit(); - this.dataWatcher.addObject(16, "Red"); - } - - public void writeEntityToNBT(NBTTagCompound nbt) - { - super.writeEntityToNBT(nbt); - nbt.setString("Type", getType()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - public void readEntityFromNBT(NBTTagCompound nbt) - { - super.readEntityFromNBT(nbt); - setType(nbt.getString("Type")); - } - - public String getType() - { - return this.dataWatcher.getWatchableObjectString(16); - } - - public void setType(String type) - { - this.dataWatcher.updateObject(16, type); - } - - public EnumCreatureAttribute getCreatureAttribute() - { - return EnumCreatureAttribute.UNDEAD; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/009346bd26de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/009346bd26de00141043c3025ec60dfc deleted file mode 100644 index 29e66f2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/009346bd26de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(20, 20 + (size + 20) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/a0662de901e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/a0662de901e60014127dc373d78c1666 new file mode 100644 index 0000000..b42d356 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/a0662de901e60014127dc373d78c1666 @@ -0,0 +1,41 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.block.BlockMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +/** + * @author Sorin + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + // System.out.println("Broken " + event.getResult()); + ItemStack item = event.getPlayer().inventory.getCurrentItem(); + if (event.block instanceof BlockMidasTouch && item != null && item.getItem().canHarvestBlock(event.block, item)){ + System.out.println(event.block.getHarvestLevel(event.blockMetadata) + " " + item.getItem().getHarvestLevel(item, "ItemPickaxe.class")); + TileEntityMidasTouch te = (TileEntityMidasTouch)event.world.getTileEntity(event.x, event.y, event.z); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + } + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/c06ac17c09de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/c06ac17c09de00141043c3025ec60dfc deleted file mode 100644 index ffd2967..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/c06ac17c09de00141043c3025ec60dfc +++ /dev/null @@ -1,184 +0,0 @@ -package darkknight.jewelrycraft.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int red = ingotColor >> 16 & 0xff; - int green = ingotColor >> 8 & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/206e9fbfdce50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/206e9fbfdce50014109ec019d2f6c0dc new file mode 100644 index 0000000..3266aca --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/206e9fbfdce50014109ec019d2f6c0dc @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.*; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.*; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget ") || currItem.getItem().getUnlocalizedName().toLowerCase().contains(" nugget")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot ") || currItem.getItem().getUnlocalizedName().toLowerCase().contains(" ingot")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/90070fc8cfdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/90070fc8cfdf00141dc6c962aec96210 deleted file mode 100644 index 565997b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/90070fc8cfdf00141dc6c962aec96210 +++ /dev/null @@ -1,102 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); -// if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(95, 5 + (size + 10) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); -// } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/d0ebb9bd98e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/d0ebb9bd98e3001412c4c4819c88e86b new file mode 100644 index 0000000..0f5b2aa --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/d0ebb9bd98e3001412c4c4819c88e86b @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; +// GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; +// System.out.println(midas.target.rotationYaw); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.target.posX - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/1063c37f8ee3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/1063c37f8ee3001417b2e384bf7c3702 new file mode 100644 index 0000000..d115403 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/1063c37f8ee3001417b2e384bf7c3702 @@ -0,0 +1,83 @@ +package darkknight.jewelrycraft.tileentity; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityMidasTouch extends TileEntity +{ + public Entity target; + + public TileEntityMidasTouch(Entity target) + { + this.target = target; + } + + /** + * @param nbt + */ + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + NBTTagCompound tag = new NBTTagCompound(); + target.writeToNBT(tag); + int id = EntityList.getEntityID(target); + nbt.setInteger("entityID", id); + nbt.setTag("entity", tag); + } + + /** + * @param nbt + */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + if (nbt.hasKey("entityID") && nbt.hasKey("entity")){ + NBTTagCompound en = (NBTTagCompound)nbt.getTag("entity"); + int entityID = nbt.getInteger("entityID"); + EntityLivingBase entity = (EntityLivingBase)EntityList.createEntityByID(entityID, worldObj); + if (entity != null && entity instanceof EntityLivingBase){ + entity.readFromNBT(en); + target = entity; + } + } + } + + /** + * + */ + @Override + public void updateEntity() + { + super.updateEntity(); + } + + /** + * @return + */ + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + /** + * @param net + * @param packet + */ + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + readFromNBT(packet.func_148857_g()); + worldObj.func_147479_m(xCoord, yCoord, zCoord); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/30591b0b27de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/30591b0b27de00141043c3025ec60dfc deleted file mode 100644 index 8335c2c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/30591b0b27de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 12 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/600230f8fde50014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/600230f8fde50014127dc373d78c1666 new file mode 100644 index 0000000..0cdeb96 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/600230f8fde50014127dc373d78c1666 @@ -0,0 +1,193 @@ +/* + * Mod made by DarkKnight during the Modjam 3 + * It's an awesome mod + * I love me! :D + */ +package darkknight.jewelrycraft; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Logger; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; +import cpw.mods.fml.relauncher.Side; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.gui.GuiHandler; +import darkknight.jewelrycraft.commands.JewelrycraftCommands; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.curses.CurseList; +import darkknight.jewelrycraft.damage.DamageSourceList; +import darkknight.jewelrycraft.effects.EffectsList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.events.BucketHandler; +import darkknight.jewelrycraft.events.EntityEventHandler; +import darkknight.jewelrycraft.events.KeyBindings; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketClearColorCache; +import darkknight.jewelrycraft.network.PacketKeyPressEvent; +import darkknight.jewelrycraft.network.PacketRequestLiquidData; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; +import darkknight.jewelrycraft.network.PacketRequestSetSlot; +import darkknight.jewelrycraft.network.PacketSendCurseStats; +import darkknight.jewelrycraft.network.PacketSendLiquidData; +import darkknight.jewelrycraft.network.PacketSendPlayerInfo; +import darkknight.jewelrycraft.proxy.CommonProxy; +import darkknight.jewelrycraft.recipes.CraftingRecipes; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; +import darkknight.jewelrycraft.worldGen.Generation; +import darkknight.jewelrycraft.worldGen.village.ComponentJewelry; +import darkknight.jewelrycraft.worldGen.village.JCTrades; +import darkknight.jewelrycraft.worldGen.village.VillageJewelryHandler; + +@Mod (modid = Variables.MODID, name = Variables.MODNAME, version = Variables.VERSION, guiFactory = Variables.CONFIG_GUI) +public class JewelrycraftMod +{ + @Instance (Variables.MODID) + public static JewelrycraftMod instance; + + @SidedProxy (clientSide = Variables.CLIENT_PROXY, serverSide = Variables.SERVER_PROXY) + public static CommonProxy proxy; + public static final Logger logger = Logger.getLogger("Jewelrycraft"); + public static File dir; + + public static CreativeTabs jewelrycraft = new CreativeTabs(Variables.MODID){ + @Override + public Item getTabIconItem() + { + return Item.getItemFromBlock(BlockList.jewelCraftingTable); + } + }; + + public static CreativeTabs liquids = new CreativeTabLiquids("Liquids"); + public static NBTTagCompound saveData = new NBTTagCompound(); + public static NBTTagCompound clientData = new NBTTagCompound(); + public static File liquidsConf; + public static SimpleNetworkWrapper netWrapper; + public static boolean fancyRender; + + /** + * Pre initialization of mod stuff. + * + * @param e FMLPreInitializationEvent + * @throws IOException Signals that an I/O exception has occurred. + */ + @EventHandler + public void preInit(FMLPreInitializationEvent e) throws IOException + { + ConfigHandler.INSTANCE.loadConfig(e); + BlockList.preInit(e); + ItemList.preInit(e); + CraftingRecipes.preInit(e); + CurseList.preInit(e); + OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot)); + OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre)); + VillagerRegistry.instance().registerVillagerId(3000); + VillagerRegistry.instance().registerVillageTradeHandler(3000, new JCTrades()); + VillagerRegistry.instance().registerVillageCreationHandler(new VillageJewelryHandler()); + try{ + MapGenStructureIO.func_143031_a(ComponentJewelry.class, Variables.MODID + ":Jewelry"); + } + catch(Throwable e2){ + logger.severe("Error registering Jewelrycraft Structures with Vanilla Minecraft: this is expected in versions earlier than 1.7.10"); + } + MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); + MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE); + BucketHandler.INSTANCE.buckets.put(BlockList.moltenMetal, ItemList.bucket); + + ModMetadata metadata = e.getModMetadata(); + List authorList = new ArrayList(); + + authorList.add("OnyxDarkKnight"); + authorList.add("bspkrs"); + authorList.add("domi1819"); + + dir = e.getModConfigurationDirectory(); + proxy.preInit(); + netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Variables.MODID); + netWrapper.registerMessage(PacketRequestLiquidData.class, PacketRequestLiquidData.class, 0, Side.SERVER); + netWrapper.registerMessage(PacketSendLiquidData.class, PacketSendLiquidData.class, 1, Side.CLIENT); + netWrapper.registerMessage(PacketClearColorCache.class, PacketClearColorCache.class, 2, Side.CLIENT); + netWrapper.registerMessage(PacketKeyPressEvent.class, PacketKeyPressEvent.class, 3, Side.SERVER); + netWrapper.registerMessage(PacketRequestPlayerInfo.class, PacketRequestPlayerInfo.class, 4, Side.SERVER); + netWrapper.registerMessage(PacketSendPlayerInfo.class, PacketSendPlayerInfo.class, 5, Side.CLIENT); + netWrapper.registerMessage(PacketSendCurseStats.class, PacketSendCurseStats.class, 6, Side.CLIENT); + netWrapper.registerMessage(PacketRequestSetSlot.class, PacketRequestSetSlot.class, 7, Side.SERVER); + + metadata.autogenerated = false; + metadata.authorList = authorList; + metadata.url = "https://github.com/sor1n/Jewelrycraft"; + + createEntity(EntityHeart.class, Variables.MODID + ".Heart", 0xFF0000, 0xFF0000, false); + createEntity(EntityHalfHeart.class, Variables.MODID + ".Half-Heart", 0x000000, 0xFF0000, false); + + } + + public void createEntity(Class entity, String entityName, int solidColor, int spotColor, boolean hasSpawnEgg) + { + int randomID = EntityRegistry.findGlobalUniqueEntityId(); + if(hasSpawnEgg) EntityRegistry.registerGlobalEntityID(entity, entityName, randomID, solidColor, spotColor); + else EntityRegistry.registerGlobalEntityID(entity, entityName, randomID); + EntityRegistry.registerModEntity(entity, entityName, randomID, this, 40, 3, true); + } + + /** + * Initializes the world generation and key bindings. + * + * @param e FMLInitializationEvent + */ + @EventHandler + public void init(FMLInitializationEvent e) + { + GameRegistry.registerWorldGenerator(new Generation(), 0); + if (FMLCommonHandler.instance().getSide() == Side.CLIENT) FMLCommonHandler.instance().bus().register(new KeyBindings()); + new GuiHandler(); + FMLCommonHandler.instance().bus().register(ConfigHandler.INSTANCE); + } + + /** + * Post initialization of metals, modifiers and others. + * + * @param e FMLPostInitializationEvent + */ + @EventHandler + public void postInit(FMLPostInitializationEvent e) + { + JewelrycraftUtil.addMetals(); + JewelrycraftUtil.jamcrafters(); + EffectsList.postInit(e); + DamageSourceList.postInit(e); + proxy.postInit(); + } + + @Mod.EventHandler + public void serverLoad(FMLServerStartingEvent event) + { + event.registerServerCommand(new JewelrycraftCommands()); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/702cdaf0ccdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/702cdaf0ccdf00141dc6c962aec96210 deleted file mode 100644 index a860652..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/702cdaf0ccdf00141dc6c962aec96210 +++ /dev/null @@ -1,82 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - //Positive earrings - enderman.setTarget(null); - //Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2)); - } - } - } - //Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ); - } - } - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 140, 1)); - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(500) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30)*(rand.nextBoolean()?-1:1), player.posY, player.posZ + rand.nextInt(30)*(rand.nextBoolean()?-1:1)); - if (jewelry instanceof ItemRing && exists && rand.nextInt(200) == 12){ - Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.0F); - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if(player.worldObj.getBlock(i, j, k) instanceof BlockOre) - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/706f7de52ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/706f7de52ce60014127dc373d78c1666 new file mode 100644 index 0000000..b18d2f0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/706f7de52ce60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2 - ((t instanceof TabJewelry)?2:0)) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/80f33350c9df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/80f33350c9df00141dc6c962aec96210 deleted file mode 100644 index a44d088..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/80f33350c9df00141dc6c962aec96210 +++ /dev/null @@ -1,93 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectBlazePowder extends ModifierEffects -{ - public EffectBlazePowder() - { - super(new ItemStack(Items.blaze_powder)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemNecklace && exists){ - // Positive for necklace - if (player.isBurning() && rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) player.extinguish(); - // Negative for necklace - if (player.isInWater()) player.attackEntityFrom(DamageSource.drown, 1f + (JewelryNBT.numberOfModifiers(item) - 1) * 0.1F); - } - // Negative for bracelet - if (jewelry instanceof ItemBracelet && exists && player.isInWater()){ - double slowAmount = 0.6D + (JewelryNBT.numberOfModifiers(item) - 1)*0.05D; - player.motionX *= slowAmount; - player.motionY *= slowAmount; - player.motionZ *= slowAmount; - player.motionY -= 0.02D; - if (player.isCollidedHorizontally) player.motionY = 0.30000001192092896D; - } - // Negative for earrings - if (jewelry instanceof ItemEarrings && exists){ - if (player.getAir() >= 300) player.setAir(player.getAir() / 2); - else player.setAir(player.getAir() - 1); - } - } - - @Override - public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Balanced for ring - if (jewelry instanceof ItemRing && exists && !player.isInWater()) target.setFire(2); - return false; - } - - @Override - public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - // int pos = JewelryNBT.doesModifierExist(item, modifier); - // if (jewelry instanceof ItemEarrings && pos != -1 && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){ - // //Positive for earrings - // int stackSize = JewelryNBT.modifier(item).get(pos).stackSize; - // player.heal((float)(0.05 * stackSize)); - // return true; - // } - // //Positive for bracelet - // if (jewelry instanceof ItemBracelet && pos != -1) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) return true; - return false; - } - - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - {} - - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (jewelry instanceof ItemEarrings && exists && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){ - // Positive for earrings - int stackSize = JewelryNBT.modifierSize(item, modifier); - player.heal((float)(0.05 * stackSize)); - playerInfo.setBoolean("negateDamage", true); - } - // Positive for bracelet - if (jewelry instanceof ItemBracelet && exists) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) playerInfo.setBoolean("negateDamage", true); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/502eece29ce3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/502eece29ce3001412c4c4819c88e86b new file mode 100644 index 0000000..7a096a0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/502eece29ce3001412c4c4819c88e86b @@ -0,0 +1,95 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 0; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public void breakBlock(World world, int i, int j, int k, Block par5, int par6) + { + TileEntityMidasTouch te = (TileEntityMidasTouch)world.getTileEntity(i, j, k); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + System.out.println("drop"); + super.breakBlock(world, i, j, k, par5, par6); + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/8018e58904e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/8018e58904e50014174fe663e69b8422 new file mode 100644 index 0000000..fc804c3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/8018e58904e50014174fe663e69b8422 @@ -0,0 +1,61 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + System.out.println(Block.getBlockFromItem(item.getItem())); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else{ +// System.out.println(Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1)); + return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1); + } + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/c0bee05e02e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/c0bee05e02e50014174fe663e69b8422 new file mode 100644 index 0000000..de7a378 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/c0bee05e02e50014174fe663e69b8422 @@ -0,0 +1,56 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(0); + else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/d0413c3339e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/d0413c3339e100141e1cc3c3be242e56 new file mode 100644 index 0000000..93ba6f0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/d0413c3339e100141e1cc3c3be242e56 @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static int RITUAL_TIME; + + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int MAX_VILLAGE_JEWELERS; + public static int JEWELER_WEIGHT; + public static int INGOT_CHEST_MIN; + public static int INGOT_CHEST_MAX; + public static int INGOT_CHEST_MAX_STACK; + public static int GEM_CHEST_MIN; + public static int GEM_CHEST_MAX; + public static int FURNACE_MIN_INGOT_STACK; + public static int FURNACE_MAX_INGOT_STACK; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + JEWELER_WEIGHT = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + INGOT_CHEST_MIN = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX_STACK = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + GEM_CHEST_MIN = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + GEM_CHEST_MAX = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + FURNACE_MIN_INGOT_STACK = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + FURNACE_MAX_INGOT_STACK = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/e0b3c0d50bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/e0b3c0d50bde00141043c3025ec60dfc deleted file mode 100644 index af2621b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/e0b3c0d50bde00141043c3025ec60dfc +++ /dev/null @@ -1,185 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - System.out.println(red + " " + green + " " + blue); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/f076514d01e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/f076514d01e50014174fe663e69b8422 new file mode 100644 index 0000000..022932b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/f076514d01e50014174fe663e69b8422 @@ -0,0 +1,55 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null && Block.getBlockFromItem(item.getItem()) != null) + return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/30cad6710ee60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/30cad6710ee60014127dc373d78c1666 new file mode 100644 index 0000000..a2a6da7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/30cad6710ee60014127dc373d78c1666 @@ -0,0 +1,94 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockCompressed; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("nugget ")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("ingot ")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockCompressed) return new ItemStack(Blocks.gold_block, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/40551ae474e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/40551ae474e300141084bb8bfb075c08 new file mode 100644 index 0000000..5a1aaa7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/40551ae474e300141084bb8bfb075c08 @@ -0,0 +1,37 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart)){ + target.setDead(); + world.setBlock((int)target.posX, (int)target.posY, (int)target.posZ, BlockList.midasTouchBlock, 0, 2); + TileEntity midasTouchVictim = new TileEntityMidasTouch(target); + world.setTileEntity((int)target.posX, (int)target.posY, (int)target.posZ, midasTouchVictim); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/705ae70e2ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/705ae70e2ce60014127dc373d78c1666 new file mode 100644 index 0000000..59537aa --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/705ae70e2ce60014127dc373d78c1666 @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + System.out.println(t.visible); + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla)){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla)) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/9054945503de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/9054945503de00141043c3025ec60dfc deleted file mode 100644 index 3bece77..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/9054945503de00141043c3025ec60dfc +++ /dev/null @@ -1,94 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && pos != -1){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if (rand.nextInt(3) == 0 && (arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0)) arrow.setDead(); - } - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && pos != -1){ - if (player.motionY < 0) player.motionY *= 0.6D; -// player.capabilities.setPlayerWalkSpeed(0.05F); -// player.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.001D); - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80, 1)); - player.fallDistance = 0F; - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && pos != -1 && enemyData.getInteger("reAttacked") == 0){ - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (jewelry instanceof ItemNecklace && pos != -1 && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && pos != -1 && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a011af0c03e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a011af0c03e50014174fe663e69b8422 new file mode 100644 index 0000000..6f6d33d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a011af0c03e50014174fe663e69b8422 @@ -0,0 +1,57 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return Block.getBlockFromItem(item.getItem()).getIcon(16, 16); + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a0a1c6429ae3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a0a1c6429ae3001412c4c4819c88e86b new file mode 100644 index 0000000..10f313b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a0a1c6429ae3001412c4c4819c88e86b @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + + int count = quantityDropped(metadata, fortune, world.rand); + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) ret.add(new ItemStack(Items.gold_nugget, (int)(((TileEntityMidasTouch)tile).target.width*((TileEntityMidasTouch)tile).target.height), 0)); + + return ret; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/10a8e852ffe40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/10a8e852ffe40014174fe663e69b8422 new file mode 100644 index 0000000..0cd13f7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/10a8e852ffe40014174fe663e69b8422 @@ -0,0 +1,51 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + if(player.inventory.getCurrentItem() != null && !player.inventory.getCurrentItem().getUnlocalizedName().contains("gold")){ + int index = player.inventory.currentItem; + ItemStack item = player.inventory.getCurrentItem(); + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/80c87259cadf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/80c87259cadf00141dc6c962aec96210 deleted file mode 100644 index 2fc513f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/80c87259cadf00141dc6c962aec96210 +++ /dev/null @@ -1,84 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectBlazePowder extends ModifierEffects -{ - public EffectBlazePowder() - { - super(new ItemStack(Items.blaze_powder)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemNecklace && exists){ - // Positive for necklace - if (player.isBurning() && rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) player.extinguish(); - // Negative for necklace - if (player.isInWater()) player.attackEntityFrom(DamageSource.drown, 1f + (JewelryNBT.numberOfModifiers(item) - 1) * 0.1F); - } - // Negative for bracelet - if (jewelry instanceof ItemBracelet && exists && player.isInWater()){ - double slowAmount = 0.6D + (JewelryNBT.numberOfModifiers(item) - 1)*0.05D; - player.motionX *= slowAmount; - player.motionY *= slowAmount; - player.motionZ *= slowAmount; - player.motionY -= (0.02D + (JewelryNBT.numberOfModifiers(item) - 1)*0.005D); - if (player.isCollidedHorizontally) player.motionY = 0.30000001192092896D; - } - // Negative for earrings - if (jewelry instanceof ItemEarrings && exists){ - if (player.getAir() >= 300) player.setAir(player.getAir() / 2); - else player.setAir(player.getAir() - JewelryNBT.numberOfModifiers(item)); - } - } - - @Override - public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Balanced for ring - if (jewelry instanceof ItemRing && exists && !player.isInWater() && rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) target.setFire(2); - return false; - } - - @Override - public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - return false; - } - - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - {} - - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (jewelry instanceof ItemEarrings && exists && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){ - // Positive for earrings - int stackSize = JewelryNBT.modifierSize(item, modifier); - player.heal((float)(0.05 * stackSize)); - playerInfo.setBoolean("negateDamage", true); - } - // Positive for bracelet - if (jewelry instanceof ItemBracelet && exists) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) playerInfo.setBoolean("negateDamage", true); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/f0fb303b0bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/f0fb303b0bde00141043c3025ec60dfc deleted file mode 100644 index e77a62e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/f0fb303b0bde00141043c3025ec60dfc +++ /dev/null @@ -1,185 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - System.out.println(red + " " + green + " " + blue); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/00f1323d0cde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/00f1323d0cde00141043c3025ec60dfc deleted file mode 100644 index 4b30290..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/00f1323d0cde00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; -// System.out.println(red + " " + green + " " + blue); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glColorMask(false, false, false, false); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/700e006d95e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/700e006d95e3001412c4c4819c88e86b new file mode 100644 index 0000000..be8080b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/700e006d95e3001412c4c4819c88e86b @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntity tile = world.getTileEntity(x, y, z); + if(((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.ySize); + this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/8040daa897e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/8040daa897e3001412c4c4819c88e86b new file mode 100644 index 0000000..433aee9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/8040daa897e3001412c4c4819c88e86b @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.width); + this.setBlockBounds(-((TileEntityMidasTouch)tile).target.width/2, 0F, -((TileEntityMidasTouch)tile).target.width/2, ((TileEntityMidasTouch)tile).target.width/2, ((TileEntityMidasTouch)tile).target.height, ((TileEntityMidasTouch)tile).target.width/2); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/90c73e68dfe50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/90c73e68dfe50014109ec019d2f6c0dc new file mode 100644 index 0000000..7a28167 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/90c73e68dfe50014109ec019d2f6c0dc @@ -0,0 +1,93 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("nugget ")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("ingot ")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/b02224c467dd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/b02224c467dd001412dce27813e7be4a deleted file mode 100644 index 9621bb4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/b02224c467dd001412dce27813e7be4a +++ /dev/null @@ -1,123 +0,0 @@ -package darkknight.jewelrycraft.events; - -import java.util.Iterator; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.entities.renders.RenderHelper; -import darkknight.jewelrycraft.item.render.BraceletRender; -import darkknight.jewelrycraft.item.render.EarringsRender; -import darkknight.jewelrycraft.item.render.MaskRender; -import darkknight.jewelrycraft.model.ModelBracelet; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class PlayerRenderHandler -{ - MaskRender mask = new MaskRender(); - EarringsRender earrings = new EarringsRender(); - BraceletRender bracelet = new BraceletRender(); - public static String[] infamyCache = new String[]{}; - - @SubscribeEvent - public void renderScreen(RenderPlayerEvent.Specials.Post event) - { - ModelBiped main = event.renderer.modelBipedMain; - Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); - if (infamyCache != null){ - while (players.hasNext()){ - EntityPlayer player = players.next(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - System.out.println(player + " | " + playerInfo); - if (checkPlayerInfamy(player.getDisplayName()) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){ - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(1.6f, 1.6f, 1.6f); - GL11.glTranslatef(-0.25F, -0.25F, -0.25F); - mask.doRender(event.entityPlayer, 0F, 0F, 0F, 0F, 0F); - GL11.glPopMatrix(); - } - if (playerInfo.hasKey("ext17") && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext17"); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(0.07f, 0.07f, 0.07f); - GL11.glTranslatef(0.0F, 3.0F, -2.0F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - earrings.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - GL11.glPopMatrix(); - } - for(int i = 10; i <= 13; i++) - if (playerInfo.hasKey("ext" + i) && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glTranslatef((i / 12 == 1) ? -0.275F : 0.475F, 0.2F + ((i / 12 == 1) ? (i - 12) * 0.08F : (i - 10) * 0.08F), 0F); - if (player.isSneaking()) GL11.glTranslatef(0F, 0F, -((i == 10 || i == 12) ? (0.1F) : 0.05F)); - if (i / 12 == 1){ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedRightArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0.0F); - }else{ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedLeftArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - } - GL11.glPopMatrix(); - } - } - } - } - - /** - * @param string - * @return - */ - private boolean checkPlayerInfamy(String string) - { - for(int i = 0; i < infamyCache.length; i++) - if (infamyCache[i].equals(string)) return true; - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/1001cf0b72e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/1001cf0b72e300141084bb8bfb075c08 new file mode 100644 index 0000000..a806253 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/1001cf0b72e300141084bb8bfb075c08 @@ -0,0 +1,36 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && !(target instanceof EntityMob) && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart)){ + target.setDead(); + world.setBlock(target.posX, target.posY, target.posZ, BlockList.midasTouchBlock, 0, 2); + TileEntity midasTouchVictim = new TileEntityMidasTouch(); + world.setTileEntity(p_147455_1_, p_147455_2_, p_147455_3_, p_147455_4_); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/408da85a08e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/408da85a08e60014127dc373d78c1666 new file mode 100644 index 0000000..cddb4c3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/408da85a08e60014127dc373d78c1666 @@ -0,0 +1,60 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack) != null?JewelryNBT.item(stack).getDisplayName():"Object"; + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) + if(JewelryNBT.item(stack).getItem() instanceof ItemFood) list.add(EnumChatFormatting.DARK_PURPLE + "It's made of metal. How are you suppose to eat this?"); + else list.add(EnumChatFormatting.DARK_PURPLE + "Shiny, but useless :("); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/801db51c37e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/801db51c37e100141e1cc3c3be242e56 new file mode 100644 index 0000000..9af71a0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/801db51c37e100141e1cc3c3be242e56 @@ -0,0 +1,454 @@ +package darkknight.jewelrycraft.worldGen.village; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureVillagePieces; +import net.minecraft.world.gen.structure.StructureVillagePieces.Start; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.ItemMolds; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class ComponentJewelry extends StructureVillagePieces.House1 +{ + private int averageGroundLevel = -1; + + /** + * + */ + public ComponentJewelry() + {} + + /** + * @param par1ComponentVillageStartPiece + * @param par2 + * @param par3Random + * @param par4StructureBoundingBox + * @param par5 + */ + public ComponentJewelry(Start par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) + { + super(); + coordBaseMode = par5; + boundingBox = par4StructureBoundingBox; + } + + /** + * @param villagePiece + * @param pieces + * @param random + * @param p1 + * @param p2 + * @param p3 + * @param p4 + * @param p5 + * @return + */ + @SuppressWarnings ("rawtypes") + public static ComponentJewelry buildComponent(Start villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 11, 5, 12, p4); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentJewelry(villagePiece, p5, random, structureboundingbox, p4) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the end, it adds Fences... + * + * @param world + * @param random + * @param sbb + * @return + */ + @Override + public boolean addComponentParts(World world, Random random, StructureBoundingBox sbb) + { + if (averageGroundLevel < 0){ + averageGroundLevel = getAverageGroundLevel(world, sbb); + if (averageGroundLevel < 0) return true; + boundingBox.offset(0, averageGroundLevel - boundingBox.maxY + 3, 0); + } + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace) + */ + fillWithBlocks(world, sbb, 0, 0, 6, 10, 5, 11, Block.getBlockById(0), Block.getBlockById(0), false); + fillWithBlocks(world, sbb, 2, 0, 0, 8, 5, 5, Block.getBlockById(0), Block.getBlockById(0), false); + // Pillars + fillWithBlocks(world, sbb, 2, 0, 0, 2, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 2, 0, 3, 2, 3, 3, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 0, 8, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 3, 8, 3, 3, Blocks.log, Blocks.log, false); + // Walls + fillWithBlocks(world, sbb, 2, 0, 1, 2, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 2, 0, 4, 2, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 1, 8, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 4, 8, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 3, 0, 0, 7, 3, 0, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 3, 6, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 11, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 6, 0, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 10, 0, 6, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + // Roof + for(int i = 3; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 2, i, 4, j, sbb); + for(int i = 3; i <= 7; i++) + for(int j = 6; j <= 6; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, i, 4, j, sbb); + for(int i = 1; i <= 9; i++) + for(int j = 7; j <= 10; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 3, i, 4, j, sbb); + for(int i = 2; i <= 8; i++) + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, i, 4, 0, sbb); + for(int i = 1; i <= 5; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 2, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 8, 4, i, sbb); + } + for(int i = 0; i <= 2; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 6, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i + 8, 4, 6, sbb); + } + for(int i = 7; i <= 11; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 0, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 10, 4, i, sbb); + } + for(int i = 0; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 11, sbb); + // Base + for(int i = 2; i <= 8; i++) + for(int j = 0; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.planks, 1, i, 0, j, sbb); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 0, 11, Blocks.stonebrick, Blocks.stonebrick, false); + for(int i = 6; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 5, 0, i, sbb); + for(int i = 7; i <= 10; i++){ + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 1, 0, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 9, 0, i, sbb); + } + // Decorations + placeDoorAtCurrentPosition(world, sbb, random, 6, 1, 0, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeDoorAtCurrentPosition(world, sbb, random, 5, 1, 6, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 3, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 4, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 3, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 3, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 7, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 7, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 10, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 9, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 9, sbb); + int bgCarpetColor = random.nextInt(16); + for(int i = 4; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.carpet, bgCarpetColor, i, 1, j, sbb); + generateChest(world, 3, 1, 1, 0, random, sbb, ConfigHandler.jewelsChestMin, ConfigHandler.jewelsChestMax); + generateDisplayer(world, 3, 1, 2, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + placeBlockAtCurrentPosition(world, BlockList.jewelCraftingTable, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, 3, 1, 3, sbb); + generateDisplayer(world, 3, 1, 4, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + generateChest(world, 3, 1, 5, 0, random, sbb, ConfigHandler.jewelsChestMin, ConfigHandler.jewelsChestMax); + generateFurnace(world, 1, 1, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 1, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateSmelter(world, 1, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateSmelter(world, 1, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateMolder(world, 2, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + generateMolder(world, 2, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + for(int l = 0; l < 6; ++l) + for(int i1 = 2; i1 < 9; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + for(int l = 6; l < 12; ++l) + for(int i1 = 0; i1 < 11; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + spawnVillagers(world, sbb, 3, 1, 3, 1); + return true; + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + */ + public void generateChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, Blocks.chest, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + ItemStack jewels = JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size())); + chest.func_145976_a("Jeweler's Chest"); + if (jewels.getItem() == Items.nether_star && ConfigHandler.GENERATE_VILLAGE_NETHERSTAR) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + else if (random.nextBoolean() && jewels.getItem() != Items.nether_star) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateIngotChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ingot Chest"); + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), metal); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateOresChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ores Chest"); + int oreID = random.nextInt(JewelrycraftUtil.ores.size()); + ItemStack ores = JewelrycraftUtil.ores.get(oreID).copy(); + ores.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), ores); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + */ + public void generateDisplayer(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.displayer, metadata, i, j, k, sbb); + TileEntityDisplayer displayer = (TileEntityDisplayer)world.getTileEntity(i1, j1, k1); + if (displayer != null){ + Item[] jewels = {ItemList.ring, ItemList.necklace}; + ItemStack jewel = new ItemStack(jewels[random.nextInt(jewels.length)]); + JewelryNBT.addMetal(jewel, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()))); + JewelryNBT.addModifiers(jewel, JewelrycraftUtil.addRandomModifiers(random.nextInt(4))); + JewelryNBT.addGem(jewel, JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size()))); + displayer.object = jewel; + displayer.quantity = 1; + displayer.hasObject = true; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param isEmpty + */ + public void generateSmelter(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean isEmpty) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.smelter, metadata, i, j, k, sbb); + TileEntitySmelter smelter = (TileEntitySmelter)world.getTileEntity(i1, j1, k1); + if (smelter != null && !isEmpty){ + int metal = random.nextInt(JewelrycraftUtil.metal.size()); + smelter.moltenMetal = JewelrycraftUtil.metal.get(metal).copy(); + smelter.hasMoltenMetal = true; + int quantity = random.nextInt(9); + switch(quantity) + { + case 0: + smelter.quantity = 0.1f; + case 1: + smelter.quantity = 0.2f; + case 2: + smelter.quantity = 0.3f; + case 3: + smelter.quantity = 0.4f; + case 4: + smelter.quantity = 0.5f; + case 5: + smelter.quantity = 0.6f; + case 6: + smelter.quantity = 0.7f; + case 7: + smelter.quantity = 0.8f; + case 8: + smelter.quantity = 0.9f; + default: + smelter.quantity = 0.1f; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param hasMold + * @param hasStuff + */ + public void generateMolder(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean hasMold, boolean hasStuff) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.molder, metadata, i, j, k, sbb); + TileEntityMolder molder = (TileEntityMolder)world.getTileEntity(i1, j1, k1); + if (molder != null && !molder.hasMold) if (hasMold){ + int meta = random.nextInt(ItemMolds.moldsItemNames.length); + molder.mold = new ItemStack(ItemList.molds, 1, meta); + molder.hasMold = true; + if (hasStuff){ + ItemStack ring = new ItemStack(ItemList.ring); + JewelryNBT.addMetal(ring, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack necklace = new ItemStack(ItemList.necklace); + JewelryNBT.addMetal(necklace, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack bracelet = new ItemStack(ItemList.bracelet); + JewelryNBT.addMetal(bracelet, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack earrings = new ItemStack(ItemList.earrings); + JewelryNBT.addMetal(earrings, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + if (meta == 0) molder.jewelBase = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())); + else if (meta == 1) molder.jewelBase = ring; + else if (meta == 2) molder.jewelBase = necklace; + else if (meta == 3) molder.jewelBase = bracelet; + else if (meta == 4) molder.jewelBase = earrings; + molder.hasJewelBase = true; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param hasMetal + */ + public void generateFurnace(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, boolean hasMetal) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, Blocks.furnace, metadata, i, j, k, sbb); + TileEntityFurnace furnace = (TileEntityFurnace)world.getTileEntity(i1, j1, k1); + if (furnace != null){ + if (random.nextBoolean()) furnace.setInventorySlotContents(1, new ItemStack(Items.coal, 1 + random.nextInt(16))); + if (hasMetal){ + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = random.nextInt(max - min + 1) + min; + furnace.setInventorySlotContents(2, metal); + } + } + } + + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + * + * @param par1 + * @return + */ + @Override + protected int getVillagerType(int par1) + { + return 3000; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/80909a0b36e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/80909a0b36e100141e1cc3c3be242e56 new file mode 100644 index 0000000..b9e4d59 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/80909a0b36e100141e1cc3c3be242e56 @@ -0,0 +1,63 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int ingotCoolingTime; + public static int ingotMeltingTime; + public static int jewelryCraftingTime; + public static boolean generateVillageNetherstar; + public static boolean canFurnacesGenerateIngots; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + ingotCoolingTime = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + ingotMeltingTime = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + jewelryCraftingTime = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + generateVillageNetherstar = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + canFurnacesGenerateIngots = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + maxVillageJewelers = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + jewelerWeight = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + ingotChestMin = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMax = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/809dbb21fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/809dbb21fde40014174fe663e69b8422 new file mode 100644 index 0000000..0a8aba6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/809dbb21fde40014174fe663e69b8422 @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/40cc91f125e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/40cc91f125e60014127dc373d78c1666 new file mode 100644 index 0000000..331abb3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/40cc91f125e60014127dc373d78c1666 @@ -0,0 +1,28 @@ +package darkknight.jewelrycraft.client; + +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketKeyPressEvent; +import main.java.tconstruct.client.tabs.AbstractTab; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class TabJewelry extends AbstractTab +{ + public TabJewelry() + { + super(0, 0, 0, new ItemStack(ItemList.necklace)); + } + + @Override + public void onTabClicked () + { + JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(0)); + } + + @Override + public boolean shouldAddToList () + { + return true; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/00835d83fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/00835d83fde40014174fe663e69b8422 new file mode 100644 index 0000000..e1e37b4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/00835d83fde40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + public static Item goldifiedObject; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + goldifiedObject = new ItemGoldObject().setUnlocalizedName(Variables.MODID + ".goldObject"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a0449c8093e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a0449c8093e3001412c4c4819c88e86b new file mode 100644 index 0000000..6377c0b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a0449c8093e3001412c4c4819c88e86b @@ -0,0 +1,84 @@ +package darkknight.jewelrycraft.tileentity; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityMidasTouch extends TileEntity +{ + public Entity target; + + public TileEntityMidasTouch() + {} + + public void setEntity(Entity ent) + { + target = ent; + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + if (target != null){ + int id = EntityList.getEntityID(target); + NBTTagCompound tag = new NBTTagCompound(); + target.writeToNBT(tag); + nbt.setInteger("entityID", id); + nbt.setTag("entity", tag); + } + System.out.println("Write: " + nbt); + } + + /** + * @param nbt + */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + System.out.println("Read: " + nbt); + NBTTagCompound en = (NBTTagCompound)nbt.getTag("entity"); + int entityID = nbt.getInteger("entityID"); + EntityLivingBase entity = (EntityLivingBase)EntityList.createEntityByID(entityID, worldObj); + entity.readFromNBT(en); + target = entity; + } + + /** + * + */ + @Override + public void updateEntity() + { + super.updateEntity(); + // System.out.println(target); + } + + /** + * @return + */ + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + /** + * @param net + * @param packet + */ + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + readFromNBT(packet.func_148857_g()); + worldObj.func_147479_m(xCoord, yCoord, zCoord); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a046bebfcfdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a046bebfcfdf00141dc6c962aec96210 deleted file mode 100644 index fe6cb38..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a046bebfcfdf00141dc6c962aec96210 +++ /dev/null @@ -1,102 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); -// if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(100, 5 + (size + 10) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); -// } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/f0a4797968dd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/f0a4797968dd001412dce27813e7be4a deleted file mode 100644 index 02de1d7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/f0a4797968dd001412dce27813e7be4a +++ /dev/null @@ -1,123 +0,0 @@ -package darkknight.jewelrycraft.events; - -import java.util.Iterator; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.entities.renders.RenderHelper; -import darkknight.jewelrycraft.item.render.BraceletRender; -import darkknight.jewelrycraft.item.render.EarringsRender; -import darkknight.jewelrycraft.item.render.MaskRender; -import darkknight.jewelrycraft.model.ModelBracelet; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class PlayerRenderHandler -{ - MaskRender mask = new MaskRender(); - EarringsRender earrings = new EarringsRender(); - BraceletRender bracelet = new BraceletRender(); - public static String[] infamyCache = new String[]{}; - - @SubscribeEvent - public void renderScreen(RenderPlayerEvent.Specials.Post event) - { - ModelBiped main = event.renderer.modelBipedMain; - Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); - if (infamyCache != null){ - while (players.hasNext()){ - EntityPlayer player = players.next(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); -// System.out.println(event.entityPlayer + " | " + player + " | " + playerInfo); - if (checkPlayerInfamy(player.getDisplayName()) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){ - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(1.6f, 1.6f, 1.6f); - GL11.glTranslatef(-0.25F, -0.25F, -0.25F); - mask.doRender(event.entityPlayer, 0F, 0F, 0F, 0F, 0F); - GL11.glPopMatrix(); - } - if (playerInfo.hasKey("ext17") && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext17"); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(0.07f, 0.07f, 0.07f); - GL11.glTranslatef(0.0F, 3.0F, -2.0F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - earrings.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - GL11.glPopMatrix(); - } - for(int i = 10; i <= 13; i++) - if (playerInfo.hasKey("ext" + i) && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glTranslatef((i / 12 == 1) ? -0.275F : 0.475F, 0.2F + ((i / 12 == 1) ? (i - 12) * 0.08F : (i - 10) * 0.08F), 0F); - if (player.isSneaking()) GL11.glTranslatef(0F, 0F, -((i == 10 || i == 12) ? (0.1F) : 0.05F)); - if (i / 12 == 1){ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedRightArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0.0F); - }else{ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedLeftArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - } - GL11.glPopMatrix(); - } - } - } - } - - /** - * @param string - * @return - */ - private boolean checkPlayerInfamy(String string) - { - for(int i = 0; i < infamyCache.length; i++) - if (infamyCache[i].equals(string)) return true; - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/70d2e64cfae40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/70d2e64cfae40014174fe663e69b8422 new file mode 100644 index 0000000..e69de29 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/b0690d9a2be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/b0690d9a2be60014127dc373d78c1666 new file mode 100644 index 0000000..486f204 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/b0690d9a2be60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!tabList.get(1).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/10543334ffe40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/10543334ffe40014174fe663e69b8422 new file mode 100644 index 0000000..a60c79e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/10543334ffe40014174fe663e69b8422 @@ -0,0 +1,51 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + if(player.inventory.getCurrentItem() != null){ + int index = player.inventory.currentItem; + ItemStack item = player.inventory.getCurrentItem(); + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/80707ccf26de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/80707ccf26de00141043c3025ec60dfc deleted file mode 100644 index 7bf9867..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/80707ccf26de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/a012e7fa2ae60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/a012e7fa2ae60014127dc373d78c1666 new file mode 100644 index 0000000..80015c3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/a012e7fa2ae60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || t.enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || tab.enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/60061e9571e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/60061e9571e300141084bb8bfb075c08 new file mode 100644 index 0000000..fb394c0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/60061e9571e300141084bb8bfb075c08 @@ -0,0 +1,72 @@ +package darkknight.jewelrycraft.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.tileentity.TileEntityAltar; +import darkknight.jewelrycraft.tileentity.TileEntityBlockShadow; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.Variables; + +public class BlockList +{ + public static Block shadowOre, smelter, molder, displayer, jewelCraftingTable, shadowBlock, shadowEye, jewelAltar, handPedestal, shadowHand, midasTouchBlock; + public static BlockMoltenMetal moltenMetal; + public static Fluid moltenMetalFluid; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + shadowOre = new BlockJCOre().setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockTextureName(Variables.MODID + ":oreShadow").setBlockName(Variables.MODID + ".oreShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + smelter = new BlockSmelter().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".smelter").setCreativeTab(JewelrycraftMod.jewelrycraft); + molder = new BlockMolder(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".molder").setCreativeTab(JewelrycraftMod.jewelrycraft); + displayer = new BlockDisplayer(Material.iron).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypeMetal).setBlockName(Variables.MODID + ".displayer").setCreativeTab(JewelrycraftMod.jewelrycraft); + jewelCraftingTable = new BlockJewelrsCraftingTable(Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".jewelCraftingTable").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowBlock = new BlockShadow().setHardness(5.0F).setResistance(7.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName(Variables.MODID + ":blockShadow").setBlockName(Variables.MODID + ".blockShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + jewelAltar = new BlockJewelAltar().setHardness(5.0F).setResistance(2.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName(Variables.MODID + ":altar").setBlockName(Variables.MODID + ".altar").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowEye = new BlockShadowEye().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".shadowEye").setCreativeTab(JewelrycraftMod.jewelrycraft); + handPedestal = new BlockHandPedestal(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".handPedestal").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowHand = new BlockShadowHand(Material.rock).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".shadowHand").setCreativeTab(JewelrycraftMod.jewelrycraft).setBlockUnbreakable(); + midasTouchBlock = new BlockMidasTouch(Material.iron).setHardness(3.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal).setBlockName(Variables.MODID + ".midasTouchBlock").setCreativeTab(JewelrycraftMod.jewelrycraft); + + GameRegistry.registerBlock(shadowOre, "shadowOre"); + GameRegistry.registerBlock(shadowBlock, "shadowBlock"); + GameRegistry.registerBlock(smelter, "Smelter"); + GameRegistry.registerBlock(molder, "Molder"); + GameRegistry.registerBlock(jewelCraftingTable, "jewelCraftingTable"); + GameRegistry.registerBlock(displayer, "Displayer"); + GameRegistry.registerBlock(jewelAltar, "Altar"); + GameRegistry.registerBlock(shadowEye, "Shadow Eye"); + GameRegistry.registerBlock(handPedestal, "Stone Bricks Pedestal"); + GameRegistry.registerBlock(shadowHand, "Shadow Hand"); + GameRegistry.registerTileEntity(TileEntitySmelter.class, Variables.MODID + ":smelter"); + GameRegistry.registerTileEntity(TileEntityMolder.class, Variables.MODID + ":molder"); + GameRegistry.registerTileEntity(TileEntityJewelrsCraftingTable.class, Variables.MODID + ":table"); + GameRegistry.registerTileEntity(TileEntityDisplayer.class, Variables.MODID + ":displayer"); + GameRegistry.registerTileEntity(TileEntityBlockShadow.class, Variables.MODID + ":blockShadow"); + GameRegistry.registerTileEntity(TileEntityAltar.class, Variables.MODID + ":altar"); + GameRegistry.registerTileEntity(TileEntityShadowEye.class, Variables.MODID + ":shadowEye"); + GameRegistry.registerTileEntity(TileEntityHandPedestal.class, Variables.MODID + ":handPedestal"); + GameRegistry.registerTileEntity(TileEntityShadowHand.class, Variables.MODID + ":shadowHand"); + moltenMetalFluid = new Fluid("metal.molten").setLuminosity(15).setDensity(3000).setTemperature(2000).setViscosity(6000); + if (!FluidRegistry.registerFluid(moltenMetalFluid)) moltenMetalFluid = FluidRegistry.getFluid("metal.molten"); + moltenMetal = new BlockMoltenMetal(moltenMetalFluid, Material.lava); + GameRegistry.registerBlock(moltenMetal, "moltenMetalLiquid"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/80a334f7dee50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/80a334f7dee50014109ec019d2f6c0dc new file mode 100644 index 0000000..8a30566 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/80a334f7dee50014109ec019d2f6c0dc @@ -0,0 +1,93 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("ingot ")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c0574f9791e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c0574f9791e3001417b2e384bf7c3702 new file mode 100644 index 0000000..5e6d882 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c0574f9791e3001417b2e384bf7c3702 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1F, 1.0F, 0.0F); + RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, 0D, 0D, 0D, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/1087a1e902e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/1087a1e902e50014174fe663e69b8422 new file mode 100644 index 0000000..9afe44f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/1087a1e902e50014174fe663e69b8422 @@ -0,0 +1,57 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); +// else return Block.getBlockFromItem(item.getItem()).getIcon(6, 6); + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/30500e3137e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/30500e3137e100141e1cc3c3be242e56 new file mode 100644 index 0000000..786b68b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/30500e3137e100141e1cc3c3be242e56 @@ -0,0 +1,454 @@ +package darkknight.jewelrycraft.worldGen.village; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureVillagePieces; +import net.minecraft.world.gen.structure.StructureVillagePieces.Start; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.ItemMolds; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class ComponentJewelry extends StructureVillagePieces.House1 +{ + private int averageGroundLevel = -1; + + /** + * + */ + public ComponentJewelry() + {} + + /** + * @param par1ComponentVillageStartPiece + * @param par2 + * @param par3Random + * @param par4StructureBoundingBox + * @param par5 + */ + public ComponentJewelry(Start par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) + { + super(); + coordBaseMode = par5; + boundingBox = par4StructureBoundingBox; + } + + /** + * @param villagePiece + * @param pieces + * @param random + * @param p1 + * @param p2 + * @param p3 + * @param p4 + * @param p5 + * @return + */ + @SuppressWarnings ("rawtypes") + public static ComponentJewelry buildComponent(Start villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 11, 5, 12, p4); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentJewelry(villagePiece, p5, random, structureboundingbox, p4) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the end, it adds Fences... + * + * @param world + * @param random + * @param sbb + * @return + */ + @Override + public boolean addComponentParts(World world, Random random, StructureBoundingBox sbb) + { + if (averageGroundLevel < 0){ + averageGroundLevel = getAverageGroundLevel(world, sbb); + if (averageGroundLevel < 0) return true; + boundingBox.offset(0, averageGroundLevel - boundingBox.maxY + 3, 0); + } + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace) + */ + fillWithBlocks(world, sbb, 0, 0, 6, 10, 5, 11, Block.getBlockById(0), Block.getBlockById(0), false); + fillWithBlocks(world, sbb, 2, 0, 0, 8, 5, 5, Block.getBlockById(0), Block.getBlockById(0), false); + // Pillars + fillWithBlocks(world, sbb, 2, 0, 0, 2, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 2, 0, 3, 2, 3, 3, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 0, 8, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 3, 8, 3, 3, Blocks.log, Blocks.log, false); + // Walls + fillWithBlocks(world, sbb, 2, 0, 1, 2, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 2, 0, 4, 2, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 1, 8, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 4, 8, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 3, 0, 0, 7, 3, 0, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 3, 6, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 11, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 6, 0, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 10, 0, 6, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + // Roof + for(int i = 3; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 2, i, 4, j, sbb); + for(int i = 3; i <= 7; i++) + for(int j = 6; j <= 6; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, i, 4, j, sbb); + for(int i = 1; i <= 9; i++) + for(int j = 7; j <= 10; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 3, i, 4, j, sbb); + for(int i = 2; i <= 8; i++) + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, i, 4, 0, sbb); + for(int i = 1; i <= 5; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 2, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 8, 4, i, sbb); + } + for(int i = 0; i <= 2; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 6, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i + 8, 4, 6, sbb); + } + for(int i = 7; i <= 11; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 0, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 10, 4, i, sbb); + } + for(int i = 0; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 11, sbb); + // Base + for(int i = 2; i <= 8; i++) + for(int j = 0; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.planks, 1, i, 0, j, sbb); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 0, 11, Blocks.stonebrick, Blocks.stonebrick, false); + for(int i = 6; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 5, 0, i, sbb); + for(int i = 7; i <= 10; i++){ + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 1, 0, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 9, 0, i, sbb); + } + // Decorations + placeDoorAtCurrentPosition(world, sbb, random, 6, 1, 0, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeDoorAtCurrentPosition(world, sbb, random, 5, 1, 6, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 3, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 4, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 3, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 3, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 7, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 7, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 10, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 9, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 9, sbb); + int bgCarpetColor = random.nextInt(16); + for(int i = 4; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.carpet, bgCarpetColor, i, 1, j, sbb); + generateChest(world, 3, 1, 1, 0, random, sbb, ConfigHandler.GEM_CHEST_MIN, ConfigHandler.GEM_CHEST_MAX); + generateDisplayer(world, 3, 1, 2, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + placeBlockAtCurrentPosition(world, BlockList.jewelCraftingTable, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, 3, 1, 3, sbb); + generateDisplayer(world, 3, 1, 4, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + generateChest(world, 3, 1, 5, 0, random, sbb, ConfigHandler.GEM_CHEST_MIN, ConfigHandler.GEM_CHEST_MAX); + generateFurnace(world, 1, 1, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 1, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateSmelter(world, 1, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateSmelter(world, 1, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateMolder(world, 2, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + generateMolder(world, 2, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + for(int l = 0; l < 6; ++l) + for(int i1 = 2; i1 < 9; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + for(int l = 6; l < 12; ++l) + for(int i1 = 0; i1 < 11; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + spawnVillagers(world, sbb, 3, 1, 3, 1); + return true; + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + */ + public void generateChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, Blocks.chest, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + ItemStack jewels = JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size())); + chest.func_145976_a("Jeweler's Chest"); + if (jewels.getItem() == Items.nether_star && ConfigHandler.GENERATE_VILLAGE_NETHERSTAR) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + else if (random.nextBoolean() && jewels.getItem() != Items.nether_star) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateIngotChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ingot Chest"); + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), metal); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateOresChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ores Chest"); + int oreID = random.nextInt(JewelrycraftUtil.ores.size()); + ItemStack ores = JewelrycraftUtil.ores.get(oreID).copy(); + ores.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), ores); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + */ + public void generateDisplayer(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.displayer, metadata, i, j, k, sbb); + TileEntityDisplayer displayer = (TileEntityDisplayer)world.getTileEntity(i1, j1, k1); + if (displayer != null){ + Item[] jewels = {ItemList.ring, ItemList.necklace}; + ItemStack jewel = new ItemStack(jewels[random.nextInt(jewels.length)]); + JewelryNBT.addMetal(jewel, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()))); + JewelryNBT.addModifiers(jewel, JewelrycraftUtil.addRandomModifiers(random.nextInt(4))); + JewelryNBT.addGem(jewel, JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size()))); + displayer.object = jewel; + displayer.quantity = 1; + displayer.hasObject = true; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param isEmpty + */ + public void generateSmelter(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean isEmpty) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.smelter, metadata, i, j, k, sbb); + TileEntitySmelter smelter = (TileEntitySmelter)world.getTileEntity(i1, j1, k1); + if (smelter != null && !isEmpty){ + int metal = random.nextInt(JewelrycraftUtil.metal.size()); + smelter.moltenMetal = JewelrycraftUtil.metal.get(metal).copy(); + smelter.hasMoltenMetal = true; + int quantity = random.nextInt(9); + switch(quantity) + { + case 0: + smelter.quantity = 0.1f; + case 1: + smelter.quantity = 0.2f; + case 2: + smelter.quantity = 0.3f; + case 3: + smelter.quantity = 0.4f; + case 4: + smelter.quantity = 0.5f; + case 5: + smelter.quantity = 0.6f; + case 6: + smelter.quantity = 0.7f; + case 7: + smelter.quantity = 0.8f; + case 8: + smelter.quantity = 0.9f; + default: + smelter.quantity = 0.1f; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param hasMold + * @param hasStuff + */ + public void generateMolder(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean hasMold, boolean hasStuff) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.molder, metadata, i, j, k, sbb); + TileEntityMolder molder = (TileEntityMolder)world.getTileEntity(i1, j1, k1); + if (molder != null && !molder.hasMold) if (hasMold){ + int meta = random.nextInt(ItemMolds.moldsItemNames.length); + molder.mold = new ItemStack(ItemList.molds, 1, meta); + molder.hasMold = true; + if (hasStuff){ + ItemStack ring = new ItemStack(ItemList.ring); + JewelryNBT.addMetal(ring, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack necklace = new ItemStack(ItemList.necklace); + JewelryNBT.addMetal(necklace, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack bracelet = new ItemStack(ItemList.bracelet); + JewelryNBT.addMetal(bracelet, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack earrings = new ItemStack(ItemList.earrings); + JewelryNBT.addMetal(earrings, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + if (meta == 0) molder.jewelBase = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())); + else if (meta == 1) molder.jewelBase = ring; + else if (meta == 2) molder.jewelBase = necklace; + else if (meta == 3) molder.jewelBase = bracelet; + else if (meta == 4) molder.jewelBase = earrings; + molder.hasJewelBase = true; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param hasMetal + */ + public void generateFurnace(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, boolean hasMetal) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, Blocks.furnace, metadata, i, j, k, sbb); + TileEntityFurnace furnace = (TileEntityFurnace)world.getTileEntity(i1, j1, k1); + if (furnace != null){ + if (random.nextBoolean()) furnace.setInventorySlotContents(1, new ItemStack(Items.coal, 1 + random.nextInt(16))); + if (hasMetal){ + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = random.nextInt(max - min + 1) + min; + furnace.setInventorySlotContents(2, metal); + } + } + } + + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + * + * @param par1 + * @return + */ + @Override + protected int getVillagerType(int par1) + { + return 3000; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/90d70d9e10e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/90d70d9e10e60014127dc373d78c1666 new file mode 100644 index 0000000..8205de2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/90d70d9e10e60014127dc373d78c1666 @@ -0,0 +1,585 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.3F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/c0e5f1d298e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/c0e5f1d298e3001412c4c4819c88e86b new file mode 100644 index 0000000..2c50af8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/c0e5f1d298e3001412c4c4819c88e86b @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; +// System.out.println(midas.target.rotationYaw); + GL11.glRotatef(midas.target.rotationPitch, 0.0F, 1.0F, 0.0F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.target.posX - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/d04b715902e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/d04b715902e50014174fe663e69b8422 new file mode 100644 index 0000000..f13e940 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/d04b715902e50014174fe663e69b8422 @@ -0,0 +1,56 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return Block.getBlockFromItem(item.getItem()).getIcon(0, 0); + else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/902cfdee91e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/902cfdee91e3001417b2e384bf7c3702 new file mode 100644 index 0000000..e64f163 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/902cfdee91e3001417b2e384bf7c3702 @@ -0,0 +1,26 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, te.xCoord - Minecraft.getMinecraft().thePlayer.posX, te.yCoord - Minecraft.getMinecraft().thePlayer.posY, te.zCoord - Minecraft.getMinecraft().thePlayer.posZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/a02269c636e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/a02269c636e100141e1cc3c3be242e56 new file mode 100644 index 0000000..45a0130 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/a02269c636e100141e1cc3c3be242e56 @@ -0,0 +1,50 @@ +package darkknight.jewelrycraft.worldGen.village; + +import java.util.List; +import java.util.Random; +import net.minecraft.world.gen.structure.StructureVillagePieces.PieceWeight; +import net.minecraft.world.gen.structure.StructureVillagePieces.Start; +import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler; +import darkknight.jewelrycraft.config.ConfigHandler; + +public class VillageJewelryHandler implements IVillageCreationHandler +{ + + /** + * @param random + * @param i + * @return + */ + @Override + public PieceWeight getVillagePieceWeight(Random random, int i) + { + return new PieceWeight(ComponentJewelry.class, ConfigHandler.jewelerWeight, ConfigHandler.MAX_VILLAGE_JEWELERS); + } + + /** + * @return + */ + @Override + public Class getComponentClass() + { + return ComponentJewelry.class; + } + + /** + * @param villagePiece + * @param startPiece + * @param pieces + * @param random + * @param p1 + * @param p2 + * @param p3 + * @param p4 + * @param p5 + * @return + */ + @Override + public Object buildComponent(PieceWeight villagePiece, Start startPiece, @SuppressWarnings ("rawtypes") List pieces, Random random, int p1, int p2, int p3, int p4, int p5) + { + return ComponentJewelry.buildComponent(startPiece, pieces, random, p1, p2, p3, p4, p5); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e02cfa2c2ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e02cfa2c2ce60014127dc373d78c1666 new file mode 100644 index 0000000..fac0cca --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e02cfa2c2ce60014127dc373d78c1666 @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + System.out.println(tabList.get(1).enabled); + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla)){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla)) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e0673f4237e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e0673f4237e100141e1cc3c3be242e56 new file mode 100644 index 0000000..1fcdec5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e0673f4237e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int MAX_VILLAGE_JEWELERS; + public static int JEWELER_WEIGHT; + public static int INGOT_CHEST_MIN; + public static int INGOT_CHEST_MAX; + public static int INGOT_CHEST_MAX_STACK; + public static int GEM_CHEST_MIN; + public static int GEM_CHEST_MAX; + public static int FURNACE_MIN_INGOT_STACK; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + JEWELER_WEIGHT = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + INGOT_CHEST_MIN = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX_STACK = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + GEM_CHEST_MIN = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + GEM_CHEST_MAX = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + FURNACE_MIN_INGOT_STACK = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/20dad64f2ede00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/20dad64f2ede00141043c3025ec60dfc deleted file mode 100644 index ade208a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/20dad64f2ede00141043c3025ec60dfc +++ /dev/null @@ -1,109 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ -// for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 10, 16777215); -// if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 10, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/60d7e68b6edd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/60d7e68b6edd001412dce27813e7be4a deleted file mode 100644 index 62b7001..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/60d7e68b6edd001412dce27813e7be4a +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.entities; - -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * @author Sorin - */ -public class EntityHalfHeart extends EntityHeart -{ - public EntityHalfHeart(World world) - { - super(world); - } - - @Override - public void onCollideWithPlayer(EntityPlayer player) - { - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (getType().equals("Red") && player.getHealth() < player.getMaxHealth()){ - player.heal(1f); - this.setDead(); - }else if (getType().equals("White") && playerInfo.getFloat("WhiteHeart") > 0.1F){ - playerInfo.setFloat(getType() + "Heart", 0F); - player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() + 2f); - this.setDead(); - }else if (!getType().equals("Red") && playerInfo.getFloat(getType() + "Heart") < 20f){ - playerInfo.setFloat(getType() + "Heart", playerInfo.getFloat(getType() + "Heart") + 1.0F <= 20f ? playerInfo.getFloat(getType() + "Heart") + 1.0F : 20f); - this.setDead(); - } - } - else JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo(player)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/80e1a2afcbdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/80e1a2afcbdf00141dc6c962aec96210 deleted file mode 100644 index 8e3b83e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/80e1a2afcbdf00141dc6c962aec96210 +++ /dev/null @@ -1,97 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if ((arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0) && rand.nextInt(2 + JewelryNBT.numberOfModifiers(item)) == 0) arrow.setDead(); - } - } - } - - if (jewelry instanceof ItemBracelet && exists){ - // Positive bracelet - if (player.motionY < 0) player.motionY *= (0.6D + (JewelryNBT.numberOfModifiers(item) - 1)*0.03D); - // Negative bracelet - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80, 1)); - player.fallDistance = 0F; - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - // Negative ring - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - // Positive ring - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/a0dd791f2be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/a0dd791f2be60014127dc373d78c1666 new file mode 100644 index 0000000..760e13b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/a0dd791f2be60014127dc373d78c1666 @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); +// this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/60834d1d9ce3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/60834d1d9ce3001412c4c4819c88e86b new file mode 100644 index 0000000..973f460 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/60834d1d9ce3001412c4c4819c88e86b @@ -0,0 +1,26 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glTranslatef(0.5F, 0.0F, 0.5F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.xCoord - RenderManager.instance.renderPosX, midas.yCoord - RenderManager.instance.renderPosY, midas.zCoord - RenderManager.instance.renderPosZ, midas.target.rotationYaw, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/d03da29126de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/d03da29126de00141043c3025ec60dfc deleted file mode 100644 index 6594b4f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/d03da29126de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.5f, 0.5f, 0.0f); - drawTexturedModalRect(20, 10 + (size + 12) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/e089d7410fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/e089d7410fe60014127dc373d78c1666 new file mode 100644 index 0000000..ca6172a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/e089d7410fe60014127dc373d78c1666 @@ -0,0 +1,578 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(0.25F, 0.25F, 0.25F); + GL11.glRotatef(60f, 0f, 1f, 0f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/103378ed2ae60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/103378ed2ae60014127dc373d78c1666 new file mode 100644 index 0000000..628340b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/103378ed2ae60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if ((!(Loader.isModLoaded("TConstruct")) && t instanceof InventoryTabVanilla) || !t.enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if ((!(Loader.isModLoaded("TConstruct")) && tab instanceof InventoryTabVanilla) || !tab.enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/603b1e1d20e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/603b1e1d20e60014127dc373d78c1666 new file mode 100644 index 0000000..7f1dad2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/603b1e1d20e60014127dc373d78c1666 @@ -0,0 +1,94 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockCompressed; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); +// player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("nugget ")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("ingot ")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockCompressed) return new ItemStack(Blocks.gold_block, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/305762850fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/305762850fe60014127dc373d78c1666 new file mode 100644 index 0000000..b596034 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/305762850fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.6F); + GL11.glRotatef(75f, 0f, 1f, 0f); + GL11.glRotatef(-15f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/90636f1ffde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/90636f1ffde40014174fe663e69b8422 new file mode 100644 index 0000000..3293158 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/90636f1ffde40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/f0abd173d0df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/f0abd173d0df00141dc6c962aec96210 deleted file mode 100644 index 4c36593..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/f0abd173d0df00141dc6c962aec96210 +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2 + JewelryNBT.numberOfModifiers(item) / 4)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 150 - JewelryNBT.numberOfModifiers(item) * 10, 2 - JewelryNBT.numberOfModifiers(item) / 5)); - // Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(520 - JewelryNBT.numberOfModifiers(item) * 20) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - // Negative ring - if (jewelry instanceof ItemRing && exists) Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 2.2F - JewelryNBT.numberOfModifiers(item) * 0.1F); - // Positive ring - if (jewelry instanceof ItemRing && exists && rand.nextInt(180 + JewelryNBT.numberOfModifiers(item)*20) == 12){ - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100 + JewelryNBT.numberOfModifiers(item)*30, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/70b22b2507e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/70b22b2507e50014174fe663e69b8422 new file mode 100644 index 0000000..20da581 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/70b22b2507e50014174fe663e69b8422 @@ -0,0 +1,96 @@ +package darkknight.jewelrycraft.proxy; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.InventoryTabVanilla; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.TabRegistry; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.entities.renders.HeartRender; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.render.ItemRender; +import darkknight.jewelrycraft.model.ModelDisplayer; +import darkknight.jewelrycraft.model.ModelHalfHeart; +import darkknight.jewelrycraft.model.ModelHandPedestal; +import darkknight.jewelrycraft.model.ModelHeart; +import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; +import darkknight.jewelrycraft.model.ModelMolder; +import darkknight.jewelrycraft.model.ModelShadowEye; +import darkknight.jewelrycraft.model.ModelShadowHand; +import darkknight.jewelrycraft.model.ModelSmelter; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMidasTouchRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/ShadowHand.png"); + TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMidasTouch.class, new TileEntityMidasTouchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); + + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); + MinecraftForgeClient.registerItemRenderer(ItemList.goldObj, new ItemRender()); + + VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation(Variables.MODID, "textures/entities/jeweler.png")); + + RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); + + TabRegistry.registerTab(new InventoryTabVanilla()); + TabRegistry.registerTab(new TabJewelry()); + MinecraftForge.EVENT_BUS.register(new TabRegistry()); + MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); + ResourceLocation jeweleryTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/b096988c2be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/b096988c2be60014127dc373d78c1666 new file mode 100644 index 0000000..f5d2512 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/b096988c2be60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!tabList.get(0).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!tabList.get(0).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/1026e96300e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/1026e96300e60014127dc373d78c1666 new file mode 100644 index 0000000..b478b37 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/1026e96300e60014127dc373d78c1666 @@ -0,0 +1,40 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.block.BlockMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +/** + * @author Sorin + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + // System.out.println("Broken " + event.getResult()); + if (event.block instanceof BlockMidasTouch && event.getPlayer().inventory.getCurrentItem().getItem().canHarvestBlock(event.block, event.getPlayer().inventory.getCurrentItem())){ + TileEntityMidasTouch te = (TileEntityMidasTouch)event.world.getTileEntity(event.x, event.y, event.z); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + } + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/10e3c302dee50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/10e3c302dee50014109ec019d2f6c0dc new file mode 100644 index 0000000..4c976d2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/10e3c302dee50014109ec019d2f6c0dc @@ -0,0 +1,93 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget ") || currItem.getItem().getUnlocalizedName().toLowerCase().contains(" nugget")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || currItem.getItem().getUnlocalizedName().toLowerCase().contains(" ingot")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/30bcf87f94e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/30bcf87f94e3001412c4c4819c88e86b new file mode 100644 index 0000000..22da1c4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/30bcf87f94e3001412c4c4819c88e86b @@ -0,0 +1,71 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntity tile = world.getTileEntity(x, y, z); + this.setBlockBounds((float)((TileEntityMidasTouch)tile).target.boundingBox.minX, (float)((TileEntityMidasTouch)tile).target.boundingBox.minY, (float)((TileEntityMidasTouch)tile).target.boundingBox.minZ, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxX, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxY, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxZ); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/402c65f927e500141c50bd6848c69dc6 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/402c65f927e500141c50bd6848c69dc6 new file mode 100644 index 0000000..21961ed --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/402c65f927e500141c50bd6848c69dc6 @@ -0,0 +1,57 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/8029efd19de3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/8029efd19de3001412c4c4819c88e86b new file mode 100644 index 0000000..3361ee3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/8029efd19de3001412c4c4819c88e86b @@ -0,0 +1,77 @@ +package darkknight.jewelrycraft.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.tileentity.TileEntityAltar; +import darkknight.jewelrycraft.tileentity.TileEntityBlockShadow; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.Variables; + +public class BlockList +{ + public static Block shadowOre, smelter, molder, displayer, jewelCraftingTable, shadowBlock, shadowEye, jewelAltar, handPedestal, shadowHand, midasTouchBlock; + public static BlockMoltenMetal moltenMetal; + public static Fluid moltenMetalFluid; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + shadowOre = new BlockJCOre().setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockTextureName(Variables.MODID + ":oreShadow").setBlockName(Variables.MODID + ".oreShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + smelter = new BlockSmelter().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".smelter").setCreativeTab(JewelrycraftMod.jewelrycraft); + molder = new BlockMolder(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".molder").setCreativeTab(JewelrycraftMod.jewelrycraft); + displayer = new BlockDisplayer(Material.iron).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypeMetal).setBlockName(Variables.MODID + ".displayer").setCreativeTab(JewelrycraftMod.jewelrycraft); + jewelCraftingTable = new BlockJewelrsCraftingTable(Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".jewelCraftingTable").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowBlock = new BlockShadow().setHardness(5.0F).setResistance(7.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName(Variables.MODID + ":blockShadow").setBlockName(Variables.MODID + ".blockShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + jewelAltar = new BlockJewelAltar().setHardness(5.0F).setResistance(2.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName(Variables.MODID + ":altar").setBlockName(Variables.MODID + ".altar").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowEye = new BlockShadowEye().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".shadowEye").setCreativeTab(JewelrycraftMod.jewelrycraft); + handPedestal = new BlockHandPedestal(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".handPedestal").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowHand = new BlockShadowHand(Material.rock).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".shadowHand").setCreativeTab(JewelrycraftMod.jewelrycraft).setBlockUnbreakable(); + midasTouchBlock = new BlockMidasTouch(Material.iron).setHardness(3.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal).setBlockName(Variables.MODID + ".midasTouchBlock").setCreativeTab(JewelrycraftMod.jewelrycraft); + + GameRegistry.registerBlock(shadowOre, "shadowOre"); + GameRegistry.registerBlock(shadowBlock, "shadowBlock"); + GameRegistry.registerBlock(smelter, "Smelter"); + GameRegistry.registerBlock(molder, "Molder"); + GameRegistry.registerBlock(jewelCraftingTable, "jewelCraftingTable"); + GameRegistry.registerBlock(displayer, "Displayer"); + GameRegistry.registerBlock(jewelAltar, "Altar"); + GameRegistry.registerBlock(shadowEye, "Shadow Eye"); + GameRegistry.registerBlock(handPedestal, "Stone Bricks Pedestal"); + GameRegistry.registerBlock(shadowHand, "Shadow Hand"); + GameRegistry.registerBlock(midasTouchBlock, "Midas Touch Block"); + + GameRegistry.registerTileEntity(TileEntitySmelter.class, Variables.MODID + ":smelter"); + GameRegistry.registerTileEntity(TileEntityMolder.class, Variables.MODID + ":molder"); + GameRegistry.registerTileEntity(TileEntityJewelrsCraftingTable.class, Variables.MODID + ":table"); + GameRegistry.registerTileEntity(TileEntityDisplayer.class, Variables.MODID + ":displayer"); + GameRegistry.registerTileEntity(TileEntityBlockShadow.class, Variables.MODID + ":blockShadow"); + GameRegistry.registerTileEntity(TileEntityAltar.class, Variables.MODID + ":altar"); + GameRegistry.registerTileEntity(TileEntityShadowEye.class, Variables.MODID + ":shadowEye"); + GameRegistry.registerTileEntity(TileEntityHandPedestal.class, Variables.MODID + ":handPedestal"); + GameRegistry.registerTileEntity(TileEntityShadowHand.class, Variables.MODID + ":shadowHand"); + GameRegistry.registerTileEntity(TileEntityMidasTouch.class, Variables.MODID + ":midsaTouch"); + + moltenMetalFluid = new Fluid("metal.molten").setLuminosity(15).setDensity(3000).setTemperature(2000).setViscosity(6000); + if (!FluidRegistry.registerFluid(moltenMetalFluid)) moltenMetalFluid = FluidRegistry.getFluid("metal.molten"); + moltenMetal = new BlockMoltenMetal(moltenMetalFluid, Material.lava); + GameRegistry.registerBlock(moltenMetal, "moltenMetalLiquid"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/9000a4bccadf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/9000a4bccadf00141dc6c962aec96210 deleted file mode 100644 index 9f64cc8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/9000a4bccadf00141dc6c962aec96210 +++ /dev/null @@ -1,94 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if (rand.nextInt(3) == 0 && (arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0)) arrow.setDead(); - } - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists){ - if (player.motionY < 0) player.motionY *= 0.6D; - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80, 1)); - player.fallDistance = 0F; - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - // Positive ring - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/9031349f2dde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/9031349f2dde00141043c3025ec60dfc deleted file mode 100644 index 0b7afda..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/9031349f2dde00141043c3025ec60dfc +++ /dev/null @@ -1,106 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() - 50 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5, resolution.getScaledHeight() - 50 + 16 * count, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + tagCache.getFloat("BlackHeart") / 2.0F, 15, resolution.getScaledHeight() - 45 + 16 * count, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() - 50 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/c03fc5e5dde50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/c03fc5e5dde50014109ec019d2f6c0dc new file mode 100644 index 0000000..e80f352 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/c03fc5e5dde50014109ec019d2f6c0dc @@ -0,0 +1,93 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget ") || currItem.getItem().getUnlocalizedName().toLowerCase().contains(" nugget")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(JewelrycraftUtil.isMetal(currItem)) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/50271aa22ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/50271aa22ce60014127dc373d78c1666 new file mode 100644 index 0000000..19c99f6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/50271aa22ce60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/5081b1640fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/5081b1640fe60014127dc373d78c1666 new file mode 100644 index 0000000..68edc65 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/5081b1640fe60014127dc373d78c1666 @@ -0,0 +1,578 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.6F); + GL11.glRotatef(75f, 0f, 1f, 0f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/6082e39affe50014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/6082e39affe50014127dc373d78c1666 new file mode 100644 index 0000000..61d762b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/6082e39affe50014127dc373d78c1666 @@ -0,0 +1,20 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +/** + * @author Sorin + * + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { +// System.out.println("Broken " + event.getResult()); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/a06388ad26e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/a06388ad26e60014127dc373d78c1666 new file mode 100644 index 0000000..6ce87a9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/a06388ad26e60014127dc373d78c1666 @@ -0,0 +1,26 @@ +package darkknight.jewelrycraft.client.gui; + +import darkknight.jewelrycraft.client.AbstractTab; +import darkknight.jewelrycraft.client.TabRegistry; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class InventoryTabVanilla extends AbstractTab +{ + public InventoryTabVanilla() + { + super(0, 0, 0, new ItemStack(Blocks.crafting_table)); + } + + @Override + public void onTabClicked () + { + TabRegistry.openInventoryGui(); + } + + @Override + public boolean shouldAddToList () + { + return true; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/b0bc2130cbdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/b0bc2130cbdf00141dc6c962aec96210 deleted file mode 100644 index 21bb8dc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/b0bc2130cbdf00141dc6c962aec96210 +++ /dev/null @@ -1,97 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if (rand.nextInt(3) == 0 && (arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0)) arrow.setDead(); - } - } - } - - if (jewelry instanceof ItemBracelet && exists){ - // Positive bracelet - if (player.motionY < 0) player.motionY *= 0.6D; - // Negative bracelet - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80, 1)); - player.fallDistance = 0F; - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - // Negative ring - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - // Positive ring - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/f0f277a80ade00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/f0f277a80ade00141043c3025ec60dfc deleted file mode 100644 index 7a2ed10..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/f0f277a80ade00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int alpha = (ingotColor >> 24) & 0xff; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor4f((float)alpha / 255, (float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/b0ad63acfde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/b0ad63acfde40014174fe663e69b8422 new file mode 100644 index 0000000..7f0dc41 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/b0ad63acfde40014174fe663e69b8422 @@ -0,0 +1,46 @@ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldObject extends Item +{ + public ItemGoldObject() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/30c7389426de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/30c7389426de00141043c3025ec60dfc deleted file mode 100644 index 912f1ae..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/30c7389426de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.5f, 0.5f, 0.0f); - drawTexturedModalRect(20, 16 + (size + 12) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/50e1e03570e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/50e1e03570e300141084bb8bfb075c08 new file mode 100644 index 0000000..e69de29 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/6040154608de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/6040154608de00141043c3025ec60dfc deleted file mode 100644 index 2edef74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/6040154608de00141043c3025ec60dfc +++ /dev/null @@ -1,184 +0,0 @@ -package darkknight.jewelrycraft.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println(f3); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = ingotColor >> 16 & 0xff; - int green = ingotColor >> 8 & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/80d136b994e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/80d136b994e3001412c4c4819c88e86b new file mode 100644 index 0000000..50fa890 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/80d136b994e3001412c4c4819c88e86b @@ -0,0 +1,72 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntity tile = world.getTileEntity(x, y, z); + if(((TileEntityMidasTouch)tile).target != null) + this.setBlockBounds((float)((TileEntityMidasTouch)tile).target.boundingBox.minX, (float)((TileEntityMidasTouch)tile).target.boundingBox.minY, (float)((TileEntityMidasTouch)tile).target.boundingBox.minZ, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxX, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxY, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxZ); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/1085f39501e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/1085f39501e50014174fe663e69b8422 new file mode 100644 index 0000000..8aa7aeb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/1085f39501e50014174fe663e69b8422 @@ -0,0 +1,53 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && Block.getBlockFromItem(curItem.getItem()) == null){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/10e9952ffde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/10e9952ffde40014174fe663e69b8422 new file mode 100644 index 0000000..07bb2b6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/10e9952ffde40014174fe663e69b8422 @@ -0,0 +1,46 @@ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldObject extends Item +{ + public ItemGoldifiedObject() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/00f0902b36e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/00f0902b36e100141e1cc3c3be242e56 new file mode 100644 index 0000000..5840c72 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/00f0902b36e100141e1cc3c3be242e56 @@ -0,0 +1,206 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.util.Variables; + +public class BlockMolder extends BlockContainer +{ + Random rand = new Random(); + + /** + * @param par2Material + */ + protected BlockMolder(Material par2Material) + { + super(par2Material); + setBlockBounds(0.1F, 0F, 0.1F, 0.9F, 0.2F, 0.9F); + } + + /** + * @param world + * @param var2 + * @return + */ + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMolder(); + } + + /** + * @return + */ + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param entityPlayer + * @param par6 + * @param par7 + * @param par8 + * @param par9 + * @return + */ + @Override + public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) + { + TileEntityMolder te = (TileEntityMolder)world.getTileEntity(i, j, k); + ItemStack item = entityPlayer.inventory.getCurrentItem(); + if (te != null && !world.isRemote){ + if (item != null && !te.hasMold && item.getItem() == ItemList.molds){ + te.mold = item.copy(); + te.hasMold = true; + if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize; + entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage." + Variables.MODID + ".molder.addedmold", te.mold.getDisplayName()))); + te.isDirty = true; + } + if (te.hasMold && entityPlayer.isSneaking() && !te.hasMoltenMetal){ + dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.mold.copy()); + te.mold = new ItemStack(Item.getItemById(0), 0, 0); + te.hasMold = false; + te.isDirty = true; + }else if (te.hasMoltenMetal) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".molder.hasmoltenmetal"))); + } + return true; + } + + /** + * @param world + * @param x + * @param y + * @param z + * @param stack + */ + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param par5 + * @param par6 + */ + @Override + public void breakBlock(World world, int i, int j, int k, Block par5, int par6) + { + TileEntityMolder te = (TileEntityMolder)world.getTileEntity(i, j, k); + if (te != null){ + if (te.hasJewelBase) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, te.jewelBase.copy()); + if (te.hasMold) dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.mold.copy()); + world.removeTileEntity(i, j, k); + } + super.breakBlock(world, i, j, k, par5, par6); + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param entityLiving + * @param par6ItemStack + */ + @Override + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack) + { + int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + world.setBlockMetadataWithNotify(i, j, k, rotation, 2); + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param player + */ + @Override + public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) + { + TileEntityMolder me = (TileEntityMolder)world.getTileEntity(i, j, k); + if (me != null && !world.isRemote){ + if (me.hasJewelBase){ + dropItem(me.getWorldObj(), me.xCoord, me.yCoord, me.zCoord, me.jewelBase.copy()); + me.jewelBase = new ItemStack(Item.getItemById(0), 0, 0); + me.hasJewelBase = false; + }else if (me.hasMoltenMetal && me.cooling >= 0) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".molder.metaliscooling") + " (" + (ConfigHandler.ingotCoolingTime - me.cooling) * 100 / ConfigHandler.ingotCoolingTime + "%)")); + else if (me.mold.getItem() == ItemList.molds && !me.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".molder.moldisempty"))); + else if (me.mold.getItem() != ItemList.molds) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".molder.moldismissing"))); + me.isDirty = true; + } + } + + /** + * @param iblockaccess + * @param i + * @param j + * @param k + * @param l + * @return + */ + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + /** + * @return + */ + @Override + public boolean isOpaqueCube() + { + return false; + } + + /** + * @return + */ + @Override + public int getRenderType() + { + return -1; + } + + /** + * @param icon + */ + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon(Variables.MODID + ":molder"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/40c942690fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/40c942690fe60014127dc373d78c1666 new file mode 100644 index 0000000..4f404af --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/40c942690fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.6F); + GL11.glRotatef(75f, 0f, 1f, 0f); + GL11.glRotatef(15f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/c002ba7395e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/c002ba7395e3001412c4c4819c88e86b new file mode 100644 index 0000000..83bdfc7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/c002ba7395e3001412c4c4819c88e86b @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntity tile = world.getTileEntity(x, y, z); + if(((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.height); + this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/d0f4feb20ade00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/d0f4feb20ade00141043c3025ec60dfc deleted file mode 100644 index 8ac423f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/d0f4feb20ade00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int alpha = (ingotColor >> 24) & 0xff; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor4f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e0f236a626de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e0f236a626de00141043c3025ec60dfc deleted file mode 100644 index 5bdfb8f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e0f236a626de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.5f, 0.5f, 0.0f); - drawTexturedModalRect(20, 16 + (size + 20) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/d03329bd25e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/d03329bd25e60014127dc373d78c1666 new file mode 100644 index 0000000..03bc342 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/d03329bd25e60014127dc373d78c1666 @@ -0,0 +1,74 @@ +package main.java.tconstruct.client.tabs; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/9020848ffce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/9020848ffce40014174fe663e69b8422 new file mode 100644 index 0000000..3293158 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/9020848ffce40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/50fcae8bd0df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/50fcae8bd0df00141dc6c962aec96210 deleted file mode 100644 index 4c36593..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/50fcae8bd0df00141dc6c962aec96210 +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2 + JewelryNBT.numberOfModifiers(item) / 4)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 150 - JewelryNBT.numberOfModifiers(item) * 10, 2 - JewelryNBT.numberOfModifiers(item) / 5)); - // Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(520 - JewelryNBT.numberOfModifiers(item) * 20) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - // Negative ring - if (jewelry instanceof ItemRing && exists) Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 2.2F - JewelryNBT.numberOfModifiers(item) * 0.1F); - // Positive ring - if (jewelry instanceof ItemRing && exists && rand.nextInt(180 + JewelryNBT.numberOfModifiers(item)*20) == 12){ - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100 + JewelryNBT.numberOfModifiers(item)*30, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/60276c082de60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/60276c082de60014127dc373d78c1666 new file mode 100644 index 0000000..d6ff992 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/60276c082de60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0) - ((tabList.get(1).enabled)?3:0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/00a3c9260cde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/00a3c9260cde00141043c3025ec60dfc deleted file mode 100644 index 25c567e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/00a3c9260cde00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; -// System.out.println(red + " " + green + " " + blue); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glColorMask(false, true, true, false); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/1025655c2bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/1025655c2bde00141043c3025ec60dfc deleted file mode 100644 index 67ff07e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/1025655c2bde00141043c3025ec60dfc +++ /dev/null @@ -1,466 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - System.out.println(curseNo + " " + Curse.availableCurses); - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss()){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/80aeb7fb26de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/80aeb7fb26de00141043c3025ec60dfc deleted file mode 100644 index 7bf9867..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/80aeb7fb26de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/209236d010e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/209236d010e60014127dc373d78c1666 new file mode 100644 index 0000000..b3ed778 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/209236d010e60014127dc373d78c1666 @@ -0,0 +1,585 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.35F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/d06a48742ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/d06a48742ce60014127dc373d78c1666 new file mode 100644 index 0000000..fbb57c4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/d06a48742ce60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ +// if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || tabList.get(1).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; +// } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/1013dbafccdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/1013dbafccdf00141dc6c962aec96210 deleted file mode 100644 index 00f72b9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/1013dbafccdf00141dc6c962aec96210 +++ /dev/null @@ -1,96 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if ((arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0) && rand.nextInt(2 + JewelryNBT.numberOfModifiers(item)) == 0) arrow.setDead(); - } - } - } - if (jewelry instanceof ItemBracelet && exists){ - // Positive bracelet - if (player.motionY < 0) player.motionY *= (0.6D + (JewelryNBT.numberOfModifiers(item) - 1) * 0.03D); - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) player.fallDistance = 0F; - // Negative bracelet - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80 + JewelryNBT.numberOfModifiers(item) * 10, 1 + JewelryNBT.numberOfModifiers(item) / 4)); - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - // Negative ring - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / (2F + (JewelryNBT.numberOfModifiers(item)-1)*0.1F)); - // Positive ring - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 51 - JewelryNBT.numberOfModifiers(item)); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(3 + JewelryNBT.numberOfModifiers(item)) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * (3F + JewelryNBT.numberOfModifiers(item)*0.1F)); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * (2F + JewelryNBT.numberOfModifiers(item)*0.1F)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/30156ba910e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/30156ba910e60014127dc373d78c1666 new file mode 100644 index 0000000..7724ce9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/30156ba910e60014127dc373d78c1666 @@ -0,0 +1,585 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.3F, 0.5F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/8044082ffce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/8044082ffce40014174fe663e69b8422 new file mode 100644 index 0000000..b9560c1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/8044082ffce40014174fe663e69b8422 @@ -0,0 +1,37 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/f01e505a95e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/f01e505a95e3001412c4c4819c88e86b new file mode 100644 index 0000000..0b7f8e6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/f01e505a95e3001412c4c4819c88e86b @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntity tile = world.getTileEntity(x, y, z); + if(((TileEntityMidasTouch)tile).target != null){ + System.out.println(this.getBlockBoundsMinY()); + this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/20753b7905de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/20753b7905de00141043c3025ec60dfc deleted file mode 100644 index 8b055a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/20753b7905de00141043c3025ec60dfc +++ /dev/null @@ -1,23 +0,0 @@ -package darkknight.jewelrycraft.item; - -import cpw.mods.fml.common.network.internal.FMLNetworkHandler; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import darkknight.jewelrycraft.JewelrycraftMod; - -public class ItemJewelryModifier extends Item -{ - public ItemJewelryModifier() - { - super(); - } - - @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) - { - if (!world.isRemote) player.openGui(JewelrycraftMod.instance, 3, world, 0, 0, 0); - return stack; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/209ca7a826e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/209ca7a826e60014127dc373d78c1666 new file mode 100644 index 0000000..21b780f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/209ca7a826e60014127dc373d78c1666 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.client.gui; + +import darkknight.jewelrycraft.client.TabRegistry; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class InventoryTabVanilla extends AbstractTab +{ + public InventoryTabVanilla() + { + super(0, 0, 0, new ItemStack(Blocks.crafting_table)); + } + + @Override + public void onTabClicked () + { + TabRegistry.openInventoryGui(); + } + + @Override + public boolean shouldAddToList () + { + return true; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/7075f1a529e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/7075f1a529e60014127dc373d78c1666 new file mode 100644 index 0000000..9b1fe51 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/7075f1a529e60014127dc373d78c1666 @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class InventoryTabVanilla extends AbstractTab +{ + public InventoryTabVanilla() + { + super(0, 0, 0, new ItemStack(Blocks.crafting_table)); + } + + @Override + public void onTabClicked () + { + TabRegistry.openInventoryGui(); + } + + @Override + public boolean shouldAddToList () + { + return false; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/90fa117a8de3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/90fa117a8de3001417b2e384bf7c3702 new file mode 100644 index 0000000..ac90f3b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/90fa117a8de3001417b2e384bf7c3702 @@ -0,0 +1,35 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart)){ + world.setBlock((int)target.posX, (int)target.posY, (int)target.posZ, BlockList.midasTouchBlock, 0, 2); + ((EntityLiving)target).hurtTime = 0; + TileEntity midasTouchVictim = new TileEntityMidasTouch(target); + world.setTileEntity((int)target.posX, (int)target.posY, (int)target.posZ, midasTouchVictim); + target.setDead(); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/e058c2a396e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/e058c2a396e3001412c4c4819c88e86b new file mode 100644 index 0000000..97531da --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/e058c2a396e3001412c4c4819c88e86b @@ -0,0 +1,36 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart)){ + world.setBlock((int)target.posX, (int)target.posY, (int)target.posZ, BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity((int)target.posX, (int)target.posY, (int)target.posZ, midasTouchVictim); + target.setDead(); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/f09ccb8e23e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/f09ccb8e23e60014127dc373d78c1666 new file mode 100644 index 0000000..481c5cb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/f09ccb8e23e60014127dc373d78c1666 @@ -0,0 +1,76 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + GL11.glRotatef(90F, 1F, 0F, 0F); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + GL11.glRotatef(-90F, 1F, 0F, 0F); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/6060ee470fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/6060ee470fe60014127dc373d78c1666 new file mode 100644 index 0000000..68b4bfe --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/6060ee470fe60014127dc373d78c1666 @@ -0,0 +1,578 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.3F); + GL11.glRotatef(60f, 0f, 1f, 0f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/10a39f8636e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/10a39f8636e100141e1cc3c3be242e56 new file mode 100644 index 0000000..a8c581c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/10a39f8636e100141e1cc3c3be242e56 @@ -0,0 +1,261 @@ +package darkknight.jewelrycraft.block; + +import java.io.IOException; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.ItemMoltenMetalBucket; +import darkknight.jewelrycraft.network.PacketSendLiquidData; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class BlockSmelter extends BlockContainer +{ + Random rand = new Random(); + + public BlockSmelter() + { + super(Material.rock); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntitySmelter(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Spawns an item in the world at the specified location + * + * @param world + * @param x + * @param y + * @param z + * @param stack + */ + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 1.3D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + entityitem.delayBeforeCanPickup = 0; + world.spawnEntityInWorld(entityitem); + } + + @Override + public void breakBlock(World world, int i, int j, int k, Block par5, int par6) + { + TileEntitySmelter te = (TileEntitySmelter)world.getTileEntity(i, j, k); + if (te != null){ + if (te.hasMetal) dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.metal.copy()); + if (te.hasMoltenMetal && te.moltenMetal != null && Item.getIdFromItem(te.moltenMetal.getItem()) > 0){ + ItemStack metal = te.moltenMetal; + ItemStack item = te.moltenMetal; + if (Item.getIdFromItem(metal.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(metal.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(metal.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(metal.getItem()) == Block.getIdFromBlock(Blocks.carpet)) metal.setItemDamage(15 - metal.getItemDamage()); + int color = 16777215; + JewelryNBT.addMetal(item, metal); + try{ + color = ItemMoltenMetalBucket.color(item, 1); + System.out.println(color); + } + catch(IOException e){ + e.printStackTrace(); + } + JewelrycraftMod.saveData.setString(i + " " + j + " " + k + " " + world.provider.dimensionId, Item.getIdFromItem(metal.getItem()) + ":" + metal.getItemDamage() + ":" + color); + JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, i, j, k, Item.getIdFromItem(metal.getItem()), metal.getItemDamage(), color)); + world.setBlock(i, j, k, BlockList.moltenMetal, 0, 3); + int quant = (int)(te.quantity * 10); + if (quant == 1) world.setBlockMetadataWithNotify(i, j, k, 4, 3); + if (quant == 2) world.setBlockMetadataWithNotify(i, j, k, 4, 3); + if (quant == 3) world.setBlockMetadataWithNotify(i, j, k, 3, 3); + if (quant == 4) world.setBlockMetadataWithNotify(i, j, k, 3, 3); + if (quant == 5) world.setBlockMetadataWithNotify(i, j, k, 2, 3); + if (quant == 6) world.setBlockMetadataWithNotify(i, j, k, 2, 3); + if (quant == 7) world.setBlockMetadataWithNotify(i, j, k, 1, 3); + if (quant == 8) world.setBlockMetadataWithNotify(i, j, k, 1, 3); + if (quant == 9) world.setBlockMetadataWithNotify(i, j, k, 0, 3); + } + world.removeTileEntity(i, j, k); + } + super.breakBlock(world, i, j, k, par5, par6); + } + + @Override + public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) + { + TileEntitySmelter te = (TileEntitySmelter)world.getTileEntity(i, j, k); + ItemStack item = entityPlayer.inventory.getCurrentItem(); + if (te != null && te.hasMoltenMetal && te.quantity >= 0.9f && !te.pouring && item != null && item.getItem() == Items.bucket){ + te.quantity = 0f; + te.hasMoltenMetal = false; + ItemStack metalBucket = new ItemStack(ItemList.bucket, 1); + ItemStack ingot = te.moltenMetal.copy(); + if (Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.carpet)) ingot.setItemDamage(15 - ingot.getItemDamage()); + JewelryNBT.addMetal(metalBucket, ingot); + --item.stackSize; + entityPlayer.inventory.addItemStackToInventory(metalBucket); + te.isDirty = true; + return true; + } + if (te != null && !world.isRemote){ + if (te.hasMetal && entityPlayer.isSneaking()){ + dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.metal.copy()); + te.hasMetal = false; + te.melting = -1; + te.isDirty = true; + } + if (item != null && item.getItem() != null && !(item.getItem() instanceof ItemMoltenMetalBucket)){ + int index = -1; + for(int a = 0; a < JewelrycraftUtil.jamcraftPlayers.size(); a++) + if (entityPlayer.getUniqueID().toString().equals(JewelrycraftUtil.jamcraftPlayers.get(a))) index = a; + if(entityPlayer.capabilities.isCreativeMode) index = 1; + boolean canPlace = item != null && (JewelrycraftUtil.isMetal(item) || JewelrycraftUtil.isOre(item) || index >= 0); + boolean isOre = false, oreCoincidesWithMetal = false, itemCoincidesWithMetal = false, itemCoincidesWithMoltenMetal = false, overflow = false; + isOre = JewelrycraftUtil.isOre(item); + if (te.metal != null && te.metal.getItem() != null) itemCoincidesWithMetal = item.getItem().equals(te.metal.getItem()) && item.getItemDamage() == te.metal.getItemDamage(); + if (te.moltenMetal != null && te.moltenMetal.getItem() != null){ + itemCoincidesWithMoltenMetal = item.getItem().equals(te.moltenMetal.getItem()) && item.getItemDamage() == te.moltenMetal.getItemDamage(); + if (isOre) oreCoincidesWithMetal = te.moltenMetal.getItem().equals(JewelrycraftUtil.getIngotFromOre(item.getItem()).getItem()) && te.moltenMetal.getItemDamage() == JewelrycraftUtil.getIngotFromOre(item.getItem()).getItemDamage(); + } + overflow = isOre ? te.metal.stackSize * 0.2f + te.quantity < 0.8f : te.metal.stackSize * 0.1f + te.quantity < 0.9f; + boolean isValid = te.hasMoltenMetal ? itemCoincidesWithMoltenMetal : true; + if (te.quantity < 0.9f && !te.pouring && canPlace && isValid){ + boolean check = isOre ? oreCoincidesWithMetal && te.quantity < 0.8f : itemCoincidesWithMoltenMetal; + boolean check2 = isOre ? oreCoincidesWithMetal : itemCoincidesWithMetal; + if (!te.hasMetal && !te.hasMoltenMetal || !te.hasMetal && te.hasMoltenMetal && check){ + entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage." + Variables.MODID + ".smelter.nowsmeltingingot", item.getDisplayName()))); + te.metal = item.copy(); + // if (Item.getIdFromItem(te.metal.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(te.metal.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(te.metal.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(te.metal.getItem()) == Block.getIdFromBlock(Blocks.carpet)) te.metal.setItemDamage(15 - te.metal.getItemDamage()); + te.metal.stackSize = 1; + te.hasMetal = true; + te.melting = ConfigHandler.ingotMeltingTime; + if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize; + te.isDirty = true; + }else if (te.hasMetal && te.hasMoltenMetal && check2 && overflow || te.hasMetal && !te.hasMoltenMetal && itemCoincidesWithMetal && overflow){ + entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("Smelting extra " + (isOre ? "ores" : "ingots") + " (" + (te.metal.stackSize + 1) + ")"))); + te.metal.stackSize++; + te.hasMetal = true; + te.melting += ConfigHandler.INGOT_MELTING_TIME; + if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize; + te.isDirty = true; + } + te.isDirty = true; + }else if (item != null && (te.hasMetal || te.hasMoltenMetal) && !itemCoincidesWithMoltenMetal && te.quantity < 0.9f) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("Item does not match contents!"))); + else if (item != null && !item.getUnlocalizedName().toLowerCase().contains("ingot") && te.quantity < 0.9f) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.itemrenamedtoingot"))); + else if (item != null && te.quantity >= 0.9f) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("Smelter is at full capacity."))); + }else if (item != null && item.getItem() != null && item.getItem() instanceof ItemMoltenMetalBucket && !te.hasMoltenMetal && !te.hasMetal){ + te.hasMoltenMetal = true; + ItemStack ingot = JewelryNBT.ingot(item); + if (Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.carpet)) ingot.setItemDamage(15 - ingot.getItemDamage()); + te.moltenMetal = ingot; + te.quantity = 0.9f; + te.isDirty = true; + if (!entityPlayer.capabilities.isCreativeMode){ + --item.stackSize; + dropItem(world, entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, new ItemStack(Items.bucket)); + } + }else if (item == null && te.hasMoltenMetal && te.moltenMetal.getItem() != null) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage." + Variables.MODID + ".smelter.hasmolteningot", te.moltenMetal.getDisplayName()))); + world.setTileEntity(i, j, k, te); + } + return true; + } + + @Override + public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) + { + TileEntitySmelter te = (TileEntitySmelter)world.getTileEntity(i, j, k); + TileEntityMolder me = null; + if (world.getBlockMetadata(i, j, k) == 0 && world.getTileEntity(i, j, k - 1) != null && world.getTileEntity(i, j, k - 1) instanceof TileEntityMolder) me = (TileEntityMolder)world.getTileEntity(i, j, k - 1); + else if (world.getBlockMetadata(i, j, k) == 1 && world.getTileEntity(i + 1, j, k) != null && world.getTileEntity(i + 1, j, k) instanceof TileEntityMolder) me = (TileEntityMolder)world.getTileEntity(i + 1, j, k); + else if (world.getBlockMetadata(i, j, k) == 2 && world.getTileEntity(i, j, k + 1) != null && world.getTileEntity(i, j, k + 1) instanceof TileEntityMolder) me = (TileEntityMolder)world.getTileEntity(i, j, k + 1); + else if (world.getBlockMetadata(i, j, k) == 3 && world.getTileEntity(i - 1, j, k) != null && world.getTileEntity(i - 1, j, k) instanceof TileEntityMolder) me = (TileEntityMolder)world.getTileEntity(i - 1, j, k); + if (te != null && me != null && !world.isRemote) if (te.hasMoltenMetal && isConnectedToMolder(world, i, j, k) && me != null && me.hasMold && !me.hasMoltenMetal && !me.hasJewelBase){ + te.pouring = true; + te.isDirty = true; +// System.out.println(Block.getBlockById(Item.getIdFromItem(te.moltenMetal.getItem()))); + }else if (te.hasMetal && te.melting > 0) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage." + Variables.MODID + ".smelter.metalismelting", te.metal.getDisplayName()) + " (" + (ConfigHandler.ingotMeltingTime * te.metal.stackSize - te.melting) * 100 / (ConfigHandler.ingotMeltingTime * te.metal.stackSize) + "%)")); + else if (te.hasMoltenMetal && !isConnectedToMolder(world, i, j, k)) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.molderismissing"))); + else if (!me.hasMold && te.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.molderhasnomold"))); + else if (me.hasMoltenMetal && te.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.molderhasmoltenmetal"))); + else if (me.hasJewelBase && te.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.modlerhasitem"))); + else player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.empty"))); + } + + /** + * Determines if a molder is placed in front of this + * + * @param world + * @param i + * @param j + * @param k + * @return true if a molder is attached, false otherwise + */ + public boolean isConnectedToMolder(World world, int i, int j, int k) + { + int blockMeta = world.getBlockMetadata(i, j, k); + if (blockMeta == 0 && world.getBlock(i, j, k - 1) instanceof BlockMolder) return true; + else if (blockMeta == 1 && world.getBlock(i + 1, j, k) instanceof BlockMolder) return true; + else if (blockMeta == 2 && world.getBlock(i, j, k + 1) instanceof BlockMolder) return true; + else if (blockMeta == 3 && world.getBlock(i - 1, j, k) instanceof BlockMolder) return true; + return false; + } + + @Override + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack) + { + int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + world.setBlockMetadataWithNotify(i, j, k, rotation, 2); + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon(Variables.MODID + ":smelter"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/50e526fb2be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/50e526fb2be60014127dc373d78c1666 new file mode 100644 index 0000000..1fab93c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/50e526fb2be60014127dc373d78c1666 @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla)){ + System.out.println(t); + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || tab instanceof TabJewelry) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/d01b82df0bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/d01b82df0bde00141043c3025ec60dfc deleted file mode 100644 index 81760c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/d01b82df0bde00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - System.out.println(red + " " + green + " " + blue); - GL11.glClearColor(1F, 1F, 1F, 1F); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/d0e1834d23e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/d0e1834d23e60014127dc373d78c1666 new file mode 100644 index 0000000..6728181 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/d0e1834d23e60014127dc373d78c1666 @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/f0467f9a2bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/f0467f9a2bde00141043c3025ec60dfc deleted file mode 100644 index 1667bd7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/f0467f9a2bde00141043c3025ec60dfc +++ /dev/null @@ -1,466 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - System.out.println(curseNo + " " + Curse.availableCurses); - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss()){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/1088932b36e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/1088932b36e100141e1cc3c3be242e56 new file mode 100644 index 0000000..3233a23 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/1088932b36e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int ingotCoolingTime; + public static int ingotMeltingTime; + public static int jewelryCraftingTime; + public static boolean generateVillageNetherstar; + public static boolean canFurnacesGenerateIngots; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + ingotCoolingTime = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + ingotMeltingTime = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + jewelryCraftingTime = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + generateVillageNetherstar = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + canFurnacesGenerateIngots = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + maxVillageJewelers = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + jewelerWeight = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + ingotChestMin = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMax = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/30bf1d4c2dde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/30bf1d4c2dde00141043c3025ec60dfc deleted file mode 100644 index 52497e5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/30bf1d4c2dde00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() - 50 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() - 50 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() - 50 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/50894d0b33e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/50894d0b33e100141e1cc3c3be242e56 new file mode 100644 index 0000000..e9f1b64 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/50894d0b33e100141e1cc3c3be242e56 @@ -0,0 +1,191 @@ +/* + * Mod made by DarkKnight during the Modjam 3 + * It's an awesome mod + * I love me! :D + */ +package darkknight.jewelrycraft; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Logger; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; +import cpw.mods.fml.relauncher.Side; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.gui.GuiHandler; +import darkknight.jewelrycraft.commands.JewelrycraftCommands; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.curses.CurseList; +import darkknight.jewelrycraft.damage.DamageSourceList; +import darkknight.jewelrycraft.effects.EffectsList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.events.BucketHandler; +import darkknight.jewelrycraft.events.EntityEventHandler; +import darkknight.jewelrycraft.events.KeyBindings; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketClearColorCache; +import darkknight.jewelrycraft.network.PacketKeyPressEvent; +import darkknight.jewelrycraft.network.PacketRequestLiquidData; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; +import darkknight.jewelrycraft.network.PacketRequestSetSlot; +import darkknight.jewelrycraft.network.PacketSendCurseStats; +import darkknight.jewelrycraft.network.PacketSendLiquidData; +import darkknight.jewelrycraft.network.PacketSendPlayerInfo; +import darkknight.jewelrycraft.proxy.CommonProxy; +import darkknight.jewelrycraft.recipes.CraftingRecipes; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; +import darkknight.jewelrycraft.worldGen.Generation; +import darkknight.jewelrycraft.worldGen.village.ComponentJewelry; +import darkknight.jewelrycraft.worldGen.village.JCTrades; +import darkknight.jewelrycraft.worldGen.village.VillageJewelryHandler; + +@Mod (modid = Variables.MODID, name = Variables.MODNAME, version = Variables.VERSION) +public class JewelrycraftMod +{ + @Instance (Variables.MODID) + public static JewelrycraftMod instance; + @SidedProxy (clientSide = "darkknight.jewelrycraft.proxy.ClientProxy", serverSide = "darkknight.jewelrycraft.proxy.CommonProxy") + public static CommonProxy proxy; + public static final Logger logger = Logger.getLogger("Jewelrycraft"); + public static File dir; + public static CreativeTabs jewelrycraft = new CreativeTabs(Variables.MODID){ + @Override + public Item getTabIconItem() + { + return Item.getItemFromBlock(BlockList.jewelCraftingTable); + } + }; + public static CreativeTabs liquids = new CreativeTabLiquids("Liquids"); + public static NBTTagCompound saveData = new NBTTagCompound(); + public static NBTTagCompound clientData = new NBTTagCompound(); + public static File liquidsConf; + public static SimpleNetworkWrapper netWrapper; + public static boolean fancyRender; + + /** + * Pre initialization of mod stuff. + * + * @param e FMLPreInitializationEvent + * @throws IOException Signals that an I/O exception has occurred. + */ + @EventHandler + public void preInit(FMLPreInitializationEvent e) throws IOException + { + ConfigHandler.INSTANCE.loadConfig(e); + BlockList.preInit(e); + ItemList.preInit(e); + CraftingRecipes.preInit(e); + CurseList.preInit(e); + OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot)); + OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre)); + VillagerRegistry.instance().registerVillagerId(3000); + VillagerRegistry.instance().registerVillageTradeHandler(3000, new JCTrades()); + VillagerRegistry.instance().registerVillageCreationHandler(new VillageJewelryHandler()); + try{ + MapGenStructureIO.func_143031_a(ComponentJewelry.class, Variables.MODID + ":Jewelry"); + } + catch(Throwable e2){ + logger.severe("Error registering Jewelrycraft Structures with Vanilla Minecraft: this is expected in versions earlier than 1.7.10"); + } + MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); + MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE); + BucketHandler.INSTANCE.buckets.put(BlockList.moltenMetal, ItemList.bucket); + + ModMetadata metadata = e.getModMetadata(); + List authorList = new ArrayList(); + + authorList.add("OnyxDarkKnight"); + authorList.add("bspkrs"); + authorList.add("domi1819"); + + dir = e.getModConfigurationDirectory(); + proxy.preInit(); + netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Variables.MODID); + netWrapper.registerMessage(PacketRequestLiquidData.class, PacketRequestLiquidData.class, 0, Side.SERVER); + netWrapper.registerMessage(PacketSendLiquidData.class, PacketSendLiquidData.class, 1, Side.CLIENT); + netWrapper.registerMessage(PacketClearColorCache.class, PacketClearColorCache.class, 2, Side.CLIENT); + netWrapper.registerMessage(PacketKeyPressEvent.class, PacketKeyPressEvent.class, 3, Side.SERVER); + netWrapper.registerMessage(PacketRequestPlayerInfo.class, PacketRequestPlayerInfo.class, 4, Side.SERVER); + netWrapper.registerMessage(PacketSendPlayerInfo.class, PacketSendPlayerInfo.class, 5, Side.CLIENT); + netWrapper.registerMessage(PacketSendCurseStats.class, PacketSendCurseStats.class, 6, Side.CLIENT); + netWrapper.registerMessage(PacketRequestSetSlot.class, PacketRequestSetSlot.class, 7, Side.SERVER); + + metadata.autogenerated = false; + metadata.authorList = authorList; + metadata.url = "https://github.com/sor1n/Jewelrycraft"; + + createEntity(EntityHeart.class, Variables.MODID + ".Heart", 0xFF0000, 0xFF0000, false); + createEntity(EntityHalfHeart.class, Variables.MODID + ".Half-Heart", 0x000000, 0xFF0000, false); + +// EntityRegistry.addSpawn(EntityMob.class, 5, 2, 3, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.plains, BiomeGenBase.beach, BiomeGenBase.coldBeach, BiomeGenBase.frozenRiver); + } + + public void createEntity(Class entity, String entityName, int solidColor, int spotColor, boolean hasSpawnEgg) + { + int randomID = EntityRegistry.findGlobalUniqueEntityId(); + if(hasSpawnEgg) EntityRegistry.registerGlobalEntityID(entity, entityName, randomID, solidColor, spotColor); + else EntityRegistry.registerGlobalEntityID(entity, entityName, randomID); + EntityRegistry.registerModEntity(entity, entityName, randomID, this, 40, 3, true); + } + + /** + * Initializes the world generation and key bindings. + * + * @param e FMLInitializationEvent + */ + @EventHandler + public void init(FMLInitializationEvent e) + { + GameRegistry.registerWorldGenerator(new Generation(), 0); + if (FMLCommonHandler.instance().getSide() == Side.CLIENT) FMLCommonHandler.instance().bus().register(new KeyBindings()); + new GuiHandler(); + FMLCommonHandler.instance().bus().register(ConfigHandler.INSTANCE); + } + + /** + * Post initialization of metals, modifiers and others. + * + * @param e FMLPostInitializationEvent + */ + @EventHandler + public void postInit(FMLPostInitializationEvent e) + { + JewelrycraftUtil.addMetals(); + JewelrycraftUtil.jamcrafters(); + EffectsList.postInit(e); + DamageSourceList.postInit(e); + proxy.postInit(); + } + + @Mod.EventHandler + public void serverLoad(FMLServerStartingEvent event) + { + event.registerServerCommand(new JewelrycraftCommands()); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/907dbd0a2ede00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/907dbd0a2ede00141043c3025ec60dfc deleted file mode 100644 index 3d1dd46..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/907dbd0a2ede00141043c3025ec60dfc +++ /dev/null @@ -1,109 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ -// for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(5, resolution.getScaledHeight() - 50 + 16 * count, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15, resolution.getScaledHeight() - 45 + 16 * count, 16777215); -// if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5, resolution.getScaledHeight() - 50 + 16 * count, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15, resolution.getScaledHeight() - 45 + 16 * count, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() - 50 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/e0ba42a391e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/e0ba42a391e3001417b2e384bf7c3702 new file mode 100644 index 0000000..76a6c42 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/e0ba42a391e3001417b2e384bf7c3702 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(0.8F, 1.0F, 0.0F); + RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, 0D, 0D, 0D, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/b0b8c8a826e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/b0b8c8a826e60014127dc373d78c1666 new file mode 100644 index 0000000..7ff068a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/b0b8c8a826e60014127dc373d78c1666 @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/e0c2b692fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/e0c2b692fce40014174fe663e69b8422 new file mode 100644 index 0000000..0e3b4b8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/e0c2b692fce40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft).setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/70348a9a23e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/70348a9a23e60014127dc373d78c1666 new file mode 100644 index 0000000..5e41df9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/70348a9a23e60014127dc373d78c1666 @@ -0,0 +1,76 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + GL11.glRotatef(90F, 0F, 1F, 0F); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); +// GL11.glRotatef(-90F, 1F, 0F, 0F); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/90b5ab67fee40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/90b5ab67fee40014174fe663e69b8422 new file mode 100644 index 0000000..8db0b73 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/90b5ab67fee40014174fe663e69b8422 @@ -0,0 +1,759 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class JewelryNBT +{ + // TODO NBT Tag Adding + public static void addItem(ItemStack item, ItemStack target) + { + if (target != null){ + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound targetNBT = new NBTTagCompound(); + target.writeToNBT(targetNBT); + itemStackData.setTag("target", targetNBT); + } + } + + /** + * @param item The item you want to add the NBT data on + * @param metal The metal you want to add on the item + */ + public static void addMetal(ItemStack item, ItemStack metal) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound ingotNBT = new NBTTagCompound(); + metal.writeToNBT(ingotNBT); + itemStackData.setTag("ingot", ingotNBT); + } + + /** + * @param item The item you want to add the NBT data on + * @param gem The gem you want to add on the item + */ + public static void addGem(ItemStack item, ItemStack gem) + { + if (gem != null){ + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound gemNBT = new NBTTagCompound(); + gem.writeToNBT(gemNBT); + itemStackData.setTag("gem", gemNBT); + } + } + + /** + * @param item The item you want to add the NBT data on + * @param modifier The modifier you want to add on the item + */ + public static void addModifiers(ItemStack item, ArrayList modifier) + { + if (modifier != null){ + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + for(int i = 0; i < modifier.size(); i++){ + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.get(i).writeToNBT(modifierNBT); + itemStackData.setTag("modifier" + i, modifierNBT); + } + itemStackData.setInteger("modifierSize", modifier.size()); + } + } + + /** + * @param item The item you want to add the NBT data on + * @param entity The entity to add on the item + */ + public static void addEntity(ItemStack item, EntityLivingBase entity) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound entityNBT = new NBTTagCompound(); + entity.writeToNBT(entityNBT); + itemStackData.setTag("entity", entityNBT); + } + + /** + * @param item + * @param entity + */ + public static void addEntityID(ItemStack item, EntityLivingBase entity) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound entityNBT = new NBTTagCompound(); + int id = EntityList.getEntityID(entity); + entityNBT.setInteger("entityID", id); + itemStackData.setTag("entityID", entityNBT); + } + + /** + * @param item + * @param x + * @param y + * @param z + */ + public static void addCoordonates(ItemStack item, double x, double y, double z) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound coords = new NBTTagCompound(); + coords.setDouble("x", x); + coords.setDouble("y", y); + coords.setDouble("z", z); + itemStackData.setTag("x", coords); + itemStackData.setTag("y", coords); + itemStackData.setTag("z", coords); + } + + /** + * @param item + * @param world + * @param x + * @param y + * @param z + */ + public static void addTileEntityBlock(ItemStack item, World world, int x, int y, int z) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound tileNBT = new NBTTagCompound(); + NBTTagCompound block = new NBTTagCompound(); + world.getTileEntity(x, y, z).writeToNBT(tileNBT); + itemStackData.setTag("tile", tileNBT); + block.setInteger("blockID", Block.getIdFromBlock(world.getBlock(x, y, z))); + block.setInteger("metadata", world.getBlockMetadata(x, y, z)); + block.setInteger("blockX", x); + block.setInteger("blockY", y); + block.setInteger("blockZ", z); + itemStackData.setTag("metadata", block); + itemStackData.setTag("blockID", block); + itemStackData.setTag("blockX", block); + itemStackData.setTag("blockY", block); + itemStackData.setTag("blockZ", block); + } + + /** + * @param item + * @param block + * @param metadata + */ + public static void addBlock(ItemStack item, int block, int metadata) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound blockNBT = new NBTTagCompound(); + blockNBT.setInteger("blockID", block); + itemStackData.setTag("blockID", blockNBT); + blockNBT.setInteger("metadata", metadata); + itemStackData.setTag("metadata", blockNBT); + } + + /** + * @param item + * @param x + * @param y + * @param z + */ + public static void addBlockCoordonates(ItemStack item, int x, int y, int z) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound coords = new NBTTagCompound(); + coords.setInteger("blockX", x); + coords.setInteger("blockY", y); + coords.setInteger("blockZ", z); + itemStackData.setTag("blockX", coords); + itemStackData.setTag("blockY", coords); + itemStackData.setTag("blockZ", coords); + } + + /** + * @param item + * @param x + * @param y + * @param z + * @param dim + * @param name + */ + public static void addCoordonatesAndDimension(ItemStack item, double x, double y, double z, int dim, String name) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound coords = new NBTTagCompound(); + coords.setDouble("x", x); + coords.setDouble("y", y); + coords.setDouble("z", z); + coords.setInteger("dimension", dim); + coords.setString("dimName", name); + itemStackData.setTag("x", coords); + itemStackData.setTag("y", coords); + itemStackData.setTag("z", coords); + itemStackData.setTag("dimension", coords); + itemStackData.setTag("dimName", coords); + } + + /** + * @param item + */ + public static void addFakeEnchantment(ItemStack item) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + itemStackData.setTag("ench", new NBTTagList()); + } + + /** + * @param item + * @param color + */ + public static void addIngotColor(ItemStack item, int color) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound colors = new NBTTagCompound(); + colors.setInteger("ingotColor", color); + itemStackData.setTag("ingotColor", colors); + } + + // TODO + /** + * @param item + * @param color + */ + public static void addGemColor(ItemStack item, int color) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound colors = new NBTTagCompound(); + colors.setInteger("gemColor", color); + itemStackData.setTag("gemColor", colors); + } + + /** + * @param item + * @param list + */ + @SuppressWarnings ("rawtypes") + public static void addEntities(ItemStack item, List list) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound entityNBT = new NBTTagCompound(); + for(int i = 0; i < list.size(); i++) + ((EntityLivingBase)list.get(i)).writeToNBT(entityNBT); + itemStackData.setTag("entities", entityNBT); + } + + // TODO NBT Tag Removing + /** + * @param item + * @param tag + */ + public static void removeNBT(ItemStack item, String tag) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + itemStackData.removeTag(tag); + } + + /** + * @param item + */ + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + /** + * @param item + */ + public static void removeBlock(ItemStack item) + { + JewelryNBT.removeNBT(item, "blockID"); + JewelryNBT.removeNBT(item, "metadata"); + JewelryNBT.removeNBT(item, "tile"); + JewelryNBT.removeNBT(item, "blockX"); + JewelryNBT.removeNBT(item, "blockY"); + JewelryNBT.removeNBT(item, "blockZ"); + } + + // TODO NTB Tag Checking + /** + * @param item + * @param tag + * @return + */ + public static boolean hasTag(ItemStack item, String tag) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else{ + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + if (itemStackData.hasKey(tag)) return true; + return false; + } + + /** + * @param stack + * @param gem + * @return + */ + public static boolean isGemX(ItemStack stack, ItemStack gem) + { + if (gem(stack) != null && gem(stack).getItem() == gem.getItem() && gem(stack).getItemDamage() == gem.getItemDamage()) return true; + return false; + } + + /** + * @param stack + * @param modifier + * @return + */ + public static boolean doesModifierExist(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null){ + ArrayList list = modifier(stack); + for(int i = 0; i < list.size(); i++) + if (list.get(i).getItem() == modifier.getItem() && list.get(i).getItemDamage() == modifier.getItemDamage()) return true; + } + return false; + } + + public static int modifierSize(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null){ + ArrayList list = modifier(stack); + for(int i = 0; i < list.size(); i++) + if (list.get(i).getItem() == modifier.getItem() && list.get(i).getItemDamage() == modifier.getItemDamage()) return list.get(i).stackSize; + } + return -1; + } + + public static int numberOfModifiers(ItemStack stack) + { + if (modifier(stack) != null) return modifier(stack).size(); + return -1; + } + + /** + * @param stack + * @param ingot + * @return + */ + public static boolean isIngotX(ItemStack stack, ItemStack ingot) + { + if (ingot(stack) != null && ingot(stack).getItem() == ingot.getItem() && ingot(stack).getItemDamage() == ingot.getItemDamage()) return true; + return false; + } + + /** + * @param stack + * @param player + * @param entity + * @return + */ + public static boolean isEntityX(ItemStack stack, EntityPlayer player, EntityLivingBase entity) + { + if (entity != null && entity instanceof EntityLivingBase && entity(stack, player) != null && entity(stack, player).equals(entity)) return true; + return false; + } + + /** + * @param stack + * @param dimName + * @return + */ + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + /** + * @param stack + * @param dimension + * @return + */ + public static boolean isDimensionX(ItemStack stack, int dimension) + { + if (dimension(stack) != -2 && dimension(stack) == dimension) return true; + return false; + } + + // TODO Return components based on NBT + /** + * @param stack + * @return + */ + public static ItemStack gem(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gem")){ + NBTTagCompound jewelNBT = (NBTTagCompound)stack.getTagCompound().getTag("gem"); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(jewelNBT); + return gem; + } + return null; + } + + /** + * @param stack + * @return + */ + public static ArrayList modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()){ + int size = stack.getTagCompound().getInteger("modifierSize"); + ArrayList list = new ArrayList(); + for(int i = 0; i < size; i++){ + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + NBTTagCompound modifierNBT = (NBTTagCompound)stack.getTagCompound().getTag("modifier" + i); + modifier.readFromNBT(modifierNBT); + list.add(modifier); + } + return list; + } + return null; + } + + /** + * @param stack + * @return + */ + public static ItemStack ingot(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("ingot")){ + NBTTagCompound ingotNBT = (NBTTagCompound)stack.getTagCompound().getTag("ingot"); + ItemStack ingot = new ItemStack(Item.getItemById(0), 0, 0); + ingot.readFromNBT(ingotNBT); + return ingot; + } + return null; + } + + /** + * @param stack + * @param player + * @return + */ + public static EntityLivingBase entity(ItemStack stack, EntityPlayer player) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("entityID") && stack.getTagCompound().hasKey("entity")){ + NBTTagCompound enID = (NBTTagCompound)stack.getTagCompound().getTag("entityID"); + NBTTagCompound en = (NBTTagCompound)stack.getTagCompound().getTag("entity"); + int entityID = 0; + entityID = enID.getInteger("entityID"); + EntityLivingBase entity = (EntityLivingBase)EntityList.createEntityByID(entityID, player.worldObj); + if (entity != null && entity instanceof EntityLivingBase){ + entity.readFromNBT(en); + return entity; + }else return null; + } + return null; + } + + /** + * @param stack + * @return + */ + public static TileEntity tileEntity(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("tile")){ + NBTTagCompound tileNBT = (NBTTagCompound)stack.getTagCompound().getTag("tile"); + TileEntity tile = TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity){ + tile.readFromNBT(tileNBT); + return tile; + }else return null; + } + return null; + } + + /** + * @param stack + * @return + */ + public static String dimName(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("dimName")){ + NBTTagCompound dim = (NBTTagCompound)stack.getTagCompound().getTag("dimName"); + String name = dim.getString("dimName"); + return name; + } + return null; + } + + /** + * @param stack + * @return + */ + public static String modeName(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("mode")){ + NBTTagCompound dim = (NBTTagCompound)stack.getTagCompound().getTag("mode"); + String name = dim.getString("mode"); + return name; + } + return null; + } + + /** + * @param stack + * @return + */ + public static int dimension(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("dimension")){ + NBTTagCompound dim = (NBTTagCompound)stack.getTagCompound().getTag("dimension"); + int dimension = dim.getInteger("dimension"); + return dimension; + } + return -2; + } + + /** + * @param stack + * @return + */ + public static int blockCoordX(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockX")){ + NBTTagCompound x = (NBTTagCompound)stack.getTagCompound().getTag("blockX"); + int posX = x.getInteger("blockX"); + return posX; + } + return -1; + } + + /** + * @param stack + * @return + */ + public static int blockCoordY(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockY")){ + NBTTagCompound y = (NBTTagCompound)stack.getTagCompound().getTag("blockY"); + int posY = y.getInteger("blockY"); + return posY; + } + return -1; + } + + /** + * @param stack + * @return + */ + public static int blockCoordZ(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockZ")){ + NBTTagCompound z = (NBTTagCompound)stack.getTagCompound().getTag("blockZ"); + int posZ = z.getInteger("blockZ"); + return posZ; + } + return -1; + } + + /** + * @param stack + * @return + */ + public static int blockID(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockID")){ + NBTTagCompound blockID = (NBTTagCompound)stack.getTagCompound().getTag("blockID"); + int blockId = blockID.getInteger("blockID"); + return blockId; + } + return -1; + } + + /** + * @param stack + * @return + */ + public static int blockMetadata(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("metadata")){ + NBTTagCompound metadataNBT = (NBTTagCompound)stack.getTagCompound().getTag("metadata"); + int metadata = metadataNBT.getInteger("metadata"); + return metadata; + } + return -1; + } + + /** + * @param stack + * @return + */ + public static double playerPosX(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("x")){ + NBTTagCompound x = (NBTTagCompound)stack.getTagCompound().getTag("x"); + double posX = x.getDouble("x"); + return posX; + } + return -1; + } + + /** + * @param stack + * @return + */ + public static double playerPosY(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("y")){ + NBTTagCompound y = (NBTTagCompound)stack.getTagCompound().getTag("y"); + double posY = y.getDouble("y"); + return posY; + } + return -1; + } + + /** + * @param stack + * @return + */ + public static double playerPosZ(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("z")){ + NBTTagCompound z = (NBTTagCompound)stack.getTagCompound().getTag("z"); + double posZ = z.getDouble("z"); + return posZ; + } + return -1; + } + + /** + * @param stack + * @return + */ + public static int ingotColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("ingotColor")){ + NBTTagCompound colors = (NBTTagCompound)stack.getTagCompound().getTag("ingotColor"); + int color = colors.getInteger("ingotColor"); + return color; + } + return 16777215; + } + + // TODO + /** + * @param stack + * @return + */ + public static int gemColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemColor")){ + NBTTagCompound colors = (NBTTagCompound)stack.getTagCompound().getTag("gemColor"); + int color = colors.getInteger("gemColor"); + return color; + } + return 16777215; + } + + /** + * @param stack + * @param player + * @return + */ + @SuppressWarnings ({"rawtypes", "unchecked", "null"}) + public static List entities(ItemStack stack, EntityPlayer player) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("entities")){ + NBTTagCompound enID = (NBTTagCompound)stack.getTagCompound().getTag("entitiesID"); + List list = null; + int[] entityID; + EntityLivingBase entity; + entityID = enID.getIntArray("entitiesID"); + for(int element: entityID){ + entity = (EntityLivingBase)EntityList.createEntityByID(element, player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a05f8b8d6edd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a05f8b8d6edd001412dce27813e7be4a deleted file mode 100644 index ca1efa3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a05f8b8d6edd001412dce27813e7be4a +++ /dev/null @@ -1,121 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.commands; - -/** - * @author Sorin - * - */ -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; - -public class JewelrycraftCommands extends CommandBase -{ - private List aliases; - - public JewelrycraftCommands() - { - this.aliases = new ArrayList(); - this.aliases.add("jw"); - this.aliases.add("jewelry"); - } - - @Override - public String getCommandName() - { - return "jewelrycraft"; - } - - @Override - public String getCommandUsage(ICommandSender var1) - { - String use = "/jewelrycraft [points] | "; - use += "/jewelrycraft |"; - use += "/jewelrycraft "; - return use; - } - - @Override - public List getCommandAliases() - { - return aliases; - } - - @Override - public void processCommand(ICommandSender commandSender, String[] astring) - { - if (astring.length == 0 || astring[0].equals("help")) throw new WrongUsageException(getCommandUsage(commandSender)); - if (astring[0].equals("getCursePoints")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - commandSender.addChatMessage(new ChatComponentTranslation(Integer.toString(JewelrycraftUtil.getCursePoints(entityplayermp)))); - }else if (astring[0].equals("addCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points); - }else if (astring[0].equals("setCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points - JewelrycraftUtil.getCursePoints(entityplayermp)); - }else if (astring[0].equals("addModifier")){ - ItemStack item = new ItemStack(CommandBase.getItemByText(commandSender, astring[1])); - EntityPlayerMP entityplayermp = getPlayer(commandSender, commandSender.getCommandSenderName()); - ArrayList modifier = new ArrayList(); - modifier.add(item); - JewelryNBT.addModifiers(entityplayermp.getCurrentEquippedItem(), modifier); - }else if (astring[0].equals("addCurse")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - int curse = Integer.valueOf(astring[2]); - int grade = Integer.valueOf(astring[3]); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(entityplayermp, "Jewelrycraft"); - if(curse < Curse.getCurseList().size() && grade <= 2) - { - EntityEventHandler.addCurse(entityplayermp, playerInfo, curse, grade); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo(entityplayermp)); - } - else if(curse >= Curse.getCurseList().size()) entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse ID exceedes the maximum value of " + (Curse.getCurseList().size() - 1))); - else entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse grade exceedes the maximum value of 2")); - - } - } - - @Override - public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring) - { - final List MATCHES = new LinkedList(); - final String ARG_LC = astring[astring.length - 1].toLowerCase(); - if (astring.length == 1){ - if ("addCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCursePoints"); - if ("getCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("getCursePoints"); - if ("setCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("setCursePoints"); - if ("addModifier".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addModifier"); - if ("addCurse".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCurse"); - }else if (astring.length == 2){ - if (!astring[0].equals("addModifier")){ - for(String un: MinecraftServer.getServer().getAllUsernames()) - if (un.toLowerCase().startsWith(ARG_LC)) MATCHES.add(un); - }else if (!astring[0].equals("addCurse")) return getListOfStringsFromIterableMatchingLastWord(astring, Item.itemRegistry.getKeys()); - } - return MATCHES.isEmpty() ? null : MATCHES; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/e0cafc4603e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/e0cafc4603e60014127dc373d78c1666 new file mode 100644 index 0000000..6b202fb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/e0cafc4603e60014127dc373d78c1666 @@ -0,0 +1,41 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.block.BlockMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +/** + * @author Sorin + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + // System.out.println("Broken " + event.getResult()); + ItemStack item = event.getPlayer().inventory.getCurrentItem(); + if (event.block instanceof BlockMidasTouch && item != null && item.getItem().canHarvestBlock(event.block, item)){ + System.out.println(event.block.getHarvestLevel(3) + " " + item.getItem().getHarvestLevel(item, "ItemPickaxe.class")); + TileEntityMidasTouch te = (TileEntityMidasTouch)event.world.getTileEntity(event.x, event.y, event.z); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + } + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/1066a4a395e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/1066a4a395e3001412c4c4819c88e86b new file mode 100644 index 0000000..9246875 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/1066a4a395e3001412c4c4819c88e86b @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntity tile = world.getTileEntity(x, y, z); + if(((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.height); + this.setBlockBounds(0F, 0F, 0F, 1F, ((TileEntityMidasTouch)tile).target.height, 1F); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/c006172337e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/c006172337e100141e1cc3c3be242e56 new file mode 100644 index 0000000..3519106 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/c006172337e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int MAX_VILLAGE_JEWELERS; + public static int JEWELER_WEIGHT; + public static int INGOT_CHEST_MIN; + public static int INGOT_CHEST_MAX; + public static int INGOT_CHEST_MAX_STACK; + public static int GEM_CHEST_MIN; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + JEWELER_WEIGHT = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + INGOT_CHEST_MIN = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX_STACK = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + GEM_CHEST_MIN = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/d022da5e25e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/d022da5e25e60014127dc373d78c1666 new file mode 100644 index 0000000..fada7ff --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/d022da5e25e60014127dc373d78c1666 @@ -0,0 +1,96 @@ +package darkknight.jewelrycraft.proxy; + +import main.java.tconstruct.client.tabs.InventoryTabVanilla; +import main.java.tconstruct.client.tabs.TabRegistry; +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.entities.renders.HeartRender; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.render.ItemRender; +import darkknight.jewelrycraft.model.ModelDisplayer; +import darkknight.jewelrycraft.model.ModelHalfHeart; +import darkknight.jewelrycraft.model.ModelHandPedestal; +import darkknight.jewelrycraft.model.ModelHeart; +import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; +import darkknight.jewelrycraft.model.ModelMolder; +import darkknight.jewelrycraft.model.ModelShadowEye; +import darkknight.jewelrycraft.model.ModelShadowHand; +import darkknight.jewelrycraft.model.ModelSmelter; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMidasTouchRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/ShadowHand.png"); + TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMidasTouch.class, new TileEntityMidasTouchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); + + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); + MinecraftForgeClient.registerItemRenderer(ItemList.goldObj, new ItemRender()); + + VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation(Variables.MODID, "textures/entities/jeweler.png")); + + RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); + + TabRegistry.registerTab(new InventoryTabVanilla()); + TabRegistry.registerTab(new TabJewelry()); + MinecraftForge.EVENT_BUS.register(new TabRegistry()); + MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); + ResourceLocation jeweleryTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/00e861e202e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/00e861e202e50014174fe663e69b8422 new file mode 100644 index 0000000..0ec3a93 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/00e861e202e50014174fe663e69b8422 @@ -0,0 +1,57 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return Block.getBlockFromItem(item.getItem()).getIcon(6, 6); + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/9018c447fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/9018c447fde40014174fe663e69b8422 new file mode 100644 index 0000000..3f459b0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/9018c447fde40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + public static Item goldifiedObject; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/1062bc07fee40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/1062bc07fee40014174fe663e69b8422 new file mode 100644 index 0000000..686d7ce --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/1062bc07fee40014174fe663e69b8422 @@ -0,0 +1,48 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + if(player.inventory.getCurrentItem() != null){ + int index = player.inventory.currentItem; + ItemStack item = player.inventory.getCurrentItem(); + player.inventory.setInventorySlotContents(index, new ItemStack(ItemList.goldifiedObject, item.stackSize, item.getItemDamage())); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/20dfbe86fde50014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/20dfbe86fde50014127dc373d78c1666 new file mode 100644 index 0000000..954a03f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/20dfbe86fde50014127dc373d78c1666 @@ -0,0 +1,94 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 0; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public void onBlockDestroyedByPlayer(World world, int i, int j, int k, int meta) + { + TileEntityMidasTouch te = (TileEntityMidasTouch)world.getTileEntity(i, j, k); + if (te != null && te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + super.onBlockDestroyedByPlayer(world, i, j, k, meta); + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/503f48a829de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/503f48a829de00141043c3025ec60dfc deleted file mode 100644 index f9152a7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/503f48a829de00141043c3025ec60dfc +++ /dev/null @@ -1,465 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss()){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/0020beb436e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/0020beb436e100141e1cc3c3be242e56 new file mode 100644 index 0000000..7e8547d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/0020beb436e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + maxVillageJewelers = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + jewelerWeight = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + ingotChestMin = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMax = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/009ea381fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/009ea381fde40014174fe663e69b8422 new file mode 100644 index 0000000..6d209fe --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/009ea381fde40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + public static Item goldifiedObject; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ +// thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); +// shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); +// molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); +// clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); +// ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); +// necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); +// bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); +// earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); +// crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); +// guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); +// bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); +// metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); +// jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldObject().setUnlocalizedName(Variables.MODID + ".goldObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/3071082c4ae0001413f1950b5bdb0d24 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/3071082c4ae0001413f1950b5bdb0d24 deleted file mode 100644 index 4252c5c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/3071082c4ae0001413f1950b5bdb0d24 +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Mod made by DarkKnight during the Modjam 3 - * It's an awesome mod - * I love me! :D - */ -package darkknight.jewelrycraft; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Logger; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.gen.structure.MapGenStructureIO; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.oredict.OreDictionary; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.ModMetadata; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.VillagerRegistry; -import cpw.mods.fml.relauncher.Side; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.client.gui.GuiHandler; -import darkknight.jewelrycraft.commands.JewelrycraftCommands; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.CurseList; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.effects.EffectsList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.events.BucketHandler; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.events.KeyBindings; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketKeyPressEvent; -import darkknight.jewelrycraft.network.PacketRequestLiquidData; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketRequestSetSlot; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendLiquidData; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.proxy.CommonProxy; -import darkknight.jewelrycraft.recipes.CraftingRecipes; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.Variables; -import darkknight.jewelrycraft.worldGen.Generation; -import darkknight.jewelrycraft.worldGen.village.ComponentJewelry; -import darkknight.jewelrycraft.worldGen.village.JCTrades; -import darkknight.jewelrycraft.worldGen.village.VillageJewelryHandler; - -@Mod (modid = Variables.MODID, name = Variables.MODNAME, version = Variables.VERSION) -public class JewelrycraftMod -{ - @Instance (Variables.MODID) - public static JewelrycraftMod instance; - @SidedProxy (clientSide = "darkknight.jewelrycraft.proxy.ClientProxy", serverSide = "darkknight.jewelrycraft.proxy.CommonProxy") - public static CommonProxy proxy; - public static final Logger logger = Logger.getLogger("Jewelrycraft"); - public static File dir; - public static CreativeTabs jewelrycraft = new CreativeTabs(Variables.MODID){ - @Override - public Item getTabIconItem() - { - return Item.getItemFromBlock(BlockList.jewelCraftingTable); - } - }; - public static CreativeTabs liquids = new CreativeTabLiquids("Liquids"); - public static NBTTagCompound saveData = new NBTTagCompound(); - public static NBTTagCompound clientData = new NBTTagCompound(); - public static File liquidsConf; - public static SimpleNetworkWrapper netWrapper; - public static boolean fancyRender; - - /** - * Pre initialization of mod stuff. - * - * @param e FMLPreInitializationEvent - * @throws IOException Signals that an I/O exception has occurred. - */ - @EventHandler - public void preInit(FMLPreInitializationEvent e) throws IOException - { - ConfigHandler.preInit(e); - BlockList.preInit(e); - ItemList.preInit(e); - CraftingRecipes.preInit(e); - CurseList.preInit(e); - OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot)); - OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre)); -// VillagerRegistry.instance().registerVillagerId(3000); -// VillagerRegistry.instance().registerVillageTradeHandler(3000, new JCTrades()); -// VillagerRegistry.instance().registerVillageCreationHandler(new VillageJewelryHandler()); -// try{ -// MapGenStructureIO.func_143031_a(ComponentJewelry.class, Variables.MODID + ":Jewelry"); -// } -// catch(Throwable e2){ -// logger.severe("Error registering Jewelrycraft Structures with Vanilla Minecraft: this is expected in versions earlier than 1.7.10"); -// } - MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); - MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE); - BucketHandler.INSTANCE.buckets.put(BlockList.moltenMetal, ItemList.bucket); - - ModMetadata metadata = e.getModMetadata(); - List authorList = new ArrayList(); - - authorList.add("OnyxDarkKnight"); - authorList.add("bspkrs"); - authorList.add("domi1819"); - - dir = e.getModConfigurationDirectory(); - proxy.preInit(); - netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Variables.MODID); - netWrapper.registerMessage(PacketRequestLiquidData.class, PacketRequestLiquidData.class, 0, Side.SERVER); - netWrapper.registerMessage(PacketSendLiquidData.class, PacketSendLiquidData.class, 1, Side.CLIENT); - netWrapper.registerMessage(PacketClearColorCache.class, PacketClearColorCache.class, 2, Side.CLIENT); - netWrapper.registerMessage(PacketKeyPressEvent.class, PacketKeyPressEvent.class, 3, Side.SERVER); - netWrapper.registerMessage(PacketRequestPlayerInfo.class, PacketRequestPlayerInfo.class, 4, Side.SERVER); - netWrapper.registerMessage(PacketSendPlayerInfo.class, PacketSendPlayerInfo.class, 5, Side.CLIENT); - netWrapper.registerMessage(PacketSendCurseStats.class, PacketSendCurseStats.class, 6, Side.CLIENT); - netWrapper.registerMessage(PacketRequestSetSlot.class, PacketRequestSetSlot.class, 7, Side.SERVER); - - metadata.autogenerated = false; - metadata.authorList = authorList; - metadata.url = "https://github.com/sor1n/Jewelrycraft"; - - createEntity(EntityHeart.class, Variables.MODID + ".Heart", 0xFF0000, 0xFF0000, false); - createEntity(EntityHalfHeart.class, Variables.MODID + ".Half-Heart", 0x000000, 0xFF0000, false); - -// EntityRegistry.addSpawn(EntityMob.class, 5, 2, 3, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.plains, BiomeGenBase.beach, BiomeGenBase.coldBeach, BiomeGenBase.frozenRiver); - } - - public void createEntity(Class entity, String entityName, int solidColor, int spotColor, boolean hasSpawnEgg) - { - int randomID = EntityRegistry.findGlobalUniqueEntityId(); - if(hasSpawnEgg) EntityRegistry.registerGlobalEntityID(entity, entityName, randomID, solidColor, spotColor); - else EntityRegistry.registerGlobalEntityID(entity, entityName, randomID); - EntityRegistry.registerModEntity(entity, entityName, randomID, this, 40, 3, true); - } - - /** - * Initializes the world generation and key bindings. - * - * @param e FMLInitializationEvent - */ - @EventHandler - public void init(FMLInitializationEvent e) - { - GameRegistry.registerWorldGenerator(new Generation(), 0); - if (FMLCommonHandler.instance().getSide() == Side.CLIENT) FMLCommonHandler.instance().bus().register(new KeyBindings()); - new GuiHandler(); - } - - /** - * Post initialization of metals, modifiers and others. - * - * @param e FMLPostInitializationEvent - */ - @EventHandler - public void postInit(FMLPostInitializationEvent e) - { - JewelrycraftUtil.addMetals(); - JewelrycraftUtil.jamcrafters(); - EffectsList.postInit(e); - DamageSourceList.postInit(e); - proxy.postInit(); - } - - @Mod.EventHandler - public void serverLoad(FMLServerStartingEvent event) - { - event.registerServerCommand(new JewelrycraftCommands()); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/d08cb0332ee60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/d08cb0332ee60014127dc373d78c1666 new file mode 100644 index 0000000..45a458a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/d08cb0332ee60014127dc373d78c1666 @@ -0,0 +1,580 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.*; +import net.minecraft.client.renderer.tileentity.*; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.*; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.*; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glPushMatrix(); + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + GL11.glPopMatrix(); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); +// RenderHelper.enableStandardItemLighting(); + RenderHelper.disableStandardItemLighting(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/20ee800597e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/20ee800597e3001412c4c4819c88e86b new file mode 100644 index 0000000..0a30812 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/20ee800597e3001412c4c4819c88e86b @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.getCollisionBorderSize()); + this.setBlockBounds(0F, 0F, 0F, 1F, ((TileEntityMidasTouch)tile).target.height, 1F); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/a0b6bcf374e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/a0b6bcf374e300141084bb8bfb075c08 new file mode 100644 index 0000000..9687636 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/a0b6bcf374e300141084bb8bfb075c08 @@ -0,0 +1,37 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart)){ + world.setBlock((int)target.posX, (int)target.posY, (int)target.posZ, BlockList.midasTouchBlock, 0, 2); + TileEntity midasTouchVictim = new TileEntityMidasTouch(target); + world.setTileEntity((int)target.posX, (int)target.posY, (int)target.posZ, midasTouchVictim); + target.setDead(); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/30d2e29d08de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/30d2e29d08de00141043c3025ec60dfc deleted file mode 100644 index f60630b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/30d2e29d08de00141043c3025ec60dfc +++ /dev/null @@ -1,184 +0,0 @@ -package darkknight.jewelrycraft.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = (int)f3; -// int red = ingotColor >> 16 & 0xff; -// int green = ingotColor >> 8 & 0xff; -// int blue = ingotColor & 0xff; - GL11.glColor3f((float)ingotColor % 256, (float)(ingotColor / 256) % 256, (float)(ingotColor / 256 / 256) % 256); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/707c1e6f36e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/707c1e6f36e100141e1cc3c3be242e56 new file mode 100644 index 0000000..f02eb49 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/707c1e6f36e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; +// public static boolean generateVillageNetherstar; + public static boolean canFurnacesGenerateIngots; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + generateVillageNetherstar = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + canFurnacesGenerateIngots = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + maxVillageJewelers = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + jewelerWeight = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + ingotChestMin = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMax = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/904b914b0ade00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/904b914b0ade00141043c3025ec60dfc deleted file mode 100644 index 685d6f7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/904b914b0ade00141043c3025ec60dfc +++ /dev/null @@ -1,185 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int red = (ingotColor >>> 16) & 0xff; - int green = (ingotColor >>> 8) & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/d0582ab82ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/d0582ab82ce60014127dc373d78c1666 new file mode 100644 index 0000000..2b6a941 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/d0582ab82ce60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2 - (!tabList.get(1).enabled?2:0)) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/50f79109fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/50f79109fce40014174fe663e69b8422 new file mode 100644 index 0000000..bcf52b4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/50f79109fce40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.*; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/a0bc584010e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/a0bc584010e60014127dc373d78c1666 new file mode 100644 index 0000000..90b8f66 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/a0bc584010e60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/c02c41de21e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/c02c41de21e60014127dc373d78c1666 new file mode 100644 index 0000000..e69de29 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/f09f6139c8df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/f09f6139c8df00141dc6c962aec96210 deleted file mode 100644 index 9bfe7af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/f09f6139c8df00141dc6c962aec96210 +++ /dev/null @@ -1,92 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectBlazePowder extends ModifierEffects -{ - public EffectBlazePowder() - { - super(new ItemStack(Items.blaze_powder)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemNecklace && pos != -1){ - // Positive for necklace - if (player.isBurning() && rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) player.extinguish(); - // Negative for necklace - if (player.isInWater()) player.attackEntityFrom(DamageSource.drown, 1f - (JewelryNBT.numberOfModifiers(item) - 1) * 0.05F); - } - // Negative for bracelet - if (jewelry instanceof ItemBracelet && pos != -1 && player.isInWater()){ - player.motionX *= 0.6D; - player.motionY *= 0.6D; - player.motionZ *= 0.6D; - player.motionY -= 0.02D; - if (player.isCollidedHorizontally) player.motionY = 0.30000001192092896D; - } - // Negative for earrings - if (jewelry instanceof ItemEarrings && pos != -1){ - if (player.getAir() >= 300) player.setAir(player.getAir() / 2); - else player.setAir(player.getAir() - 1); - } - } - - @Override - public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - // Balanced for ring - if (jewelry instanceof ItemRing && pos != -1 && !player.isInWater()) target.setFire(2); - return false; - } - - @Override - public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - // int pos = JewelryNBT.doesModifierExist(item, modifier); - // if (jewelry instanceof ItemEarrings && pos != -1 && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){ - // //Positive for earrings - // int stackSize = JewelryNBT.modifier(item).get(pos).stackSize; - // player.heal((float)(0.05 * stackSize)); - // return true; - // } - // //Positive for bracelet - // if (jewelry instanceof ItemBracelet && pos != -1) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) return true; - return false; - } - - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - {} - - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (jewelry instanceof ItemEarrings && pos != -1 && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){ - // Positive for earrings - int stackSize = JewelryNBT.modifier(item).get(pos).stackSize; - player.heal((float)(0.05 * stackSize)); - playerInfo.setBoolean("negateDamage", true); - } - // Positive for bracelet - if (jewelry instanceof ItemBracelet && pos != -1) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) playerInfo.setBoolean("negateDamage", true); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/505befdf08e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/505befdf08e60014127dc373d78c1666 new file mode 100644 index 0000000..20bc0a8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/505befdf08e60014127dc373d78c1666 @@ -0,0 +1,60 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + ((JewelryNBT.item(stack) != null) ? JewelryNBT.item(stack).getDisplayName() : "Object"); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) + if(JewelryNBT.item(stack).getItem() instanceof ItemFood) list.add(EnumChatFormatting.DARK_PURPLE + "It's made of solid gold. How are you suppose to eat this?"); + else list.add(EnumChatFormatting.DARK_PURPLE + "Shiny, but useless :("); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/009ded5190e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/009ded5190e3001417b2e384bf7c3702 new file mode 100644 index 0000000..7f38eec --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/009ded5190e3001417b2e384bf7c3702 @@ -0,0 +1,82 @@ +package darkknight.jewelrycraft.tileentity; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityMidasTouch extends TileEntity +{ + public Entity target; + + public TileEntityMidasTouch(Entity target) + { + this.target = target; + } + + /** + * @param nbt + */ + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + NBTTagCompound tag = new NBTTagCompound(); + target.writeToNBT(tag); + int id = EntityList.getEntityID(target); + nbt.setInteger("entityID", id); + nbt.setTag("entity", tag); + } + + /** + * @param nbt + */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + if (nbt.hasKey("entityID") && nbt.hasKey("entity")){ + NBTTagCompound en = (NBTTagCompound)nbt.getTag("entity"); + int entityID = nbt.getInteger("entityID"); + EntityLivingBase entity = (EntityLivingBase)EntityList.createEntityByID(entityID, worldObj); + entity.readFromNBT(en); + target = entity; + } + } + + /** + * + */ + @Override + public void updateEntity() + { + super.updateEntity(); +// System.out.println(target); + } + + /** + * @return + */ + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + /** + * @param net + * @param packet + */ + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + readFromNBT(packet.func_148857_g()); + worldObj.func_147479_m(xCoord, yCoord, zCoord); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/108a9f5210e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/108a9f5210e60014127dc373d78c1666 new file mode 100644 index 0000000..763e12b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/108a9f5210e60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.3F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/6077fb309be3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/6077fb309be3001412c4c4819c88e86b new file mode 100644 index 0000000..92f5ffa --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/6077fb309be3001412c4c4819c88e86b @@ -0,0 +1,96 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public void breakBlock(World world, int i, int j, int k, Block par5, int par6) + { + TileEntityMidasTouch te = (TileEntityMidasTouch)world.getTileEntity(i, j, k); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height), 0)); +// world.removeTileEntity(i, j, k); + System.out.println("drop"); + super.breakBlock(world, i, j, k, par5, par6); + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/c07d2bbd25e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/c07d2bbd25e60014127dc373d78c1666 new file mode 100644 index 0000000..03bc342 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/c07d2bbd25e60014127dc373d78c1666 @@ -0,0 +1,74 @@ +package main.java.tconstruct.client.tabs; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/00cb774c9ce3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/00cb774c9ce3001412c4c4819c88e86b new file mode 100644 index 0000000..782ca64 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/00cb774c9ce3001412c4c4819c88e86b @@ -0,0 +1,33 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + EntityLiving target = ((EntityLiving)midas.target); + target.hurtTime = 0; + float yaw = target.prevRotationYawHead + (target.rotationYawHead - target.prevRotationYawHead); + float yawOffset = target.prevRenderYawOffset + (target.renderYawOffset - target.prevRenderYawOffset); + float pitch = target.prevRotationPitch + (target.rotationPitch - target.prevRotationPitch); + GL11.glRotatef(yawOffset, 0, -1, 0); + GL11.glRotatef(yaw - 90, 0, 1, 0); + GL11.glRotatef(pitch, 0, 0, -1); + GL11.glTranslatef(0.5F, 0.0F, 0.5F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, 0D, 0D, 0D, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/105089d82ae60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/105089d82ae60014127dc373d78c1666 new file mode 100644 index 0000000..8d3478f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/105089d82ae60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || !t.enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla)) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/50ed421e04e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/50ed421e04e50014174fe663e69b8422 new file mode 100644 index 0000000..2f7ec63 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/50ed421e04e50014174fe663e69b8422 @@ -0,0 +1,57 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1); + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/70ce133137e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/70ce133137e100141e1cc3c3be242e56 new file mode 100644 index 0000000..3bb8e1c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/70ce133137e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int MAX_VILLAGE_JEWELERS; + public static int JEWELER_WEIGHT; + public static int INGOT_CHEST_MIN; + public static int INGOT_CHEST_MAX; + public static int INGOT_CHEST_MAX_STACK; + public static int GEM_CHEST_MIN; + public static int GEM_CHEST_MAX; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + JEWELER_WEIGHT = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + INGOT_CHEST_MIN = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX_STACK = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + GEM_CHEST_MIN = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + GEM_CHEST_MAX = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/80673fdbfae40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/80673fdbfae40014174fe663e69b8422 new file mode 100644 index 0000000..b59c9e4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/80673fdbfae40014174fe663e69b8422 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.item; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import javax.imageio.ImageIO; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.effects.ModifierEffects; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldifiedObject extends Item +{ + public ItemGoldifiedObject() + { + super(); + } + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + public String getItemStackDisplayName(ItemStack stack) + { + if (JewelryNBT.ingot(stack) != null && Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) > 0) return JewelryNBT.ingot(stack).getDisplayName().replace("Ingot", " ").trim() + " " + ("" + StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + return ("" + StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/30320ac0fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/30320ac0fde40014174fe663e69b8422 new file mode 100644 index 0000000..5305900 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/30320ac0fde40014174fe663e69b8422 @@ -0,0 +1,161 @@ +package darkknight.jewelrycraft.item; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; +import org.lwjgl.input.Keyboard; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.ReflectionHelper; +import cpw.mods.fml.relauncher.Side; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class ItemThiefGloves extends Item +{ + public Random rand = new Random(); + + public ItemThiefGloves() + { + setCreativeTab(CreativeTabs.tabTools); + setMaxStackSize(1); + setMaxDamage(10); + } + + /** + * @param stack + * @param player + * @param entity + * @return + */ + @Override + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity) + { + if (entity instanceof EntityVillager){ + EntityVillager villager = (EntityVillager)entity; + int wealth = (Integer)ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "wealth", "field_70956_bz"); + MerchantRecipeList buyingList = (MerchantRecipeList)ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "buyingList", "field_70963_i"); + int chance = 5; + boolean areOtherVillagersAround = false, canTheySeeYou = false; + AxisAlignedBB axisalignedbb = villager.boundingBox.expand(4.0D, 4.0D, 4.0D); + List entities = villager.worldObj.getEntitiesWithinAABBExcludingEntity(villager, axisalignedbb); + for(Object s: entities) + if (s instanceof EntityVillager){ + areOtherVillagersAround = true; + chance += rand.nextInt(2); + if (((EntityVillager)s).canEntityBeSeen(player)){ + chance += 2; + canTheySeeYou = true; + } + } + if (villager.canEntityBeSeen(player)) chance += 5; + if (player.isPotionActive(Potion.invisibility)) chance -= 0.8 * chance; + if (player.capabilities.isCreativeMode) chance = 1; + int steal = rand.nextInt(chance); + if (steal == 0){ + villager.dropItem(Items.emerald, wealth); + ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 0, "wealth", "field_70956_bz"); + } + if (buyingList != null){ + Iterator iterator = buyingList.iterator(); + if (steal == 0){ + while (iterator.hasNext()){ + MerchantRecipe recipe = (MerchantRecipe)iterator.next(); + int toolUses = (Integer)ReflectionHelper.getPrivateValue(MerchantRecipe.class, recipe, "toolUses", "field_77400_d"); + int quantity; + if (recipe.getItemToSell().isStackable()) quantity = recipe.getItemToSell().stackSize * (7 - toolUses); + else quantity = recipe.getItemToSell().stackSize; + ItemStack s = new ItemStack(recipe.getItemToSell().getItem(), quantity, recipe.getItemToSell().getItemDamage()); + s.setTagCompound(recipe.getItemToSell().getTagCompound()); + if (player.inventory.addItemStackToInventory(s)) ; + else villager.entityDropItem(s, 0); + if (!player.capabilities.isCreativeMode) JewelrycraftUtil.addCursePoints(player, 5); + player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + ": Hmmm... I seem to have lost my " + s.getDisplayName() + "!")); + stack.damageItem(1, player); + } + buyingList.clear(); + ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 300, "timeUntilReset", "field_70961_j"); + ReflectionHelper.setPrivateValue(EntityVillager.class, villager, true, "needsInitilization", "field_70959_by"); + player.addChatMessage(new ChatComponentText("You hear a faint whisper in your ear: ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "Those who steal but don't get caught get rewarded and do not.")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "Embrace the path you have gone, for the darkness will not")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "dwell on.")); + }else{ + stack.damageItem(1, player); + if (!player.capabilities.isCreativeMode) JewelrycraftUtil.addCursePoints(player, 25); + if (player.isPotionActive(Potion.invisibility)){ + player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " sensed a strange presence around him, making him cling on to his items. You didn't get anything.")); + } + else{ + if (areOtherVillagersAround){ + if (!canTheySeeYou){ + player.addChatMessage(new ChatComponentText("As he was passing by, a random villager caught you trying to steal from Villager #" + villager.getProfession() + ".")); + player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " curses you for the attempt.")); + return true; + } + else{ + player.addChatMessage(new ChatComponentText("A villager nearby saw you trying to steal from Villager #" + villager.getProfession() + ".")); + player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " curses you for the attempt.")); + return true; + } + }else{ + player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " caught you trying to steal from him.")); + player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " curses you for the attempt.")); + return true; + } + } + } + } + return true; + }else return super.itemInteractionForEntity(stack, player, entity); + } + + /** + * @param stack + * @param player + * @param list + * @param par4 + */ + @Override + @SuppressWarnings ("unchecked") + public void addInformation(ItemStack stack, EntityPlayer player, @SuppressWarnings ("rawtypes") List list, boolean par4) + { + if (!shouldAddAdditionalInfo()) list.add(EnumChatFormatting.GRAY + additionalInfoInstructions()); + else{ + list.add(EnumChatFormatting.GRAY + "Right click with the gloves,"); + list.add(EnumChatFormatting.GRAY + "while sneaking, on a villager"); + list.add(EnumChatFormatting.GRAY + "to steal his stuff."); + } + } + + /** + * @return + */ + public static boolean shouldAddAdditionalInfo() + { + if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) return true; + return false; + } + + /** + * @return + */ + public static String additionalInfoInstructions() + { + String message = "\247oPress \247b\2477\247o for more information."; + return message; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/403b2d4afbe40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/403b2d4afbe40014174fe663e69b8422 new file mode 100644 index 0000000..8ea2641 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/403b2d4afbe40014174fe663e69b8422 @@ -0,0 +1,61 @@ +package darkknight.jewelrycraft.item; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import javax.imageio.ImageIO; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.effects.ModifierEffects; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldifiedObject extends Item +{ + public ItemGoldifiedObject() + { + super(); + } + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/9043b9010cde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/9043b9010cde00141043c3025ec60dfc deleted file mode 100644 index 1ee0a95..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/9043b9010cde00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; -// System.out.println(red + " " + green + " " + blue); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glColorMask(true, false, true, false); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/904d6c6392e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/904d6c6392e3001417b2e384bf7c3702 new file mode 100644 index 0000000..089799a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/904d6c6392e3001417b2e384bf7c3702 @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, 0D, 0D, 0D, 0F, 1F); +// RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, midas.target.posX - Minecraft.getMinecraft().thePlayer.posX, midas.target.posY - Minecraft.getMinecraft().thePlayer.posY, midas.target.posZ - Minecraft.getMinecraft().thePlayer.posZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/10132f5697e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/10132f5697e3001412c4c4819c88e86b new file mode 100644 index 0000000..48775e1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/10132f5697e3001412c4c4819c88e86b @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.width); + this.setBlockBounds(0F, 0F, 0F, ((TileEntityMidasTouch)tile).target.width, ((TileEntityMidasTouch)tile).target.height, ((TileEntityMidasTouch)tile).target.width); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/60685a52dce50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/60685a52dce50014109ec019d2f6c0dc new file mode 100644 index 0000000..3cf0fc4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/60685a52dce50014109ec019d2f6c0dc @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.*; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget ") || currItem.getItem().getUnlocalizedName().toLowerCase().contains(" nugget")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot ") || currItem.getItem().getUnlocalizedName().toLowerCase().contains(" ingot")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/60cd21f40bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/60cd21f40bde00141043c3025ec60dfc deleted file mode 100644 index 3d0ebf5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/60cd21f40bde00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - System.out.println(red + " " + green + " " + blue); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glClearColor(1F, 1F, 1F, 1F); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/c07592ad26e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/c07592ad26e60014127dc373d78c1666 new file mode 100644 index 0000000..e65bf88 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/c07592ad26e60014127dc373d78c1666 @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft.client.gui; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class InventoryTabVanilla extends AbstractTab +{ + public InventoryTabVanilla() + { + super(0, 0, 0, new ItemStack(Blocks.crafting_table)); + } + + @Override + public void onTabClicked () + { + TabRegistry.openInventoryGui(); + } + + @Override + public boolean shouldAddToList () + { + return true; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/8044e5d790e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/8044e5d790e3001417b2e384bf7c3702 new file mode 100644 index 0000000..bc8f775 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/8044e5d790e3001417b2e384bf7c3702 @@ -0,0 +1,82 @@ +package darkknight.jewelrycraft.tileentity; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityMidasTouch extends TileEntity +{ + public Entity target; + + public TileEntityMidasTouch() + {} + + public void setEntity(Entity ent) + { + target = ent; + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + if (target != null){ + int id = EntityList.getEntityID(target); + NBTTagCompound tag = new NBTTagCompound(); + target.writeToNBT(tag); + nbt.setInteger("entityID", id); + nbt.setTag("entity", tag); + } + } + + /** + * @param nbt + */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + NBTTagCompound en = (NBTTagCompound)nbt.getTag("entity"); + int entityID = nbt.getInteger("entityID"); + EntityLivingBase entity = (EntityLivingBase)EntityList.createEntityByID(entityID, worldObj); + entity.readFromNBT(en); + target = entity; + } + + /** + * + */ + @Override + public void updateEntity() + { + super.updateEntity(); + // System.out.println(target); + } + + /** + * @return + */ + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + /** + * @param net + * @param packet + */ + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + readFromNBT(packet.func_148857_g()); + worldObj.func_147479_m(xCoord, yCoord, zCoord); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/40594fd502e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/40594fd502e50014174fe663e69b8422 new file mode 100644 index 0000000..f6be9b5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/40594fd502e50014174fe663e69b8422 @@ -0,0 +1,57 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(6); + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/9009625127e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/9009625127e60014127dc373d78c1666 new file mode 100644 index 0000000..5e177be --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/9009625127e60014127dc373d78c1666 @@ -0,0 +1,70 @@ +package darkknight.jewelrycraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.TabRegistry; +import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab; +import darkknight.jewelrycraft.events.KeyBindings; + +public class GuiJewelry extends GuiContainer +{ + ResourceLocation texture; + + /** + * @param containerJewelryTab + * @param texture + */ + public GuiJewelry(ContainerJewelryTab containerJewelryTab, ResourceLocation texture) + { + super(containerJewelryTab); + xSize = 194; + ySize = 166; + this.texture = texture; + } + + /** + * @param f + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) + { + GL11.glColor3f(1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(-guiLeft, guiTop, 0, 0, xSize, ySize); + } + + /** + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + {} + + /** + * @param charecter + * @param key + */ + @Override + protected void keyTyped(char charecter, int key) + { + super.keyTyped(charecter, key); + if (key == KeyBindings.inventory.getKeyCode()) mc.thePlayer.closeScreen(); + } + + @Override + public void initGui () + { + super.initGui(); + int cornerX = -guiLeft; + int cornerY = guiTop; + this.buttonList.clear(); + TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class); + TabRegistry.addTabsToList(this.buttonList); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/a088aa6692e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/a088aa6692e3001417b2e384bf7c3702 new file mode 100644 index 0000000..14219fd --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/a088aa6692e3001417b2e384bf7c3702 @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, 0D, 0D, 0D, 1F, 1F); +// RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, midas.target.posX - Minecraft.getMinecraft().thePlayer.posX, midas.target.posY - Minecraft.getMinecraft().thePlayer.posY, midas.target.posZ - Minecraft.getMinecraft().thePlayer.posZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/b074f8a10fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/b074f8a10fe60014127dc373d78c1666 new file mode 100644 index 0000000..95f6609 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/b074f8a10fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 1.0F); + GL11.glRotatef(65f, 0f, 1f, 0f); + GL11.glRotatef(-15f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/d03d8f064ae0001413f1950b5bdb0d24 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/d03d8f064ae0001413f1950b5bdb0d24 deleted file mode 100644 index 5bb50a7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/d03d8f064ae0001413f1950b5bdb0d24 +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Mod made by DarkKnight during the Modjam 3 - * It's an awesome mod - * I love me! :D - */ -package darkknight.jewelrycraft; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Logger; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.gen.structure.MapGenStructureIO; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.oredict.OreDictionary; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.ModMetadata; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.VillagerRegistry; -import cpw.mods.fml.relauncher.Side; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.client.gui.GuiHandler; -import darkknight.jewelrycraft.commands.JewelrycraftCommands; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.CurseList; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.effects.EffectsList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.events.BucketHandler; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.events.KeyBindings; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketKeyPressEvent; -import darkknight.jewelrycraft.network.PacketRequestLiquidData; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketRequestSetSlot; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendLiquidData; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.proxy.CommonProxy; -import darkknight.jewelrycraft.recipes.CraftingRecipes; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.Variables; -import darkknight.jewelrycraft.worldGen.Generation; -import darkknight.jewelrycraft.worldGen.village.ComponentJewelry; -import darkknight.jewelrycraft.worldGen.village.JCTrades; -import darkknight.jewelrycraft.worldGen.village.VillageJewelryHandler; - -@Mod (modid = Variables.MODID, name = Variables.MODNAME, version = Variables.VERSION) -public class JewelrycraftMod -{ - @Instance (Variables.MODID) - public static JewelrycraftMod instance; - @SidedProxy (clientSide = "darkknight.jewelrycraft.proxy.ClientProxy", serverSide = "darkknight.jewelrycraft.proxy.CommonProxy") - public static CommonProxy proxy; - public static final Logger logger = Logger.getLogger("Jewelrycraft"); - public static File dir; - public static CreativeTabs jewelrycraft = new CreativeTabs(Variables.MODID){ - @Override - public Item getTabIconItem() - { - return Item.getItemFromBlock(BlockList.jewelCraftingTable); - } - }; - public static CreativeTabs liquids = new CreativeTabLiquids("Liquids"); - public static NBTTagCompound saveData = new NBTTagCompound(); - public static NBTTagCompound clientData = new NBTTagCompound(); - public static File liquidsConf; - public static SimpleNetworkWrapper netWrapper; - public static boolean fancyRender; - - /** - * Pre initialization of mod stuff. - * - * @param e FMLPreInitializationEvent - * @throws IOException Signals that an I/O exception has occurred. - */ - @EventHandler - public void preInit(FMLPreInitializationEvent e) throws IOException - { - ConfigHandler.preInit(e); - BlockList.preInit(e); - ItemList.preInit(e); - CraftingRecipes.preInit(e); - CurseList.preInit(e); - OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot)); - OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre)); - VillagerRegistry.instance().registerVillagerId(3000); - VillagerRegistry.instance().registerVillageTradeHandler(3000, new JCTrades()); - VillagerRegistry.instance().registerVillageCreationHandler(new VillageJewelryHandler()); - try{ - MapGenStructureIO.func_143031_a(ComponentJewelry.class, Variables.MODID + ":Jewelry"); - } - catch(Throwable e2){ - logger.severe("Error registering Jewelrycraft Structures with Vanilla Minecraft: this is expected in versions earlier than 1.7.10"); - } - MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); - MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE); - BucketHandler.INSTANCE.buckets.put(BlockList.moltenMetal, ItemList.bucket); - - ModMetadata metadata = e.getModMetadata(); - List authorList = new ArrayList(); - - authorList.add("OnyxDarkKnight"); - authorList.add("bspkrs"); - authorList.add("domi1819"); - - dir = e.getModConfigurationDirectory(); - proxy.preInit(); - netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Variables.MODID); - netWrapper.registerMessage(PacketRequestLiquidData.class, PacketRequestLiquidData.class, 0, Side.SERVER); - netWrapper.registerMessage(PacketSendLiquidData.class, PacketSendLiquidData.class, 1, Side.CLIENT); - netWrapper.registerMessage(PacketClearColorCache.class, PacketClearColorCache.class, 2, Side.CLIENT); - netWrapper.registerMessage(PacketKeyPressEvent.class, PacketKeyPressEvent.class, 3, Side.SERVER); - netWrapper.registerMessage(PacketRequestPlayerInfo.class, PacketRequestPlayerInfo.class, 4, Side.SERVER); - netWrapper.registerMessage(PacketSendPlayerInfo.class, PacketSendPlayerInfo.class, 5, Side.CLIENT); - netWrapper.registerMessage(PacketSendCurseStats.class, PacketSendCurseStats.class, 6, Side.CLIENT); - netWrapper.registerMessage(PacketRequestSetSlot.class, PacketRequestSetSlot.class, 7, Side.SERVER); - - metadata.autogenerated = false; - metadata.authorList = authorList; - metadata.url = "https://github.com/sor1n/Jewelrycraft"; - - createEntity(EntityHeart.class, Variables.MODID + ".Heart", 0xFF0000, 0xFF0000, false); - createEntity(EntityHalfHeart.class, Variables.MODID + ".Half-Heart", 0x000000, 0xFF0000, false); - -// EntityRegistry.addSpawn(EntityMob.class, 5, 2, 3, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.plains, BiomeGenBase.beach, BiomeGenBase.coldBeach, BiomeGenBase.frozenRiver); - } - - public void createEntity(Class entity, String entityName, int solidColor, int spotColor, boolean hasSpawnEgg) - { - int randomID = EntityRegistry.findGlobalUniqueEntityId(); - if(hasSpawnEgg) EntityRegistry.registerGlobalEntityID(entity, entityName, randomID, solidColor, spotColor); - else EntityRegistry.registerGlobalEntityID(entity, entityName, randomID); - EntityRegistry.registerModEntity(entity, entityName, randomID, this, 40, 3, true); - } - - /** - * Initializes the world generation and key bindings. - * - * @param e FMLInitializationEvent - */ - @EventHandler - public void init(FMLInitializationEvent e) - { - GameRegistry.registerWorldGenerator(new Generation(), 0); - if (FMLCommonHandler.instance().getSide() == Side.CLIENT) FMLCommonHandler.instance().bus().register(new KeyBindings()); - new GuiHandler(); - } - - /** - * Post initialization of metals, modifiers and others. - * - * @param e FMLPostInitializationEvent - */ - @EventHandler - public void postInit(FMLPostInitializationEvent e) - { - JewelrycraftUtil.addMetals(); - JewelrycraftUtil.jamcrafters(); - EffectsList.postInit(e); - DamageSourceList.postInit(e); - proxy.postInit(); - } - - @Mod.EventHandler - public void serverLoad(FMLServerStartingEvent event) - { - event.registerServerCommand(new JewelrycraftCommands()); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/0094abb608de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/0094abb608de00141043c3025ec60dfc deleted file mode 100644 index 89fcc33..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/0094abb608de00141043c3025ec60dfc +++ /dev/null @@ -1,184 +0,0 @@ -package darkknight.jewelrycraft.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = (int)f3; -// int red = ingotColor >> 16 & 0xff; -// int green = ingotColor >> 8 & 0xff; -// int blue = ingotColor & 0xff; - GL11.glColor3f(ingotColor % 256, ingotColor / 256 % 256, (ingotColor / 256 / 256) % 256); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/d0b0f0ab3de100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/d0b0f0ab3de100141e1cc3c3be242e56 new file mode 100644 index 0000000..6308908 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/d0b0f0ab3de100141e1cc3c3be242e56 @@ -0,0 +1,26 @@ +package darkknight.jewelrycraft.config; + +import cpw.mods.fml.client.config.GuiConfig; +import cpw.mods.fml.client.config.IConfigElement; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.common.config.ConfigElement; +import java.util.ArrayList; +import java.util.List; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigGui extends GuiConfig +{ + public ConfigGui(GuiScreen parent) + { + super(parent, getElements(), Variables.MODID, Variables.MODID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.INSTANCE.config.toString())); + } + + @SuppressWarnings ({"rawtypes"}) + private static List getElements() + { + List list = new ArrayList(ConfigHandler.categories.length); + for(String category: ConfigHandler.categories) + list.add(new ConfigElement(ConfigHandler.INSTANCE.config.getCategory(category))); + return list; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/504564742ee60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/504564742ee60014127dc373d78c1666 new file mode 100644 index 0000000..ac5bdd4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/504564742ee60014127dc373d78c1666 @@ -0,0 +1,580 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.*; +import net.minecraft.client.renderer.tileentity.*; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.*; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.*; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glPushMatrix(); + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + GL11.glPopMatrix(); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + RenderHelper.enableStandardItemLighting(); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } +// RenderHelper.disableStandardItemLighting(); + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/200ef2fd26de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/200ef2fd26de00141043c3025ec60dfc deleted file mode 100644 index 65c1775..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/200ef2fd26de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 40, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/30f1557c29de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/30f1557c29de00141043c3025ec60dfc deleted file mode 100644 index 03f6fe0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/30f1557c29de00141043c3025ec60dfc +++ /dev/null @@ -1,121 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.commands; - -/** - * @author Sorin - * - */ -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; - -public class JewelrycraftCommands extends CommandBase -{ - private List aliases; - - public JewelrycraftCommands() - { - this.aliases = new ArrayList(); - this.aliases.add("jw"); - this.aliases.add("jewelry"); - } - - @Override - public String getCommandName() - { - return "jewelrycraft"; - } - - @Override - public String getCommandUsage(ICommandSender var1) - { - String use = "/jewelrycraft [points] | "; - use += "/jewelrycraft |"; - use += "/jewelrycraft "; - return use; - } - - @Override - public List getCommandAliases() - { - return aliases; - } - - @Override - public void processCommand(ICommandSender commandSender, String[] astring) - { - if (astring.length == 0 || astring[0].equals("help")) throw new WrongUsageException(getCommandUsage(commandSender)); - if (astring[0].equals("getCursePoints")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - commandSender.addChatMessage(new ChatComponentTranslation(Integer.toString(JewelrycraftUtil.getCursePoints(entityplayermp)))); - }else if (astring[0].equals("addCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points); - }else if (astring[0].equals("setCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points - JewelrycraftUtil.getCursePoints(entityplayermp)); - }else if (astring[0].equals("addModifier")){ - ItemStack item = new ItemStack(CommandBase.getItemByText(commandSender, astring[1])); - EntityPlayerMP entityplayermp = getPlayer(commandSender, commandSender.getCommandSenderName()); - ArrayList modifier = new ArrayList(); - modifier.add(item); - JewelryNBT.addModifiers(entityplayermp.getCurrentEquippedItem(), modifier); - }else if (astring[0].equals("addCurse")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - int curse = Integer.valueOf(astring[2]); - int grade = Integer.valueOf(astring[3]); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(entityplayermp, "Jewelrycraft"); - if(curse < Curse.getCurseList().size() && grade <= 2) - { - EntityEventHandler.addCurse(entityplayermp, playerInfo, curse, grade); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - else if(curse >= Curse.getCurseList().size()) entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse ID exceedes the maximum value of " + (Curse.getCurseList().size() - 1))); - else entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse grade exceedes the maximum value of 2")); - - } - } - - @Override - public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring) - { - final List MATCHES = new LinkedList(); - final String ARG_LC = astring[astring.length - 1].toLowerCase(); - if (astring.length == 1){ - if ("addCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCursePoints"); - if ("getCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("getCursePoints"); - if ("setCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("setCursePoints"); - if ("addModifier".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addModifier"); - if ("addCurse".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCurse"); - }else if (astring.length == 2){ - if (!astring[0].equals("addModifier")){ - for(String un: MinecraftServer.getServer().getAllUsernames()) - if (un.toLowerCase().startsWith(ARG_LC)) MATCHES.add(un); - }else if (!astring[0].equals("addCurse")) return getListOfStringsFromIterableMatchingLastWord(astring, Item.itemRegistry.getKeys()); - } - return MATCHES.isEmpty() ? null : MATCHES; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/502b9fa69ce3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/502b9fa69ce3001412c4c4819c88e86b new file mode 100644 index 0000000..f0737fb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/502b9fa69ce3001412c4c4819c88e86b @@ -0,0 +1,33 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + EntityLiving target = ((EntityLiving)midas.target); + target.hurtTime = 0; + float yaw = target.prevRotationYawHead + (target.rotationYawHead - target.prevRotationYawHead); + float yawOffset = target.prevRenderYawOffset + (target.renderYawOffset - target.prevRenderYawOffset); + float pitch = target.prevRotationPitch + (target.rotationPitch - target.prevRotationPitch); +// GL11.glRotatef(yawOffset, 0, -1, 0); +// GL11.glRotatef(yaw - 90, 0, 1, 0); +// GL11.glRotatef(pitch, 0, 0, -1); + GL11.glTranslatef(0.5F, 0.0F, 0.5F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(target, midas.xCoord - RenderManager.instance.renderPosX, midas.yCoord - RenderManager.instance.renderPosY, midas.zCoord - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/60b5788803e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/60b5788803e60014127dc373d78c1666 new file mode 100644 index 0000000..ca3dde4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/60b5788803e60014127dc373d78c1666 @@ -0,0 +1,40 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.block.BlockMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +/** + * @author Sorin + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + // System.out.println("Broken " + event.getResult()); + ItemStack item = event.getPlayer().inventory.getCurrentItem(); + if (event.block instanceof BlockMidasTouch && item != null && event.block.getHarvestLevel(3) >= item.getItem().getHarvestLevel(item, "pickaxe")){ + TileEntityMidasTouch te = (TileEntityMidasTouch)event.world.getTileEntity(event.x, event.y, event.z); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + } + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/e0f28f5e03e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/e0f28f5e03e60014127dc373d78c1666 new file mode 100644 index 0000000..f1a1d49 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/e0f28f5e03e60014127dc373d78c1666 @@ -0,0 +1,41 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.block.BlockMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +/** + * @author Sorin + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + // System.out.println("Broken " + event.getResult()); + ItemStack item = event.getPlayer().inventory.getCurrentItem(); + if (event.block instanceof BlockMidasTouch && item != null && item.getItem().canHarvestBlock(event.block, item)){ + System.out.println(event.block.getHarvestLevel(3) + " " + item.getItem().getHarvestLevel(item, "pickaxe")); + TileEntityMidasTouch te = (TileEntityMidasTouch)event.world.getTileEntity(event.x, event.y, event.z); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + } + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/80728a19fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/80728a19fde40014174fe663e69b8422 new file mode 100644 index 0000000..5199975 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/80728a19fde40014174fe663e69b8422 @@ -0,0 +1,50 @@ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldifiedObject extends Item +{ + public ItemGoldifiedObject() + {} + + public ItemGoldifiedObject(Material mat) + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/101bc69d0bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/101bc69d0bde00141043c3025ec60dfc deleted file mode 100644 index 6bcb90f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/101bc69d0bde00141043c3025ec60dfc +++ /dev/null @@ -1,185 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - System.out.println((int)f3 + " " + ingotColor); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/508cb5f72be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/508cb5f72be60014127dc373d78c1666 new file mode 100644 index 0000000..841214c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/508cb5f72be60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || t instanceof TabJewelry){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || tab instanceof TabJewelry) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/90e5a94627e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/90e5a94627e60014127dc373d78c1666 new file mode 100644 index 0000000..7cf06e8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/90e5a94627e60014127dc373d78c1666 @@ -0,0 +1,70 @@ +package darkknight.jewelrycraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.TabRegistry; +import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab; +import darkknight.jewelrycraft.events.KeyBindings; + +public class GuiJewelry extends GuiContainer +{ + ResourceLocation texture; + + /** + * @param containerJewelryTab + * @param texture + */ + public GuiJewelry(ContainerJewelryTab containerJewelryTab, ResourceLocation texture) + { + super(containerJewelryTab); + xSize = 194; + ySize = 166; + this.texture = texture; + } + + /** + * @param f + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) + { + GL11.glColor3f(1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + } + + /** + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + {} + + /** + * @param charecter + * @param key + */ + @Override + protected void keyTyped(char charecter, int key) + { + super.keyTyped(charecter, key); + if (key == KeyBindings.inventory.getKeyCode()) mc.thePlayer.closeScreen(); + } + + @Override + public void initGui () + { + super.initGui(); + int cornerX = -guiLeft; + int cornerY = guiTop; + this.buttonList.clear(); + TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class); + TabRegistry.addTabsToList(this.buttonList); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b09d7740fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b09d7740fce40014174fe663e69b8422 new file mode 100644 index 0000000..a781774 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b09d7740fce40014174fe663e69b8422 @@ -0,0 +1,67 @@ +package darkknight.jewelrycraft.item; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import javax.imageio.ImageIO; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.effects.ModifierEffects; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldifiedObject extends Item +{ + public ItemGoldifiedObject() + { + } + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b0e9409a31e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b0e9409a31e100141e1cc3c3be242e56 new file mode 100644 index 0000000..9f6c7cc --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b0e9409a31e100141e1cc3c3be242e56 @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.config; + +import cpw.mods.fml.client.config.GuiConfig; +import cpw.mods.fml.client.config.IConfigElement; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.common.config.ConfigElement; +import java.util.ArrayList; +import java.util.List; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigGui extends GuiConfig +{ + public ConfigGui(GuiScreen parent) + { + super(parent, getElements(), Variables.MODID, Variables.MODID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.INSTANCE.config.toString())); + } + + @SuppressWarnings ({"rawtypes"}) + private static List getElements() + { + List list = new ArrayList(ConfigHandler.categories.length); + for(String category: ConfigHandler.categories){ + list.add(new ConfigElement(ConfigHandler.INSTANCE.config.getCategory(category.toLowerCase()))); + } + return list; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b0f1fd2f02de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b0f1fd2f02de00141043c3025ec60dfc deleted file mode 100644 index 9d36c89..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b0f1fd2f02de00141043c3025ec60dfc +++ /dev/null @@ -1,272 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - EntityPlayer player1 = worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 7F); - if (player1 != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player1, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - EntityPlayer player = worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 6F); - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/e0de3db82bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/e0de3db82bde00141043c3025ec60dfc deleted file mode 100644 index ba0db57..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/e0de3db82bde00141043c3025ec60dfc +++ /dev/null @@ -1,123 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.commands; - -/** - * @author Sorin - * - */ -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; - -public class JewelrycraftCommands extends CommandBase -{ - private List aliases; - - public JewelrycraftCommands() - { - this.aliases = new ArrayList(); - this.aliases.add("jw"); - this.aliases.add("jewelry"); - } - - @Override - public String getCommandName() - { - return "jewelrycraft"; - } - - @Override - public String getCommandUsage(ICommandSender var1) - { - String use = "/jewelrycraft [points] | "; -// use += "/jewelrycraft |"; -// use += "/jewelrycraft "; - return use; - } - - @Override - public List getCommandAliases() - { - return aliases; - } - - @Override - public void processCommand(ICommandSender commandSender, String[] astring) - { - if (astring.length == 0 || astring[0].equals("help")) throw new WrongUsageException(getCommandUsage(commandSender)); - if (astring[0].equals("getCursePoints")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - commandSender.addChatMessage(new ChatComponentTranslation(Integer.toString(JewelrycraftUtil.getCursePoints(entityplayermp)))); - }else if (astring[0].equals("addCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points); - }else if (astring[0].equals("setCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points - JewelrycraftUtil.getCursePoints(entityplayermp)); - } -// else if (astring[0].equals("addModifier")){ -// ItemStack item = new ItemStack(CommandBase.getItemByText(commandSender, astring[1])); -// EntityPlayerMP entityplayermp = getPlayer(commandSender, commandSender.getCommandSenderName()); -// ArrayList modifier = new ArrayList(); -// modifier.add(item); -// JewelryNBT.addModifiers(entityplayermp.getCurrentEquippedItem(), modifier); -// } -// else if (astring[0].equals("addCurse")){ -// EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); -// int curse = Integer.valueOf(astring[2]); -// int grade = Integer.valueOf(astring[3]); -// NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(entityplayermp, "Jewelrycraft"); -// if(curse < Curse.getCurseList().size() && grade <= 2) -// { -// EntityEventHandler.addCurse(entityplayermp, playerInfo, curse, grade); -// JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); -// } -// else if(curse >= Curse.getCurseList().size()) entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse ID exceedes the maximum value of " + (Curse.getCurseList().size() - 1))); -// else entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse grade exceedes the maximum value of 2")); -// -// } - } - - @Override - public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring) - { - final List MATCHES = new LinkedList(); - final String ARG_LC = astring[astring.length - 1].toLowerCase(); - if (astring.length == 1){ - if ("addCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCursePoints"); - if ("getCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("getCursePoints"); - if ("setCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("setCursePoints"); -// if ("addModifier".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addModifier"); -// if ("addCurse".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCurse"); - }else if (astring.length == 2){ - if (!astring[0].equals("addModifier")){ - for(String un: MinecraftServer.getServer().getAllUsernames()) - if (un.toLowerCase().startsWith(ARG_LC)) MATCHES.add(un); - }else if (!astring[0].equals("addCurse")) return getListOfStringsFromIterableMatchingLastWord(astring, Item.itemRegistry.getKeys()); - } - return MATCHES.isEmpty() ? null : MATCHES; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/00bcf92d8ee3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/00bcf92d8ee3001417b2e384bf7c3702 new file mode 100644 index 0000000..55d81d5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/00bcf92d8ee3001417b2e384bf7c3702 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glColor4f(1F, 0.0F, 1.0F, 0.3F); + GL11.glTranslatef(0.5F, 0.0F, 0.5F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + RenderManager.instance.renderEntityStatic(midas.target, 1F, false); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/1058fac532e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/1058fac532e100141e1cc3c3be242e56 new file mode 100644 index 0000000..e69de29 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/90919bf50ade00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/90919bf50ade00141043c3025ec60dfc deleted file mode 100644 index 5f2a423..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/90919bf50ade00141043c3025ec60dfc +++ /dev/null @@ -1,185 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/b02d0de436e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/b02d0de436e100141e1cc3c3be242e56 new file mode 100644 index 0000000..8e85ae6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/b02d0de436e100141e1cc3c3be242e56 @@ -0,0 +1,454 @@ +package darkknight.jewelrycraft.worldGen.village; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureVillagePieces; +import net.minecraft.world.gen.structure.StructureVillagePieces.Start; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.ItemMolds; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class ComponentJewelry extends StructureVillagePieces.House1 +{ + private int averageGroundLevel = -1; + + /** + * + */ + public ComponentJewelry() + {} + + /** + * @param par1ComponentVillageStartPiece + * @param par2 + * @param par3Random + * @param par4StructureBoundingBox + * @param par5 + */ + public ComponentJewelry(Start par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) + { + super(); + coordBaseMode = par5; + boundingBox = par4StructureBoundingBox; + } + + /** + * @param villagePiece + * @param pieces + * @param random + * @param p1 + * @param p2 + * @param p3 + * @param p4 + * @param p5 + * @return + */ + @SuppressWarnings ("rawtypes") + public static ComponentJewelry buildComponent(Start villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 11, 5, 12, p4); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentJewelry(villagePiece, p5, random, structureboundingbox, p4) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the end, it adds Fences... + * + * @param world + * @param random + * @param sbb + * @return + */ + @Override + public boolean addComponentParts(World world, Random random, StructureBoundingBox sbb) + { + if (averageGroundLevel < 0){ + averageGroundLevel = getAverageGroundLevel(world, sbb); + if (averageGroundLevel < 0) return true; + boundingBox.offset(0, averageGroundLevel - boundingBox.maxY + 3, 0); + } + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace) + */ + fillWithBlocks(world, sbb, 0, 0, 6, 10, 5, 11, Block.getBlockById(0), Block.getBlockById(0), false); + fillWithBlocks(world, sbb, 2, 0, 0, 8, 5, 5, Block.getBlockById(0), Block.getBlockById(0), false); + // Pillars + fillWithBlocks(world, sbb, 2, 0, 0, 2, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 2, 0, 3, 2, 3, 3, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 0, 8, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 3, 8, 3, 3, Blocks.log, Blocks.log, false); + // Walls + fillWithBlocks(world, sbb, 2, 0, 1, 2, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 2, 0, 4, 2, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 1, 8, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 4, 8, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 3, 0, 0, 7, 3, 0, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 3, 6, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 11, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 6, 0, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 10, 0, 6, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + // Roof + for(int i = 3; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 2, i, 4, j, sbb); + for(int i = 3; i <= 7; i++) + for(int j = 6; j <= 6; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, i, 4, j, sbb); + for(int i = 1; i <= 9; i++) + for(int j = 7; j <= 10; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 3, i, 4, j, sbb); + for(int i = 2; i <= 8; i++) + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, i, 4, 0, sbb); + for(int i = 1; i <= 5; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 2, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 8, 4, i, sbb); + } + for(int i = 0; i <= 2; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 6, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i + 8, 4, 6, sbb); + } + for(int i = 7; i <= 11; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 0, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 10, 4, i, sbb); + } + for(int i = 0; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 11, sbb); + // Base + for(int i = 2; i <= 8; i++) + for(int j = 0; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.planks, 1, i, 0, j, sbb); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 0, 11, Blocks.stonebrick, Blocks.stonebrick, false); + for(int i = 6; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 5, 0, i, sbb); + for(int i = 7; i <= 10; i++){ + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 1, 0, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 9, 0, i, sbb); + } + // Decorations + placeDoorAtCurrentPosition(world, sbb, random, 6, 1, 0, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeDoorAtCurrentPosition(world, sbb, random, 5, 1, 6, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 3, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 4, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 3, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 3, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 7, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 7, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 10, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 9, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 9, sbb); + int bgCarpetColor = random.nextInt(16); + for(int i = 4; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.carpet, bgCarpetColor, i, 1, j, sbb); + generateChest(world, 3, 1, 1, 0, random, sbb, ConfigHandler.jewelsChestMin, ConfigHandler.jewelsChestMax); + generateDisplayer(world, 3, 1, 2, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + placeBlockAtCurrentPosition(world, BlockList.jewelCraftingTable, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, 3, 1, 3, sbb); + generateDisplayer(world, 3, 1, 4, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + generateChest(world, 3, 1, 5, 0, random, sbb, ConfigHandler.jewelsChestMin, ConfigHandler.jewelsChestMax); + generateFurnace(world, 1, 1, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 1, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateSmelter(world, 1, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateSmelter(world, 1, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateMolder(world, 2, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + generateMolder(world, 2, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.ingotChestMaxStack); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.ingotChestMaxStack); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + for(int l = 0; l < 6; ++l) + for(int i1 = 2; i1 < 9; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + for(int l = 6; l < 12; ++l) + for(int i1 = 0; i1 < 11; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + spawnVillagers(world, sbb, 3, 1, 3, 1); + return true; + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + */ + public void generateChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, Blocks.chest, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + ItemStack jewels = JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size())); + chest.func_145976_a("Jeweler's Chest"); + if (jewels.getItem() == Items.nether_star && ConfigHandler.GENERATE_VILLAGE_NETHERSTAR) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + else if (random.nextBoolean() && jewels.getItem() != Items.nether_star) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateIngotChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ingot Chest"); + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), metal); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateOresChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ores Chest"); + int oreID = random.nextInt(JewelrycraftUtil.ores.size()); + ItemStack ores = JewelrycraftUtil.ores.get(oreID).copy(); + ores.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), ores); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + */ + public void generateDisplayer(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.displayer, metadata, i, j, k, sbb); + TileEntityDisplayer displayer = (TileEntityDisplayer)world.getTileEntity(i1, j1, k1); + if (displayer != null){ + Item[] jewels = {ItemList.ring, ItemList.necklace}; + ItemStack jewel = new ItemStack(jewels[random.nextInt(jewels.length)]); + JewelryNBT.addMetal(jewel, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()))); + JewelryNBT.addModifiers(jewel, JewelrycraftUtil.addRandomModifiers(random.nextInt(4))); + JewelryNBT.addGem(jewel, JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size()))); + displayer.object = jewel; + displayer.quantity = 1; + displayer.hasObject = true; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param isEmpty + */ + public void generateSmelter(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean isEmpty) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.smelter, metadata, i, j, k, sbb); + TileEntitySmelter smelter = (TileEntitySmelter)world.getTileEntity(i1, j1, k1); + if (smelter != null && !isEmpty){ + int metal = random.nextInt(JewelrycraftUtil.metal.size()); + smelter.moltenMetal = JewelrycraftUtil.metal.get(metal).copy(); + smelter.hasMoltenMetal = true; + int quantity = random.nextInt(9); + switch(quantity) + { + case 0: + smelter.quantity = 0.1f; + case 1: + smelter.quantity = 0.2f; + case 2: + smelter.quantity = 0.3f; + case 3: + smelter.quantity = 0.4f; + case 4: + smelter.quantity = 0.5f; + case 5: + smelter.quantity = 0.6f; + case 6: + smelter.quantity = 0.7f; + case 7: + smelter.quantity = 0.8f; + case 8: + smelter.quantity = 0.9f; + default: + smelter.quantity = 0.1f; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param hasMold + * @param hasStuff + */ + public void generateMolder(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean hasMold, boolean hasStuff) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.molder, metadata, i, j, k, sbb); + TileEntityMolder molder = (TileEntityMolder)world.getTileEntity(i1, j1, k1); + if (molder != null && !molder.hasMold) if (hasMold){ + int meta = random.nextInt(ItemMolds.moldsItemNames.length); + molder.mold = new ItemStack(ItemList.molds, 1, meta); + molder.hasMold = true; + if (hasStuff){ + ItemStack ring = new ItemStack(ItemList.ring); + JewelryNBT.addMetal(ring, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack necklace = new ItemStack(ItemList.necklace); + JewelryNBT.addMetal(necklace, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack bracelet = new ItemStack(ItemList.bracelet); + JewelryNBT.addMetal(bracelet, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack earrings = new ItemStack(ItemList.earrings); + JewelryNBT.addMetal(earrings, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + if (meta == 0) molder.jewelBase = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())); + else if (meta == 1) molder.jewelBase = ring; + else if (meta == 2) molder.jewelBase = necklace; + else if (meta == 3) molder.jewelBase = bracelet; + else if (meta == 4) molder.jewelBase = earrings; + molder.hasJewelBase = true; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param hasMetal + */ + public void generateFurnace(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, boolean hasMetal) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, Blocks.furnace, metadata, i, j, k, sbb); + TileEntityFurnace furnace = (TileEntityFurnace)world.getTileEntity(i1, j1, k1); + if (furnace != null){ + if (random.nextBoolean()) furnace.setInventorySlotContents(1, new ItemStack(Items.coal, 1 + random.nextInt(16))); + if (hasMetal){ + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = random.nextInt(max - min + 1) + min; + furnace.setInventorySlotContents(2, metal); + } + } + } + + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + * + * @param par1 + * @return + */ + @Override + protected int getVillagerType(int par1) + { + return 3000; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/c06f6dbf2be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/c06f6dbf2be60014127dc373d78c1666 new file mode 100644 index 0000000..f5fabd6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/c06f6dbf2be60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || !tabList.get(0).visible){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(0).visible) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/d0d6ac8a2ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/d0d6ac8a2ce60014127dc373d78c1666 new file mode 100644 index 0000000..1841be6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/d0d6ac8a2ce60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!tabList.get(1).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/e02833072fde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/e02833072fde00141043c3025ec60dfc deleted file mode 100644 index 1c22d50..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/e02833072fde00141043c3025ec60dfc +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.entities; - -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * @author Sorin - */ -public class EntityHalfHeart extends EntityHeart -{ - public EntityHalfHeart(World world) - { - super(world); - } - - @Override - public void onCollideWithPlayer(EntityPlayer player) - { - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (getType().equals("Red") && player.getHealth() < player.getMaxHealth()){ - player.heal(1f); - this.setDead(); - }else if (getType().equals("White") && playerInfo.getFloat("WhiteHeart") > 0.1F){ - playerInfo.setFloat(getType() + "Heart", 0F); - player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() + 2f); - this.setDead(); - }else if (!getType().equals("Red")){ - playerInfo.setFloat(getType() + "Heart", playerInfo.getFloat(getType() + "Heart") + 1.0F <= 20f ? playerInfo.getFloat(getType() + "Heart") + 1.0F : 20f); - this.setDead(); - } - } - else JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/30408fedfbe40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/30408fedfbe40014174fe663e69b8422 new file mode 100644 index 0000000..d970f43 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/30408fedfbe40014174fe663e69b8422 @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.*; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/804ba49f0fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/804ba49f0fe60014127dc373d78c1666 new file mode 100644 index 0000000..30a3515 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/804ba49f0fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 1.0F); + GL11.glRotatef(75f, 0f, 1f, 0f); + GL11.glRotatef(-15f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/906a5c63fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/906a5c63fce40014174fe663e69b8422 new file mode 100644 index 0000000..bcf52b4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/906a5c63fce40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.*; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/d09fd6372bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/d09fd6372bde00141043c3025ec60dfc deleted file mode 100644 index a7f88b5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/d09fd6372bde00141043c3025ec60dfc +++ /dev/null @@ -1,466 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - System.out.println(curseNo + " " + (Curse.getCurseList().size() - Curse.availableCurses.size())); - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss()){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/2006adf198e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/2006adf198e3001412c4c4819c88e86b new file mode 100644 index 0000000..ef542a7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/2006adf198e3001412c4c4819c88e86b @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; +// System.out.println(midas.target.rotationYaw); +// GL11.glRotatef(, 0.0F, 1.0F, 0.0F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.target.posX - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, midas.target.rotationYaw, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/e0530e5726e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/e0530e5726e60014127dc373d78c1666 new file mode 100644 index 0000000..99d9741 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/e0530e5726e60014127dc373d78c1666 @@ -0,0 +1,24 @@ +package main.java.tconstruct.client; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class InventoryTabVanilla extends AbstractTab +{ + public InventoryTabVanilla() + { + super(0, 0, 0, new ItemStack(Blocks.crafting_table)); + } + + @Override + public void onTabClicked () + { + TabRegistry.openInventoryGui(); + } + + @Override + public boolean shouldAddToList () + { + return true; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/20e316d367dd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/20e316d367dd001412dce27813e7be4a deleted file mode 100644 index 55ef447..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/20e316d367dd001412dce27813e7be4a +++ /dev/null @@ -1,123 +0,0 @@ -package darkknight.jewelrycraft.events; - -import java.util.Iterator; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.entities.renders.RenderHelper; -import darkknight.jewelrycraft.item.render.BraceletRender; -import darkknight.jewelrycraft.item.render.EarringsRender; -import darkknight.jewelrycraft.item.render.MaskRender; -import darkknight.jewelrycraft.model.ModelBracelet; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class PlayerRenderHandler -{ - MaskRender mask = new MaskRender(); - EarringsRender earrings = new EarringsRender(); - BraceletRender bracelet = new BraceletRender(); - public static String[] infamyCache = new String[]{}; - - @SubscribeEvent - public void renderScreen(RenderPlayerEvent.Specials.Post event) - { - ModelBiped main = event.renderer.modelBipedMain; - Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); - if (infamyCache != null){ - while (players.hasNext()){ - EntityPlayer player = players.next(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - System.out.println(event.entityPlayer + " | " + player + " | " + playerInfo); - if (checkPlayerInfamy(player.getDisplayName()) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){ - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(1.6f, 1.6f, 1.6f); - GL11.glTranslatef(-0.25F, -0.25F, -0.25F); - mask.doRender(event.entityPlayer, 0F, 0F, 0F, 0F, 0F); - GL11.glPopMatrix(); - } - if (playerInfo.hasKey("ext17") && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext17"); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(0.07f, 0.07f, 0.07f); - GL11.glTranslatef(0.0F, 3.0F, -2.0F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - earrings.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - GL11.glPopMatrix(); - } - for(int i = 10; i <= 13; i++) - if (playerInfo.hasKey("ext" + i) && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glTranslatef((i / 12 == 1) ? -0.275F : 0.475F, 0.2F + ((i / 12 == 1) ? (i - 12) * 0.08F : (i - 10) * 0.08F), 0F); - if (player.isSneaking()) GL11.glTranslatef(0F, 0F, -((i == 10 || i == 12) ? (0.1F) : 0.05F)); - if (i / 12 == 1){ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedRightArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0.0F); - }else{ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedLeftArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - } - GL11.glPopMatrix(); - } - } - } - } - - /** - * @param string - * @return - */ - private boolean checkPlayerInfamy(String string) - { - for(int i = 0; i < infamyCache.length; i++) - if (infamyCache[i].equals(string)) return true; - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/b01141212bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/b01141212bde00141043c3025ec60dfc deleted file mode 100644 index e75c5a2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/b01141212bde00141043c3025ec60dfc +++ /dev/null @@ -1,466 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - System.out.println(curseNo); - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss()){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/4031063499e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/4031063499e3001412c4c4819c88e86b new file mode 100644 index 0000000..ef542a7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/4031063499e3001412c4c4819c88e86b @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; +// System.out.println(midas.target.rotationYaw); +// GL11.glRotatef(, 0.0F, 1.0F, 0.0F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.target.posX - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, midas.target.rotationYaw, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/705d0e479ae3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/705d0e479ae3001412c4c4819c88e86b new file mode 100644 index 0000000..f558f5e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/705d0e479ae3001412c4c4819c88e86b @@ -0,0 +1,87 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + + int count = quantityDropped(metadata, fortune, world.rand); + TileEntity tile = world.getTileEntity(x, y, z); + if (tile != null && ((TileEntityMidasTouch)tile).target != null) + ret.add(new ItemStack(Items.gold_nugget, (int)(((TileEntityMidasTouch)tile).target.width*((TileEntityMidasTouch)tile).target.height), 0)); + + return ret; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/a07a436227e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/a07a436227e60014127dc373d78c1666 new file mode 100644 index 0000000..7cf06e8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/a07a436227e60014127dc373d78c1666 @@ -0,0 +1,70 @@ +package darkknight.jewelrycraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.TabRegistry; +import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab; +import darkknight.jewelrycraft.events.KeyBindings; + +public class GuiJewelry extends GuiContainer +{ + ResourceLocation texture; + + /** + * @param containerJewelryTab + * @param texture + */ + public GuiJewelry(ContainerJewelryTab containerJewelryTab, ResourceLocation texture) + { + super(containerJewelryTab); + xSize = 194; + ySize = 166; + this.texture = texture; + } + + /** + * @param f + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) + { + GL11.glColor3f(1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + } + + /** + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + {} + + /** + * @param charecter + * @param key + */ + @Override + protected void keyTyped(char charecter, int key) + { + super.keyTyped(charecter, key); + if (key == KeyBindings.inventory.getKeyCode()) mc.thePlayer.closeScreen(); + } + + @Override + public void initGui () + { + super.initGui(); + int cornerX = -guiLeft; + int cornerY = guiTop; + this.buttonList.clear(); + TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class); + TabRegistry.addTabsToList(this.buttonList); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/d0d0f67107e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/d0d0f67107e50014174fe663e69b8422 new file mode 100644 index 0000000..fb62f3d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/d0d0f67107e50014174fe663e69b8422 @@ -0,0 +1,61 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ +// ItemStack item = JewelryNBT.item(stack); +// if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/000c08e404e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/000c08e404e50014174fe663e69b8422 new file mode 100644 index 0000000..c4c5777 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/000c08e404e50014174fe663e69b8422 @@ -0,0 +1,56 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); +// System.out.println(Block.getBlockFromItem(item.getItem()) + " " + item.getIconIndex()); + if (item != null)return item.getIconIndex(); + else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/90e8344505e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/90e8344505e50014174fe663e69b8422 new file mode 100644 index 0000000..9c2e86f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/90e8344505e50014174fe663e69b8422 @@ -0,0 +1,61 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); +// System.out.println(Block.getBlockFromItem(item.getItem()) + " " + item.getIconIndex()); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getIconIndex(); + else{ +// System.out.println(Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1)); + return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1); + } + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/e0b0ac5f2ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/e0b0ac5f2ce60014127dc373d78c1666 new file mode 100644 index 0000000..92f16bf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/e0b0ac5f2ce60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || tabList.get(1).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla)) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/5097d3042de60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/5097d3042de60014127dc373d78c1666 new file mode 100644 index 0000000..3a00122 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/5097d3042de60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0) - ((!tabList.get(1).enabled)?3:0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/c0347e0403e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/c0347e0403e50014174fe663e69b8422 new file mode 100644 index 0000000..6a6f566 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/c0347e0403e50014174fe663e69b8422 @@ -0,0 +1,58 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); +// else return Block.getBlockFromItem(item.getItem()).getIcon(6, 6); + }else return itemIcon; + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/e03fd2740bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/e03fd2740bde00141043c3025ec60dfc deleted file mode 100644 index 788dc50..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/e03fd2740bde00141043c3025ec60dfc +++ /dev/null @@ -1,185 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - System.out.println((int)f3 + " " + 0xf3); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/e0ae27cf28de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/e0ae27cf28de00141043c3025ec60dfc deleted file mode 100644 index 1ff9c0d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/e0ae27cf28de00141043c3025ec60dfc +++ /dev/null @@ -1,465 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss() && playerInfo.getInteger("cursePoints") > 0){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/00caa6936edd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/00caa6936edd001412dce27813e7be4a deleted file mode 100644 index 00895e7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/00caa6936edd001412dce27813e7be4a +++ /dev/null @@ -1,465 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo((EntityPlayer)event.entity)); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo(player)); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo(player)); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo(player)); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo(player)); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo(player)); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo(player)); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo(player)); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss()){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo((EntityPlayer)event.entity)); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo(player)); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo((EntityPlayer)event.entity)); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/1037e339dee50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/1037e339dee50014109ec019d2f6c0dc new file mode 100644 index 0000000..e86d906 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/1037e339dee50014109ec019d2f6c0dc @@ -0,0 +1,93 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget ") || currItem.getItem().getUnlocalizedName().toLowerCase().contains(" nugget")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot ") || currItem.getItem().getUnlocalizedName().toLowerCase().contains(" ingot")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/e0e1250efde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/e0e1250efde40014174fe663e69b8422 new file mode 100644 index 0000000..a499d75 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/e0e1250efde40014174fe663e69b8422 @@ -0,0 +1,46 @@ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldifiedObject extends Item +{ + public ItemGoldifiedObject() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/408df7d236e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/408df7d236e100141e1cc3c3be242e56 new file mode 100644 index 0000000..2bea4c9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/408df7d236e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int MAX_VILLAGE_JEWELERS; + public static int JEWELER_WEIGHT; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + JEWELER_WEIGHT = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + ingotChestMin = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMax = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/5082774936e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/5082774936e100141e1cc3c3be242e56 new file mode 100644 index 0000000..3b562b7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/5082774936e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static boolean generateVillageNetherstar; + public static boolean canFurnacesGenerateIngots; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + generateVillageNetherstar = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + canFurnacesGenerateIngots = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + maxVillageJewelers = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + jewelerWeight = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + ingotChestMin = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMax = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/50dc9ef400e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/50dc9ef400e50014174fe663e69b8422 new file mode 100644 index 0000000..d8755a6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/50dc9ef400e50014174fe663e69b8422 @@ -0,0 +1,53 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.item(stack) != null) return JewelryNBT.item(stack).getItem().getIconIndex(JewelryNBT.item(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/80253a9b9ce3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/80253a9b9ce3001412c4c4819c88e86b new file mode 100644 index 0000000..c0e1327 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/80253a9b9ce3001412c4c4819c88e86b @@ -0,0 +1,33 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + EntityLiving target = ((EntityLiving)midas.target); + target.hurtTime = 0; + float yaw = target.prevRotationYawHead + (target.rotationYawHead - target.prevRotationYawHead); + float yawOffset = target.prevRenderYawOffset + (target.renderYawOffset - target.prevRenderYawOffset); + float pitch = target.prevRotationPitch + (target.rotationPitch - target.prevRotationPitch); + GL11.glRotatef(yawOffset, 0, -1, 0); +// GL11.glRotatef(yaw - 90, 0, 1, 0); + GL11.glRotatef(pitch, 0, 0, -1); + GL11.glTranslatef(0.5F, 0.0F, 0.5F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(target, midas.xCoord - RenderManager.instance.renderPosX, midas.yCoord - RenderManager.instance.renderPosY, midas.zCoord - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/d0ac8fe598e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/d0ac8fe598e3001412c4c4819c88e86b new file mode 100644 index 0000000..784d37e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/d0ac8fe598e3001412c4c4819c88e86b @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; +// System.out.println(midas.target.rotationYaw); + GL11.glRotatef(midas.target.rotationYaw, 0.0F, 1.0F, 0.0F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.target.posX - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/e08d6da9c8df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/e08d6da9c8df00141dc6c962aec96210 deleted file mode 100644 index c5f9a3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/e08d6da9c8df00141dc6c962aec96210 +++ /dev/null @@ -1,734 +0,0 @@ -package darkknight.jewelrycraft.util; - -import java.util.ArrayList; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class JewelryNBT -{ - // TODO NBT Tag Adding - /** - * @param item The item you want to add the NBT data on - * @param metal The metal you want to add on the item - */ - public static void addMetal(ItemStack item, ItemStack metal) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound ingotNBT = new NBTTagCompound(); - metal.writeToNBT(ingotNBT); - itemStackData.setTag("ingot", ingotNBT); - } - - /** - * @param item The item you want to add the NBT data on - * @param gem The gem you want to add on the item - */ - public static void addGem(ItemStack item, ItemStack gem) - { - if (gem != null){ - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound gemNBT = new NBTTagCompound(); - gem.writeToNBT(gemNBT); - itemStackData.setTag("gem", gemNBT); - } - } - - /** - * @param item The item you want to add the NBT data on - * @param modifier The modifier you want to add on the item - */ - public static void addModifiers(ItemStack item, ArrayList modifier) - { - if (modifier != null){ - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - for(int i = 0; i < modifier.size(); i++){ - NBTTagCompound modifierNBT = new NBTTagCompound(); - modifier.get(i).writeToNBT(modifierNBT); - itemStackData.setTag("modifier" + i, modifierNBT); - } - itemStackData.setInteger("modifierSize", modifier.size()); - } - } - - /** - * @param item The item you want to add the NBT data on - * @param entity The entity to add on the item - */ - public static void addEntity(ItemStack item, EntityLivingBase entity) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound entityNBT = new NBTTagCompound(); - entity.writeToNBT(entityNBT); - itemStackData.setTag("entity", entityNBT); - } - - /** - * @param item - * @param entity - */ - public static void addEntityID(ItemStack item, EntityLivingBase entity) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound entityNBT = new NBTTagCompound(); - int id = EntityList.getEntityID(entity); - entityNBT.setInteger("entityID", id); - itemStackData.setTag("entityID", entityNBT); - } - - /** - * @param item - * @param x - * @param y - * @param z - */ - public static void addCoordonates(ItemStack item, double x, double y, double z) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound coords = new NBTTagCompound(); - coords.setDouble("x", x); - coords.setDouble("y", y); - coords.setDouble("z", z); - itemStackData.setTag("x", coords); - itemStackData.setTag("y", coords); - itemStackData.setTag("z", coords); - } - - /** - * @param item - * @param world - * @param x - * @param y - * @param z - */ - public static void addTileEntityBlock(ItemStack item, World world, int x, int y, int z) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound tileNBT = new NBTTagCompound(); - NBTTagCompound block = new NBTTagCompound(); - world.getTileEntity(x, y, z).writeToNBT(tileNBT); - itemStackData.setTag("tile", tileNBT); - block.setInteger("blockID", Block.getIdFromBlock(world.getBlock(x, y, z))); - block.setInteger("metadata", world.getBlockMetadata(x, y, z)); - block.setInteger("blockX", x); - block.setInteger("blockY", y); - block.setInteger("blockZ", z); - itemStackData.setTag("metadata", block); - itemStackData.setTag("blockID", block); - itemStackData.setTag("blockX", block); - itemStackData.setTag("blockY", block); - itemStackData.setTag("blockZ", block); - } - - /** - * @param item - * @param block - * @param metadata - */ - public static void addBlock(ItemStack item, int block, int metadata) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound blockNBT = new NBTTagCompound(); - blockNBT.setInteger("blockID", block); - itemStackData.setTag("blockID", blockNBT); - blockNBT.setInteger("metadata", metadata); - itemStackData.setTag("metadata", blockNBT); - } - - /** - * @param item - * @param x - * @param y - * @param z - */ - public static void addBlockCoordonates(ItemStack item, int x, int y, int z) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound coords = new NBTTagCompound(); - coords.setInteger("blockX", x); - coords.setInteger("blockY", y); - coords.setInteger("blockZ", z); - itemStackData.setTag("blockX", coords); - itemStackData.setTag("blockY", coords); - itemStackData.setTag("blockZ", coords); - } - - /** - * @param item - * @param x - * @param y - * @param z - * @param dim - * @param name - */ - public static void addCoordonatesAndDimension(ItemStack item, double x, double y, double z, int dim, String name) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound coords = new NBTTagCompound(); - coords.setDouble("x", x); - coords.setDouble("y", y); - coords.setDouble("z", z); - coords.setInteger("dimension", dim); - coords.setString("dimName", name); - itemStackData.setTag("x", coords); - itemStackData.setTag("y", coords); - itemStackData.setTag("z", coords); - itemStackData.setTag("dimension", coords); - itemStackData.setTag("dimName", coords); - } - - /** - * @param item - */ - public static void addFakeEnchantment(ItemStack item) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - itemStackData.setTag("ench", new NBTTagList()); - } - - /** - * @param item - * @param color - */ - public static void addIngotColor(ItemStack item, int color) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound colors = new NBTTagCompound(); - colors.setInteger("ingotColor", color); - itemStackData.setTag("ingotColor", colors); - } - - // TODO - /** - * @param item - * @param color - */ - public static void addGemColor(ItemStack item, int color) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound colors = new NBTTagCompound(); - colors.setInteger("gemColor", color); - itemStackData.setTag("gemColor", colors); - } - - /** - * @param item - * @param list - */ - @SuppressWarnings ("rawtypes") - public static void addEntities(ItemStack item, List list) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound entityNBT = new NBTTagCompound(); - for(int i = 0; i < list.size(); i++) - ((EntityLivingBase)list.get(i)).writeToNBT(entityNBT); - itemStackData.setTag("entities", entityNBT); - } - - // TODO NBT Tag Removing - /** - * @param item - * @param tag - */ - public static void removeNBT(ItemStack item, String tag) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - itemStackData.removeTag(tag); - } - - /** - * @param item - */ - public static void removeEntity(ItemStack item) - { - JewelryNBT.removeNBT(item, "entityID"); - JewelryNBT.removeNBT(item, "entity"); - JewelryNBT.removeNBT(item, "ench"); - } - - /** - * @param item - */ - public static void removeBlock(ItemStack item) - { - JewelryNBT.removeNBT(item, "blockID"); - JewelryNBT.removeNBT(item, "metadata"); - JewelryNBT.removeNBT(item, "tile"); - JewelryNBT.removeNBT(item, "blockX"); - JewelryNBT.removeNBT(item, "blockY"); - JewelryNBT.removeNBT(item, "blockZ"); - } - - // TODO NTB Tag Checking - /** - * @param item - * @param tag - * @return - */ - public static boolean hasTag(ItemStack item, String tag) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - if (itemStackData.hasKey(tag)) return true; - return false; - } - - /** - * @param stack - * @param gem - * @return - */ - public static boolean isGemX(ItemStack stack, ItemStack gem) - { - if (gem(stack) != null && gem(stack).getItem() == gem.getItem() && gem(stack).getItemDamage() == gem.getItemDamage()) return true; - return false; - } - - /** - * @param stack - * @param modifier - * @return - */ - public static int doesModifierExist(ItemStack stack, ItemStack modifier) - { - if (modifier(stack) != null){ - ArrayList list = modifier(stack); - for(int i = 0; i < list.size(); i++) - if (list.get(i).getItem() == modifier.getItem() && list.get(i).getItemDamage() == modifier.getItemDamage()) return i; - } - return -1; - } - - public static int numberOfModifiers(ItemStack stack) - { - if (modifier(stack) != null) return modifier(stack).size(); - return -1; - } - - /** - * @param stack - * @param ingot - * @return - */ - public static boolean isIngotX(ItemStack stack, ItemStack ingot) - { - if (ingot(stack) != null && ingot(stack).getItem() == ingot.getItem() && ingot(stack).getItemDamage() == ingot.getItemDamage()) return true; - return false; - } - - /** - * @param stack - * @param player - * @param entity - * @return - */ - public static boolean isEntityX(ItemStack stack, EntityPlayer player, EntityLivingBase entity) - { - if (entity != null && entity instanceof EntityLivingBase && entity(stack, player) != null && entity(stack, player).equals(entity)) return true; - return false; - } - - /** - * @param stack - * @param dimName - * @return - */ - public static boolean isDimNameX(ItemStack stack, String dimName) - { - if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; - return false; - } - - /** - * @param stack - * @param dimension - * @return - */ - public static boolean isDimensionX(ItemStack stack, int dimension) - { - if (dimension(stack) != -2 && dimension(stack) == dimension) return true; - return false; - } - - // TODO Return components based on NBT - /** - * @param stack - * @return - */ - public static ItemStack gem(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gem")){ - NBTTagCompound jewelNBT = (NBTTagCompound)stack.getTagCompound().getTag("gem"); - ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); - gem.readFromNBT(jewelNBT); - return gem; - } - return null; - } - - /** - * @param stack - * @return - */ - public static ArrayList modifier(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()){ - int size = stack.getTagCompound().getInteger("modifierSize"); - ArrayList list = new ArrayList(); - for(int i = 0; i < size; i++){ - ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); - NBTTagCompound modifierNBT = (NBTTagCompound)stack.getTagCompound().getTag("modifier" + i); - modifier.readFromNBT(modifierNBT); - list.add(modifier); - } - return list; - } - return null; - } - - /** - * @param stack - * @return - */ - public static ItemStack ingot(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("ingot")){ - NBTTagCompound ingotNBT = (NBTTagCompound)stack.getTagCompound().getTag("ingot"); - ItemStack ingot = new ItemStack(Item.getItemById(0), 0, 0); - ingot.readFromNBT(ingotNBT); - return ingot; - } - return null; - } - - /** - * @param stack - * @param player - * @return - */ - public static EntityLivingBase entity(ItemStack stack, EntityPlayer player) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("entityID") && stack.getTagCompound().hasKey("entity")){ - NBTTagCompound enID = (NBTTagCompound)stack.getTagCompound().getTag("entityID"); - NBTTagCompound en = (NBTTagCompound)stack.getTagCompound().getTag("entity"); - int entityID = 0; - entityID = enID.getInteger("entityID"); - EntityLivingBase entity = (EntityLivingBase)EntityList.createEntityByID(entityID, player.worldObj); - if (entity != null && entity instanceof EntityLivingBase){ - entity.readFromNBT(en); - return entity; - }else return null; - } - return null; - } - - /** - * @param stack - * @return - */ - public static TileEntity tileEntity(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("tile")){ - NBTTagCompound tileNBT = (NBTTagCompound)stack.getTagCompound().getTag("tile"); - TileEntity tile = TileEntity.createAndLoadEntity(tileNBT); - if (tile != null && tile instanceof TileEntity){ - tile.readFromNBT(tileNBT); - return tile; - }else return null; - } - return null; - } - - /** - * @param stack - * @return - */ - public static String dimName(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("dimName")){ - NBTTagCompound dim = (NBTTagCompound)stack.getTagCompound().getTag("dimName"); - String name = dim.getString("dimName"); - return name; - } - return null; - } - - /** - * @param stack - * @return - */ - public static String modeName(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("mode")){ - NBTTagCompound dim = (NBTTagCompound)stack.getTagCompound().getTag("mode"); - String name = dim.getString("mode"); - return name; - } - return null; - } - - /** - * @param stack - * @return - */ - public static int dimension(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("dimension")){ - NBTTagCompound dim = (NBTTagCompound)stack.getTagCompound().getTag("dimension"); - int dimension = dim.getInteger("dimension"); - return dimension; - } - return -2; - } - - /** - * @param stack - * @return - */ - public static int blockCoordX(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockX")){ - NBTTagCompound x = (NBTTagCompound)stack.getTagCompound().getTag("blockX"); - int posX = x.getInteger("blockX"); - return posX; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static int blockCoordY(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockY")){ - NBTTagCompound y = (NBTTagCompound)stack.getTagCompound().getTag("blockY"); - int posY = y.getInteger("blockY"); - return posY; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static int blockCoordZ(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockZ")){ - NBTTagCompound z = (NBTTagCompound)stack.getTagCompound().getTag("blockZ"); - int posZ = z.getInteger("blockZ"); - return posZ; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static int blockID(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockID")){ - NBTTagCompound blockID = (NBTTagCompound)stack.getTagCompound().getTag("blockID"); - int blockId = blockID.getInteger("blockID"); - return blockId; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static int blockMetadata(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("metadata")){ - NBTTagCompound metadataNBT = (NBTTagCompound)stack.getTagCompound().getTag("metadata"); - int metadata = metadataNBT.getInteger("metadata"); - return metadata; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static double playerPosX(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("x")){ - NBTTagCompound x = (NBTTagCompound)stack.getTagCompound().getTag("x"); - double posX = x.getDouble("x"); - return posX; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static double playerPosY(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("y")){ - NBTTagCompound y = (NBTTagCompound)stack.getTagCompound().getTag("y"); - double posY = y.getDouble("y"); - return posY; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static double playerPosZ(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("z")){ - NBTTagCompound z = (NBTTagCompound)stack.getTagCompound().getTag("z"); - double posZ = z.getDouble("z"); - return posZ; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static int ingotColor(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("ingotColor")){ - NBTTagCompound colors = (NBTTagCompound)stack.getTagCompound().getTag("ingotColor"); - int color = colors.getInteger("ingotColor"); - return color; - } - return 16777215; - } - - // TODO - /** - * @param stack - * @return - */ - public static int gemColor(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemColor")){ - NBTTagCompound colors = (NBTTagCompound)stack.getTagCompound().getTag("gemColor"); - int color = colors.getInteger("gemColor"); - return color; - } - return 16777215; - } - - /** - * @param stack - * @param player - * @return - */ - @SuppressWarnings ({"rawtypes", "unchecked", "null"}) - public static List entities(ItemStack stack, EntityPlayer player) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("entities")){ - NBTTagCompound enID = (NBTTagCompound)stack.getTagCompound().getTag("entitiesID"); - List list = null; - int[] entityID; - EntityLivingBase entity; - entityID = enID.getIntArray("entitiesID"); - for(int element: entityID){ - entity = (EntityLivingBase)EntityList.createEntityByID(element, player.worldObj); - list.add(entity); - } - return list; - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/e09e0f810fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/e09e0f810fe60014127dc373d78c1666 new file mode 100644 index 0000000..a5a1674 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/e09e0f810fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.6F); + GL11.glRotatef(75f, 0f, 1f, 0f); + GL11.glRotatef(-15f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); +// OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/5075577ed0df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/5075577ed0df00141dc6c962aec96210 deleted file mode 100644 index 5c188fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/5075577ed0df00141dc6c962aec96210 +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2 + JewelryNBT.numberOfModifiers(item) / 4)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 150 - JewelryNBT.numberOfModifiers(item) * 10, 2 - JewelryNBT.numberOfModifiers(item) / 5)); - // Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(520 - JewelryNBT.numberOfModifiers(item) * 20) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - // Negative ring - if (jewelry instanceof ItemRing && exists) Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 0.2F - JewelryNBT.numberOfModifiers(item) * 0.1F); - // Positive ring - if (jewelry instanceof ItemRing && exists && rand.nextInt(180 + JewelryNBT.numberOfModifiers(item)*20) == 12){ - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100 + JewelryNBT.numberOfModifiers(item)*30, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/c067553a97e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/c067553a97e3001412c4c4819c88e86b new file mode 100644 index 0000000..953b34c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/c067553a97e3001412c4c4819c88e86b @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.ySize); + this.setBlockBounds(0F, 0F, 0F, 1F, ((TileEntityMidasTouch)tile).target.height, 1F); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/009077530fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/009077530fe60014127dc373d78c1666 new file mode 100644 index 0000000..0518542 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/009077530fe60014127dc373d78c1666 @@ -0,0 +1,578 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.6F); + GL11.glRotatef(60f, 0f, 1f, 0f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/a02d9af974e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/a02d9af974e300141084bb8bfb075c08 new file mode 100644 index 0000000..ed9e210 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/a02d9af974e300141084bb8bfb075c08 @@ -0,0 +1,37 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart)){ + world.setBlock((int)target.posX, (int)target.posY, (int)target.posZ, BlockList.midasTouchBlock, 0, 2); + TileEntity midasTouchVictim = new TileEntityMidasTouch(target); + world.setTileEntity((int)target.posX, (int)target.posY, (int)target.posZ, midasTouchVictim); +// target.setDead(); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/d0d7234a2ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/d0d7234a2ce60014127dc373d78c1666 new file mode 100644 index 0000000..a3c5378 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/d0d7234a2ce60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || !tabList.get(1).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/4012105328e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/4012105328e60014127dc373d78c1666 new file mode 100644 index 0000000..a16529d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/4012105328e60014127dc373d78c1666 @@ -0,0 +1,97 @@ +package darkknight.jewelrycraft.proxy; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.VillagerRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.InventoryTabVanilla; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.TabRegistry; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.entities.renders.HeartRender; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.render.ItemRender; +import darkknight.jewelrycraft.model.ModelDisplayer; +import darkknight.jewelrycraft.model.ModelHalfHeart; +import darkknight.jewelrycraft.model.ModelHandPedestal; +import darkknight.jewelrycraft.model.ModelHeart; +import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; +import darkknight.jewelrycraft.model.ModelMolder; +import darkknight.jewelrycraft.model.ModelShadowEye; +import darkknight.jewelrycraft.model.ModelShadowHand; +import darkknight.jewelrycraft.model.ModelSmelter; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMidasTouchRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/ShadowHand.png"); + TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMidasTouch.class, new TileEntityMidasTouchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); + + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); + MinecraftForgeClient.registerItemRenderer(ItemList.goldObj, new ItemRender()); + + VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation(Variables.MODID, "textures/entities/jeweler.png")); + + RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); + + if (!Loader.isModLoaded("TConstruct") && TabRegistry.getTabList().size() < 1) TabRegistry.registerTab(new InventoryTabVanilla()); + TabRegistry.registerTab(new TabJewelry()); + MinecraftForge.EVENT_BUS.register(new TabRegistry()); + MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); + ResourceLocation jeweleryTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/40a9d3b7c9df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/40a9d3b7c9df00141dc6c962aec96210 deleted file mode 100644 index f587b8c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/40a9d3b7c9df00141dc6c962aec96210 +++ /dev/null @@ -1,93 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectBlazePowder extends ModifierEffects -{ - public EffectBlazePowder() - { - super(new ItemStack(Items.blaze_powder)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemNecklace && exists){ - // Positive for necklace - if (player.isBurning() && rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) player.extinguish(); - // Negative for necklace - if (player.isInWater()) player.attackEntityFrom(DamageSource.drown, 1f + (JewelryNBT.numberOfModifiers(item) - 1) * 0.1F); - } - // Negative for bracelet - if (jewelry instanceof ItemBracelet && exists && player.isInWater()){ - double slowAmount = 0.6D + (JewelryNBT.numberOfModifiers(item) - 1)*0.05D; - player.motionX *= slowAmount; - player.motionY *= slowAmount; - player.motionZ *= slowAmount; - player.motionY -= (0.02D + (JewelryNBT.numberOfModifiers(item) - 1)*0.005D); - if (player.isCollidedHorizontally) player.motionY = 0.30000001192092896D; - } - // Negative for earrings - if (jewelry instanceof ItemEarrings && exists){ - if (player.getAir() >= 300) player.setAir(player.getAir() / 2); - else player.setAir(player.getAir() - 1); - } - } - - @Override - public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Balanced for ring - if (jewelry instanceof ItemRing && exists && !player.isInWater()) target.setFire(2); - return false; - } - - @Override - public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - // int pos = JewelryNBT.doesModifierExist(item, modifier); - // if (jewelry instanceof ItemEarrings && pos != -1 && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){ - // //Positive for earrings - // int stackSize = JewelryNBT.modifier(item).get(pos).stackSize; - // player.heal((float)(0.05 * stackSize)); - // return true; - // } - // //Positive for bracelet - // if (jewelry instanceof ItemBracelet && pos != -1) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) return true; - return false; - } - - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - {} - - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (jewelry instanceof ItemEarrings && exists && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){ - // Positive for earrings - int stackSize = JewelryNBT.modifierSize(item, modifier); - player.heal((float)(0.05 * stackSize)); - playerInfo.setBoolean("negateDamage", true); - } - // Positive for bracelet - if (jewelry instanceof ItemBracelet && exists) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) playerInfo.setBoolean("negateDamage", true); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/602b567104e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/602b567104e50014174fe663e69b8422 new file mode 100644 index 0000000..302a721 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/602b567104e50014174fe663e69b8422 @@ -0,0 +1,61 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); +// System.out.println(item.getItem().getIconIndex(JewelryNBT.item(stack))); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else{ +// System.out.println(Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1)); + return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1); + } + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/2037e31a2ee60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/2037e31a2ee60014127dc373d78c1666 new file mode 100644 index 0000000..b90c7cf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/2037e31a2ee60014127dc373d78c1666 @@ -0,0 +1,580 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.*; +import net.minecraft.client.renderer.tileentity.*; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.*; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.*; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glPushMatrix(); + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + GL11.glPopMatrix(); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + RenderHelper.enableStandardItemLighting(); + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + RenderHelper.disableStandardItemLighting(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/2049de70fde50014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/2049de70fde50014127dc373d78c1666 new file mode 100644 index 0000000..a2a6da7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/2049de70fde50014127dc373d78c1666 @@ -0,0 +1,94 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockCompressed; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" nugget") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("nugget ")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("ingot ")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockCompressed) return new ItemStack(Blocks.gold_block, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/5041281b2ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/5041281b2ce60014127dc373d78c1666 new file mode 100644 index 0000000..acc3925 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/5041281b2ce60014127dc373d78c1666 @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + System.out.println(t.enabled); + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla)){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla)) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/a07d88ff3ce100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/a07d88ff3ce100141e1cc3c3be242e56 new file mode 100644 index 0000000..6308908 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/a07d88ff3ce100141e1cc3c3be242e56 @@ -0,0 +1,26 @@ +package darkknight.jewelrycraft.config; + +import cpw.mods.fml.client.config.GuiConfig; +import cpw.mods.fml.client.config.IConfigElement; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.common.config.ConfigElement; +import java.util.ArrayList; +import java.util.List; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigGui extends GuiConfig +{ + public ConfigGui(GuiScreen parent) + { + super(parent, getElements(), Variables.MODID, Variables.MODID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.INSTANCE.config.toString())); + } + + @SuppressWarnings ({"rawtypes"}) + private static List getElements() + { + List list = new ArrayList(ConfigHandler.categories.length); + for(String category: ConfigHandler.categories) + list.add(new ConfigElement(ConfigHandler.INSTANCE.config.getCategory(category))); + return list; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/c057434c00e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/c057434c00e50014174fe663e69b8422 new file mode 100644 index 0000000..17c0273 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/c057434c00e50014174fe663e69b8422 @@ -0,0 +1,54 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + System.out.println(getIconIndex(JewelryNBT.item(stack))); + if (JewelryNBT.item(stack) != null && pass >= 0) return getIconIndex(JewelryNBT.item(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/e0125a0b06de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/e0125a0b06de00141043c3025ec60dfc deleted file mode 100644 index f4496ed..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/e0125a0b06de00141043c3025ec60dfc +++ /dev/null @@ -1,465 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss()){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/e0b972a8fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/e0b972a8fce40014174fe663e69b8422 new file mode 100644 index 0000000..a781774 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/e0b972a8fce40014174fe663e69b8422 @@ -0,0 +1,67 @@ +package darkknight.jewelrycraft.item; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import javax.imageio.ImageIO; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.effects.ModifierEffects; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldifiedObject extends Item +{ + public ItemGoldifiedObject() + { + } + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/f08dace103e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/f08dace103e60014127dc373d78c1666 new file mode 100644 index 0000000..bbb940e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/f08dace103e60014127dc373d78c1666 @@ -0,0 +1,41 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.block.BlockMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +/** + * @author Sorin + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + // System.out.println("Broken " + event.getResult()); + ItemStack item = event.getPlayer().inventory.getCurrentItem(); + if (event.block instanceof BlockMidasTouch && item != null && item.getItem().getHarvestLevel(item, "pickaxe") >= event.block.getHarvestLevel(event.blockMetadata)){ + System.out.println(event.block.getHarvestLevel(3) + " " + item.getItem().getHarvestLevel(item, "pickaxe")); + TileEntityMidasTouch te = (TileEntityMidasTouch)event.world.getTileEntity(event.x, event.y, event.z); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + } + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/60aefdf029de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/60aefdf029de00141043c3025ec60dfc deleted file mode 100644 index e79a0d0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/60aefdf029de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints")){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/80c3ddc026de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/80c3ddc026de00141043c3025ec60dfc deleted file mode 100644 index 89a667f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/80c3ddc026de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 20 + (size + 20) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/c088de560fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/c088de560fe60014127dc373d78c1666 new file mode 100644 index 0000000..68edc65 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/c088de560fe60014127dc373d78c1666 @@ -0,0 +1,578 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.6F); + GL11.glRotatef(75f, 0f, 1f, 0f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/003e90f5fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/003e90f5fce40014174fe663e69b8422 new file mode 100644 index 0000000..3293158 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/003e90f5fce40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/10eef35626e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/10eef35626e60014127dc373d78c1666 new file mode 100644 index 0000000..3e5f138 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/10eef35626e60014127dc373d78c1666 @@ -0,0 +1,70 @@ +package darkknight.jewelrycraft.client.gui; + +import main.java.tconstruct.client.TabRegistry; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab; +import darkknight.jewelrycraft.events.KeyBindings; + +public class GuiJewelry extends GuiContainer +{ + ResourceLocation texture; + + /** + * @param containerJewelryTab + * @param texture + */ + public GuiJewelry(ContainerJewelryTab containerJewelryTab, ResourceLocation texture) + { + super(containerJewelryTab); + xSize = 194; + ySize = 166; + this.texture = texture; + } + + /** + * @param f + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) + { + GL11.glColor3f(1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + } + + /** + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + {} + + /** + * @param charecter + * @param key + */ + @Override + protected void keyTyped(char charecter, int key) + { + super.keyTyped(charecter, key); + if (key == KeyBindings.inventory.getKeyCode()) mc.thePlayer.closeScreen(); + } + + @Override + public void initGui () + { + super.initGui(); + int cornerX = guiLeft; + int cornerY = guiTop; + this.buttonList.clear(); + TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class); + TabRegistry.addTabsToList(this.buttonList); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/307c0486d0df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/307c0486d0df00141dc6c962aec96210 deleted file mode 100644 index 89e2fab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/307c0486d0df00141dc6c962aec96210 +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2 + JewelryNBT.numberOfModifiers(item) / 4)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 150 - JewelryNBT.numberOfModifiers(item) * 10, 2 - JewelryNBT.numberOfModifiers(item) / 5)); - // Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(520 - JewelryNBT.numberOfModifiers(item) * 20) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - // Negative ring - if (jewelry instanceof ItemRing && exists) Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 2F - JewelryNBT.numberOfModifiers(item) * 0.1F); - // Positive ring - if (jewelry instanceof ItemRing && exists && rand.nextInt(180 + JewelryNBT.numberOfModifiers(item)*20) == 12){ - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100 + JewelryNBT.numberOfModifiers(item)*30, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/4057874afde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/4057874afde40014174fe663e69b8422 new file mode 100644 index 0000000..d17def9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/4057874afde40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + public static Item goldifiedObject; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldObject().setUnlocalizedName(Variables.MODID + ".goldObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/60396614fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/60396614fde40014174fe663e69b8422 new file mode 100644 index 0000000..3293158 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/60396614fde40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/706877bc92e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/706877bc92e3001417b2e384bf7c3702 new file mode 100644 index 0000000..79a0c23 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/706877bc92e3001417b2e384bf7c3702 @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); +// RenderManager.instance.renderEntityWithPosYaw(midas.target, 2D, 0D, 0D, 1F, 1F); + RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, midas.target.posX - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/a0900f1428de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/a0900f1428de00141043c3025ec60dfc deleted file mode 100644 index 92d4ba9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/a0900f1428de00141043c3025ec60dfc +++ /dev/null @@ -1,464 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) persistTag.setInteger(curse.getName(), 1); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && playerInfo.getInteger("cursePoints") > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss() && playerInfo.getInteger("cursePoints") > 0){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/30275f77cadf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/30275f77cadf00141dc6c962aec96210 deleted file mode 100644 index fa05477..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/30275f77cadf00141dc6c962aec96210 +++ /dev/null @@ -1,95 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if (rand.nextInt(3) == 0 && (arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0)) arrow.setDead(); - } - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists){ - if (player.motionY < 0) player.motionY *= 0.6D; -// player.capabilities.setPlayerWalkSpeed(0.1F); -// player.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.001D); - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80, 1)); - player.fallDistance = 0F; - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/c00c84b926de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/c00c84b926de00141043c3025ec60dfc deleted file mode 100644 index 4693bc4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/c00c84b926de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(20, 24 + (size + 20) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/10dd91b3fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/10dd91b3fce40014174fe663e69b8422 new file mode 100644 index 0000000..62c96d7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/10dd91b3fce40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemGoldifiedObject goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = (ItemGoldifiedObject)new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/a064cf8efee40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/a064cf8efee40014174fe663e69b8422 new file mode 100644 index 0000000..7b48afc --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/a064cf8efee40014174fe663e69b8422 @@ -0,0 +1,48 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + if(player.inventory.getCurrentItem() != null){ + int index = player.inventory.currentItem; + ItemStack item = player.inventory.getCurrentItem(); + player.inventory.setInventorySlotContents(index, new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage())); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b0dd80ef11e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b0dd80ef11e60014127dc373d78c1666 new file mode 100644 index 0000000..79557c2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b0dd80ef11e60014127dc373d78c1666 @@ -0,0 +1,580 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.*; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glPushMatrix(); + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + GL11.glPopMatrix(); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/4013300e27de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/4013300e27de00141043c3025ec60dfc deleted file mode 100644 index 6735f69..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/4013300e27de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/4074a0d332e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/4074a0d332e100141e1cc3c3be242e56 new file mode 100644 index 0000000..384f0b7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/4074a0d332e100141e1cc3c3be242e56 @@ -0,0 +1,11 @@ +package darkknight.jewelrycraft.util; + +public class Variables +{ + public static final String MODID = "jewelrycraft2"; + public static final String MODNAME = "Jewelrycraft 2"; + public static final String VERSION = "1.0"; + public static final String PACKET_CHANNEL = "jewelrycraft2"; + public static final int MAX_CURSES = 10; + public static final String CONFIG_GUI = "thebetweenlands.utils.confighandler.ConfigGuiFactory"; +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/d04b122337e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/d04b122337e100141e1cc3c3be242e56 new file mode 100644 index 0000000..59e715f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/d04b122337e100141e1cc3c3be242e56 @@ -0,0 +1,454 @@ +package darkknight.jewelrycraft.worldGen.village; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureVillagePieces; +import net.minecraft.world.gen.structure.StructureVillagePieces.Start; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.ItemMolds; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class ComponentJewelry extends StructureVillagePieces.House1 +{ + private int averageGroundLevel = -1; + + /** + * + */ + public ComponentJewelry() + {} + + /** + * @param par1ComponentVillageStartPiece + * @param par2 + * @param par3Random + * @param par4StructureBoundingBox + * @param par5 + */ + public ComponentJewelry(Start par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) + { + super(); + coordBaseMode = par5; + boundingBox = par4StructureBoundingBox; + } + + /** + * @param villagePiece + * @param pieces + * @param random + * @param p1 + * @param p2 + * @param p3 + * @param p4 + * @param p5 + * @return + */ + @SuppressWarnings ("rawtypes") + public static ComponentJewelry buildComponent(Start villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 11, 5, 12, p4); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentJewelry(villagePiece, p5, random, structureboundingbox, p4) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the end, it adds Fences... + * + * @param world + * @param random + * @param sbb + * @return + */ + @Override + public boolean addComponentParts(World world, Random random, StructureBoundingBox sbb) + { + if (averageGroundLevel < 0){ + averageGroundLevel = getAverageGroundLevel(world, sbb); + if (averageGroundLevel < 0) return true; + boundingBox.offset(0, averageGroundLevel - boundingBox.maxY + 3, 0); + } + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace) + */ + fillWithBlocks(world, sbb, 0, 0, 6, 10, 5, 11, Block.getBlockById(0), Block.getBlockById(0), false); + fillWithBlocks(world, sbb, 2, 0, 0, 8, 5, 5, Block.getBlockById(0), Block.getBlockById(0), false); + // Pillars + fillWithBlocks(world, sbb, 2, 0, 0, 2, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 2, 0, 3, 2, 3, 3, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 0, 8, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 3, 8, 3, 3, Blocks.log, Blocks.log, false); + // Walls + fillWithBlocks(world, sbb, 2, 0, 1, 2, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 2, 0, 4, 2, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 1, 8, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 4, 8, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 3, 0, 0, 7, 3, 0, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 3, 6, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 11, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 6, 0, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 10, 0, 6, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + // Roof + for(int i = 3; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 2, i, 4, j, sbb); + for(int i = 3; i <= 7; i++) + for(int j = 6; j <= 6; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, i, 4, j, sbb); + for(int i = 1; i <= 9; i++) + for(int j = 7; j <= 10; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 3, i, 4, j, sbb); + for(int i = 2; i <= 8; i++) + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, i, 4, 0, sbb); + for(int i = 1; i <= 5; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 2, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 8, 4, i, sbb); + } + for(int i = 0; i <= 2; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 6, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i + 8, 4, 6, sbb); + } + for(int i = 7; i <= 11; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 0, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 10, 4, i, sbb); + } + for(int i = 0; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 11, sbb); + // Base + for(int i = 2; i <= 8; i++) + for(int j = 0; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.planks, 1, i, 0, j, sbb); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 0, 11, Blocks.stonebrick, Blocks.stonebrick, false); + for(int i = 6; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 5, 0, i, sbb); + for(int i = 7; i <= 10; i++){ + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 1, 0, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 9, 0, i, sbb); + } + // Decorations + placeDoorAtCurrentPosition(world, sbb, random, 6, 1, 0, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeDoorAtCurrentPosition(world, sbb, random, 5, 1, 6, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 3, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 4, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 3, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 3, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 7, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 7, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 10, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 9, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 9, sbb); + int bgCarpetColor = random.nextInt(16); + for(int i = 4; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.carpet, bgCarpetColor, i, 1, j, sbb); + generateChest(world, 3, 1, 1, 0, random, sbb, ConfigHandler.GEM_CHEST_MIN, ConfigHandler.jewelsChestMax); + generateDisplayer(world, 3, 1, 2, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + placeBlockAtCurrentPosition(world, BlockList.jewelCraftingTable, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, 3, 1, 3, sbb); + generateDisplayer(world, 3, 1, 4, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + generateChest(world, 3, 1, 5, 0, random, sbb, ConfigHandler.GEM_CHEST_MIN, ConfigHandler.jewelsChestMax); + generateFurnace(world, 1, 1, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 1, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateSmelter(world, 1, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateSmelter(world, 1, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateMolder(world, 2, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + generateMolder(world, 2, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + for(int l = 0; l < 6; ++l) + for(int i1 = 2; i1 < 9; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + for(int l = 6; l < 12; ++l) + for(int i1 = 0; i1 < 11; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + spawnVillagers(world, sbb, 3, 1, 3, 1); + return true; + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + */ + public void generateChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, Blocks.chest, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + ItemStack jewels = JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size())); + chest.func_145976_a("Jeweler's Chest"); + if (jewels.getItem() == Items.nether_star && ConfigHandler.GENERATE_VILLAGE_NETHERSTAR) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + else if (random.nextBoolean() && jewels.getItem() != Items.nether_star) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateIngotChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ingot Chest"); + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), metal); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateOresChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ores Chest"); + int oreID = random.nextInt(JewelrycraftUtil.ores.size()); + ItemStack ores = JewelrycraftUtil.ores.get(oreID).copy(); + ores.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), ores); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + */ + public void generateDisplayer(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.displayer, metadata, i, j, k, sbb); + TileEntityDisplayer displayer = (TileEntityDisplayer)world.getTileEntity(i1, j1, k1); + if (displayer != null){ + Item[] jewels = {ItemList.ring, ItemList.necklace}; + ItemStack jewel = new ItemStack(jewels[random.nextInt(jewels.length)]); + JewelryNBT.addMetal(jewel, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()))); + JewelryNBT.addModifiers(jewel, JewelrycraftUtil.addRandomModifiers(random.nextInt(4))); + JewelryNBT.addGem(jewel, JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size()))); + displayer.object = jewel; + displayer.quantity = 1; + displayer.hasObject = true; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param isEmpty + */ + public void generateSmelter(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean isEmpty) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.smelter, metadata, i, j, k, sbb); + TileEntitySmelter smelter = (TileEntitySmelter)world.getTileEntity(i1, j1, k1); + if (smelter != null && !isEmpty){ + int metal = random.nextInt(JewelrycraftUtil.metal.size()); + smelter.moltenMetal = JewelrycraftUtil.metal.get(metal).copy(); + smelter.hasMoltenMetal = true; + int quantity = random.nextInt(9); + switch(quantity) + { + case 0: + smelter.quantity = 0.1f; + case 1: + smelter.quantity = 0.2f; + case 2: + smelter.quantity = 0.3f; + case 3: + smelter.quantity = 0.4f; + case 4: + smelter.quantity = 0.5f; + case 5: + smelter.quantity = 0.6f; + case 6: + smelter.quantity = 0.7f; + case 7: + smelter.quantity = 0.8f; + case 8: + smelter.quantity = 0.9f; + default: + smelter.quantity = 0.1f; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param hasMold + * @param hasStuff + */ + public void generateMolder(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean hasMold, boolean hasStuff) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.molder, metadata, i, j, k, sbb); + TileEntityMolder molder = (TileEntityMolder)world.getTileEntity(i1, j1, k1); + if (molder != null && !molder.hasMold) if (hasMold){ + int meta = random.nextInt(ItemMolds.moldsItemNames.length); + molder.mold = new ItemStack(ItemList.molds, 1, meta); + molder.hasMold = true; + if (hasStuff){ + ItemStack ring = new ItemStack(ItemList.ring); + JewelryNBT.addMetal(ring, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack necklace = new ItemStack(ItemList.necklace); + JewelryNBT.addMetal(necklace, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack bracelet = new ItemStack(ItemList.bracelet); + JewelryNBT.addMetal(bracelet, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack earrings = new ItemStack(ItemList.earrings); + JewelryNBT.addMetal(earrings, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + if (meta == 0) molder.jewelBase = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())); + else if (meta == 1) molder.jewelBase = ring; + else if (meta == 2) molder.jewelBase = necklace; + else if (meta == 3) molder.jewelBase = bracelet; + else if (meta == 4) molder.jewelBase = earrings; + molder.hasJewelBase = true; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param hasMetal + */ + public void generateFurnace(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, boolean hasMetal) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, Blocks.furnace, metadata, i, j, k, sbb); + TileEntityFurnace furnace = (TileEntityFurnace)world.getTileEntity(i1, j1, k1); + if (furnace != null){ + if (random.nextBoolean()) furnace.setInventorySlotContents(1, new ItemStack(Items.coal, 1 + random.nextInt(16))); + if (hasMetal){ + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = random.nextInt(max - min + 1) + min; + furnace.setInventorySlotContents(2, metal); + } + } + } + + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + * + * @param par1 + * @return + */ + @Override + protected int getVillagerType(int par1) + { + return 3000; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/20e626ed27e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/20e626ed27e60014127dc373d78c1666 new file mode 100644 index 0000000..760e13b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/20e626ed27e60014127dc373d78c1666 @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); +// this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/802b92950fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/802b92950fe60014127dc373d78c1666 new file mode 100644 index 0000000..f345333 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/802b92950fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 1.6F); + GL11.glRotatef(75f, 0f, 1f, 0f); + GL11.glRotatef(-15f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/a080bd0705de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/a080bd0705de00141043c3025ec60dfc deleted file mode 100644 index 9ea76a5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/a080bd0705de00141043c3025ec60dfc +++ /dev/null @@ -1,132 +0,0 @@ -package darkknight.jewelrycraft.block; - -import java.util.Random; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; - -public class BlockShadowEye extends BlockContainer -{ - Random rand = new Random(); - - protected BlockShadowEye() - { - super(Material.rock); - } - - /** - * @param world - * @param var2 - * @return - */ - @Override - public TileEntity createNewTileEntity(World world, int var2) - { - return new TileEntityShadowEye(); - } - - /** - * @return - */ - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - /** - * @param iblockaccess - * @param i - * @param j - * @param k - * @param l - * @return - */ - @Override - public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) - { - return false; - } - - /** - * @return - */ - @Override - public boolean isOpaqueCube() - { - return false; - } - - /** - * @return - */ - @Override - public int getRenderType() - { - return -1; - } - - /** - * @param world - * @param i - * @param j - * @param k - * @param entityPlayer - * @param par6 - * @param par7 - * @param par8 - * @param par9 - * @return - */ - @Override - public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) - { - TileEntityShadowEye tile = (TileEntityShadowEye)world.getTileEntity(i, j, k); - tile.active = true; - tile.target = entityPlayer; - return true; - } - - /** - * @param world - * @param i - * @param j - * @param k - * @param player - */ - @Override - public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) - {} - - /** - * @param world - * @param i - * @param j - * @param k - * @param entityLiving - * @param par6ItemStack - */ - @Override - public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack) - { - int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - world.setBlockMetadataWithNotify(i, j, k, rotation, 2); - } - - /** - * @param icon - */ - @Override - public void registerBlockIcons(IIconRegister icon) - { - blockIcon = icon.registerIcon("minecraft:stonebrick"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/e0c402be67dd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/e0c402be67dd001412dce27813e7be4a deleted file mode 100644 index d6876f8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/e0c402be67dd001412dce27813e7be4a +++ /dev/null @@ -1,123 +0,0 @@ -package darkknight.jewelrycraft.events; - -import java.util.Iterator; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.entities.renders.RenderHelper; -import darkknight.jewelrycraft.item.render.BraceletRender; -import darkknight.jewelrycraft.item.render.EarringsRender; -import darkknight.jewelrycraft.item.render.MaskRender; -import darkknight.jewelrycraft.model.ModelBracelet; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class PlayerRenderHandler -{ - MaskRender mask = new MaskRender(); - EarringsRender earrings = new EarringsRender(); - BraceletRender bracelet = new BraceletRender(); - public static String[] infamyCache = new String[]{}; - - @SubscribeEvent - public void renderScreen(RenderPlayerEvent.Specials.Post event) - { - ModelBiped main = event.renderer.modelBipedMain; - Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); - if (infamyCache != null){ - while (players.hasNext()){ - EntityPlayer player = players.next(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - System.out.println(playerInfo); - if (checkPlayerInfamy(player.getDisplayName()) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){ - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(1.6f, 1.6f, 1.6f); - GL11.glTranslatef(-0.25F, -0.25F, -0.25F); - mask.doRender(event.entityPlayer, 0F, 0F, 0F, 0F, 0F); - GL11.glPopMatrix(); - } - if (playerInfo.hasKey("ext17") && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext17"); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(0.07f, 0.07f, 0.07f); - GL11.glTranslatef(0.0F, 3.0F, -2.0F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - earrings.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - GL11.glPopMatrix(); - } - for(int i = 10; i <= 13; i++) - if (playerInfo.hasKey("ext" + i) && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glTranslatef((i / 12 == 1) ? -0.275F : 0.475F, 0.2F + ((i / 12 == 1) ? (i - 12) * 0.08F : (i - 10) * 0.08F), 0F); - if (player.isSneaking()) GL11.glTranslatef(0F, 0F, -((i == 10 || i == 12) ? (0.1F) : 0.05F)); - if (i / 12 == 1){ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedRightArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0.0F); - }else{ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedLeftArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - } - GL11.glPopMatrix(); - } - } - } - } - - /** - * @param string - * @return - */ - private boolean checkPlayerInfamy(String string) - { - for(int i = 0; i < infamyCache.length; i++) - if (infamyCache[i].equals(string)) return true; - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/00f9e72d10e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/00f9e72d10e60014127dc373d78c1666 new file mode 100644 index 0000000..90b8f66 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/00f9e72d10e60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/208d91aafae40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/208d91aafae40014174fe663e69b8422 new file mode 100644 index 0000000..78287bf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/208d91aafae40014174fe663e69b8422 @@ -0,0 +1,12 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +/** + * @author Sorin + * + */ +public class ItemGoldifiedObject +{ +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/3035f90c0cde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/3035f90c0cde00141043c3025ec60dfc deleted file mode 100644 index 4aebfd0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/3035f90c0cde00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; -// System.out.println(red + " " + green + " " + blue); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glColorMask(true, true, true, true); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/70125005fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/70125005fde40014174fe663e69b8422 new file mode 100644 index 0000000..e497953 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/70125005fde40014174fe663e69b8422 @@ -0,0 +1,46 @@ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldifiedObject extends Item +{ + public ItemGoldifiedObject() + {} + +// public boolean requiresMultipleRenderPasses() +// { +// return true; +// } +// +// @SideOnly (Side.CLIENT) +// public int getColorFromItemStack(ItemStack stack, int pass) +// { +// return 0xffff00; +// } +// +// @Override +// public IIcon getIcon(ItemStack stack, int pass) +// { +// if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); +// return itemIcon; +// } +// +// public String getItemStackDisplayName(ItemStack stack) +// { +// return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); +// } +// +// public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) +// { +// if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); +// } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/10b2fd5626e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/10b2fd5626e60014127dc373d78c1666 new file mode 100644 index 0000000..b0d4c4b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/10b2fd5626e60014127dc373d78c1666 @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.client; + +import main.java.tconstruct.client.AbstractTab; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketKeyPressEvent; + +public class TabJewelry extends AbstractTab +{ + public TabJewelry() + { + super(0, 0, 0, new ItemStack(ItemList.necklace)); + } + + @Override + public void onTabClicked () + { + JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(0)); + } + + @Override + public boolean shouldAddToList () + { + return true; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/30ee099203de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/30ee099203de00141043c3025ec60dfc deleted file mode 100644 index 3f0a3a9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/30ee099203de00141043c3025ec60dfc +++ /dev/null @@ -1,278 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (target != null && worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D)).contains(target)){ - active = false; - timer = -1; - } - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - else if(pedestal != null && target != null) JewelrycraftUtil.addCursePoints(target, 20); - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/70c41ccd0fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/70c41ccd0fe60014127dc373d78c1666 new file mode 100644 index 0000000..4d35230 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/70c41ccd0fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.4F, 0.95F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/902e10a698e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/902e10a698e3001412c4c4819c88e86b new file mode 100644 index 0000000..a58d4e1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/902e10a698e3001412c4c4819c88e86b @@ -0,0 +1,26 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; +// GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.target.posX - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/a02202f990e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/a02202f990e3001417b2e384bf7c3702 new file mode 100644 index 0000000..cd64227 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/a02202f990e3001417b2e384bf7c3702 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glColor3f(1F, 0.0F, 1.0F); + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + RenderManager.instance.renderEntityStatic(midas.target, 1F, false); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/000e0f74fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/000e0f74fde40014174fe663e69b8422 new file mode 100644 index 0000000..72283da --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/000e0f74fde40014174fe663e69b8422 @@ -0,0 +1,79 @@ +package darkknight.jewelrycraft.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.tileentity.TileEntityAltar; +import darkknight.jewelrycraft.tileentity.TileEntityBlockShadow; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.Variables; + +public class BlockList +{ + public static Block shadowOre, smelter, molder, displayer, jewelCraftingTable, shadowBlock, shadowEye, jewelAltar, handPedestal, shadowHand, midasTouchBlock, bloi; + public static BlockMoltenMetal moltenMetal; + public static Fluid moltenMetalFluid; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + shadowOre = new BlockJCOre().setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockTextureName(Variables.MODID + ":oreShadow").setBlockName(Variables.MODID + ".oreShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + smelter = new BlockSmelter().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".smelter").setCreativeTab(JewelrycraftMod.jewelrycraft); + molder = new BlockMolder(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".molder").setCreativeTab(JewelrycraftMod.jewelrycraft); + displayer = new BlockDisplayer(Material.iron).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypeMetal).setBlockName(Variables.MODID + ".displayer").setCreativeTab(JewelrycraftMod.jewelrycraft); + jewelCraftingTable = new BlockJewelrsCraftingTable(Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".jewelCraftingTable").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowBlock = new BlockShadow().setHardness(5.0F).setResistance(7.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName(Variables.MODID + ":blockShadow").setBlockName(Variables.MODID + ".blockShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + jewelAltar = new BlockJewelAltar().setHardness(5.0F).setResistance(2.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName(Variables.MODID + ":altar").setBlockName(Variables.MODID + ".altar").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowEye = new BlockShadowEye().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".shadowEye").setCreativeTab(JewelrycraftMod.jewelrycraft); + handPedestal = new BlockHandPedestal(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".handPedestal").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowHand = new BlockShadowHand(Material.rock).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".shadowHand").setCreativeTab(JewelrycraftMod.jewelrycraft).setBlockUnbreakable(); + midasTouchBlock = new BlockMidasTouch(Material.iron).setHardness(3.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal).setBlockName(Variables.MODID + ".midasTouchBlock"); + bloi = new Block(Material.iron).setHardness(3.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal).setBlockName(Variables.MODID + ".midasTouchBlock"); + + + GameRegistry.registerBlock(shadowOre, "shadowOre"); + GameRegistry.registerBlock(shadowBlock, "shadowBlock"); + GameRegistry.registerBlock(smelter, "Smelter"); + GameRegistry.registerBlock(molder, "Molder"); + GameRegistry.registerBlock(jewelCraftingTable, "jewelCraftingTable"); + GameRegistry.registerBlock(displayer, "Displayer"); + GameRegistry.registerBlock(jewelAltar, "Altar"); + GameRegistry.registerBlock(shadowEye, "Shadow Eye"); + GameRegistry.registerBlock(handPedestal, "Stone Bricks Pedestal"); + GameRegistry.registerBlock(shadowHand, "Shadow Hand"); + GameRegistry.registerBlock(midasTouchBlock, "Midas Touch Block"); + + GameRegistry.registerTileEntity(TileEntitySmelter.class, Variables.MODID + ":smelter"); + GameRegistry.registerTileEntity(TileEntityMolder.class, Variables.MODID + ":molder"); + GameRegistry.registerTileEntity(TileEntityJewelrsCraftingTable.class, Variables.MODID + ":table"); + GameRegistry.registerTileEntity(TileEntityDisplayer.class, Variables.MODID + ":displayer"); + GameRegistry.registerTileEntity(TileEntityBlockShadow.class, Variables.MODID + ":blockShadow"); + GameRegistry.registerTileEntity(TileEntityAltar.class, Variables.MODID + ":altar"); + GameRegistry.registerTileEntity(TileEntityShadowEye.class, Variables.MODID + ":shadowEye"); + GameRegistry.registerTileEntity(TileEntityHandPedestal.class, Variables.MODID + ":handPedestal"); + GameRegistry.registerTileEntity(TileEntityShadowHand.class, Variables.MODID + ":shadowHand"); + GameRegistry.registerTileEntity(TileEntityMidasTouch.class, Variables.MODID + ":midsaTouch"); + + moltenMetalFluid = new Fluid("metal.molten").setLuminosity(15).setDensity(3000).setTemperature(2000).setViscosity(6000); + if (!FluidRegistry.registerFluid(moltenMetalFluid)) moltenMetalFluid = FluidRegistry.getFluid("metal.molten"); + moltenMetal = new BlockMoltenMetal(moltenMetalFluid, Material.lava); + GameRegistry.registerBlock(moltenMetal, "moltenMetalLiquid"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/205923f410e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/205923f410e60014127dc373d78c1666 new file mode 100644 index 0000000..01b9351 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/205923f410e60014127dc373d78c1666 @@ -0,0 +1,585 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/60f9f2d236e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/60f9f2d236e100141e1cc3c3be242e56 new file mode 100644 index 0000000..ed833cf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/60f9f2d236e100141e1cc3c3be242e56 @@ -0,0 +1,454 @@ +package darkknight.jewelrycraft.worldGen.village; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureVillagePieces; +import net.minecraft.world.gen.structure.StructureVillagePieces.Start; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.ItemMolds; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class ComponentJewelry extends StructureVillagePieces.House1 +{ + private int averageGroundLevel = -1; + + /** + * + */ + public ComponentJewelry() + {} + + /** + * @param par1ComponentVillageStartPiece + * @param par2 + * @param par3Random + * @param par4StructureBoundingBox + * @param par5 + */ + public ComponentJewelry(Start par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) + { + super(); + coordBaseMode = par5; + boundingBox = par4StructureBoundingBox; + } + + /** + * @param villagePiece + * @param pieces + * @param random + * @param p1 + * @param p2 + * @param p3 + * @param p4 + * @param p5 + * @return + */ + @SuppressWarnings ("rawtypes") + public static ComponentJewelry buildComponent(Start villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 11, 5, 12, p4); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentJewelry(villagePiece, p5, random, structureboundingbox, p4) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the end, it adds Fences... + * + * @param world + * @param random + * @param sbb + * @return + */ + @Override + public boolean addComponentParts(World world, Random random, StructureBoundingBox sbb) + { + if (averageGroundLevel < 0){ + averageGroundLevel = getAverageGroundLevel(world, sbb); + if (averageGroundLevel < 0) return true; + boundingBox.offset(0, averageGroundLevel - boundingBox.maxY + 3, 0); + } + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace) + */ + fillWithBlocks(world, sbb, 0, 0, 6, 10, 5, 11, Block.getBlockById(0), Block.getBlockById(0), false); + fillWithBlocks(world, sbb, 2, 0, 0, 8, 5, 5, Block.getBlockById(0), Block.getBlockById(0), false); + // Pillars + fillWithBlocks(world, sbb, 2, 0, 0, 2, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 2, 0, 3, 2, 3, 3, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 0, 8, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 3, 8, 3, 3, Blocks.log, Blocks.log, false); + // Walls + fillWithBlocks(world, sbb, 2, 0, 1, 2, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 2, 0, 4, 2, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 1, 8, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 4, 8, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 3, 0, 0, 7, 3, 0, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 3, 6, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 11, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 6, 0, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 10, 0, 6, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + // Roof + for(int i = 3; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 2, i, 4, j, sbb); + for(int i = 3; i <= 7; i++) + for(int j = 6; j <= 6; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, i, 4, j, sbb); + for(int i = 1; i <= 9; i++) + for(int j = 7; j <= 10; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 3, i, 4, j, sbb); + for(int i = 2; i <= 8; i++) + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, i, 4, 0, sbb); + for(int i = 1; i <= 5; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 2, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 8, 4, i, sbb); + } + for(int i = 0; i <= 2; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 6, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i + 8, 4, 6, sbb); + } + for(int i = 7; i <= 11; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 0, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 10, 4, i, sbb); + } + for(int i = 0; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 11, sbb); + // Base + for(int i = 2; i <= 8; i++) + for(int j = 0; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.planks, 1, i, 0, j, sbb); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 0, 11, Blocks.stonebrick, Blocks.stonebrick, false); + for(int i = 6; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 5, 0, i, sbb); + for(int i = 7; i <= 10; i++){ + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 1, 0, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 9, 0, i, sbb); + } + // Decorations + placeDoorAtCurrentPosition(world, sbb, random, 6, 1, 0, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeDoorAtCurrentPosition(world, sbb, random, 5, 1, 6, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 3, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 4, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 3, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 3, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 7, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 7, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 10, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 9, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 9, sbb); + int bgCarpetColor = random.nextInt(16); + for(int i = 4; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.carpet, bgCarpetColor, i, 1, j, sbb); + generateChest(world, 3, 1, 1, 0, random, sbb, ConfigHandler.jewelsChestMin, ConfigHandler.jewelsChestMax); + generateDisplayer(world, 3, 1, 2, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + placeBlockAtCurrentPosition(world, BlockList.jewelCraftingTable, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, 3, 1, 3, sbb); + generateDisplayer(world, 3, 1, 4, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + generateChest(world, 3, 1, 5, 0, random, sbb, ConfigHandler.jewelsChestMin, ConfigHandler.jewelsChestMax); + generateFurnace(world, 1, 1, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 1, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateSmelter(world, 1, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateSmelter(world, 1, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateMolder(world, 2, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + generateMolder(world, 2, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + else generateOresChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack); + for(int l = 0; l < 6; ++l) + for(int i1 = 2; i1 < 9; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + for(int l = 6; l < 12; ++l) + for(int i1 = 0; i1 < 11; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + spawnVillagers(world, sbb, 3, 1, 3, 1); + return true; + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + */ + public void generateChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, Blocks.chest, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + ItemStack jewels = JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size())); + chest.func_145976_a("Jeweler's Chest"); + if (jewels.getItem() == Items.nether_star && ConfigHandler.GENERATE_VILLAGE_NETHERSTAR) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + else if (random.nextBoolean() && jewels.getItem() != Items.nether_star) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateIngotChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ingot Chest"); + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), metal); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateOresChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ores Chest"); + int oreID = random.nextInt(JewelrycraftUtil.ores.size()); + ItemStack ores = JewelrycraftUtil.ores.get(oreID).copy(); + ores.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), ores); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + */ + public void generateDisplayer(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.displayer, metadata, i, j, k, sbb); + TileEntityDisplayer displayer = (TileEntityDisplayer)world.getTileEntity(i1, j1, k1); + if (displayer != null){ + Item[] jewels = {ItemList.ring, ItemList.necklace}; + ItemStack jewel = new ItemStack(jewels[random.nextInt(jewels.length)]); + JewelryNBT.addMetal(jewel, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()))); + JewelryNBT.addModifiers(jewel, JewelrycraftUtil.addRandomModifiers(random.nextInt(4))); + JewelryNBT.addGem(jewel, JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size()))); + displayer.object = jewel; + displayer.quantity = 1; + displayer.hasObject = true; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param isEmpty + */ + public void generateSmelter(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean isEmpty) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.smelter, metadata, i, j, k, sbb); + TileEntitySmelter smelter = (TileEntitySmelter)world.getTileEntity(i1, j1, k1); + if (smelter != null && !isEmpty){ + int metal = random.nextInt(JewelrycraftUtil.metal.size()); + smelter.moltenMetal = JewelrycraftUtil.metal.get(metal).copy(); + smelter.hasMoltenMetal = true; + int quantity = random.nextInt(9); + switch(quantity) + { + case 0: + smelter.quantity = 0.1f; + case 1: + smelter.quantity = 0.2f; + case 2: + smelter.quantity = 0.3f; + case 3: + smelter.quantity = 0.4f; + case 4: + smelter.quantity = 0.5f; + case 5: + smelter.quantity = 0.6f; + case 6: + smelter.quantity = 0.7f; + case 7: + smelter.quantity = 0.8f; + case 8: + smelter.quantity = 0.9f; + default: + smelter.quantity = 0.1f; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param hasMold + * @param hasStuff + */ + public void generateMolder(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean hasMold, boolean hasStuff) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.molder, metadata, i, j, k, sbb); + TileEntityMolder molder = (TileEntityMolder)world.getTileEntity(i1, j1, k1); + if (molder != null && !molder.hasMold) if (hasMold){ + int meta = random.nextInt(ItemMolds.moldsItemNames.length); + molder.mold = new ItemStack(ItemList.molds, 1, meta); + molder.hasMold = true; + if (hasStuff){ + ItemStack ring = new ItemStack(ItemList.ring); + JewelryNBT.addMetal(ring, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack necklace = new ItemStack(ItemList.necklace); + JewelryNBT.addMetal(necklace, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack bracelet = new ItemStack(ItemList.bracelet); + JewelryNBT.addMetal(bracelet, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack earrings = new ItemStack(ItemList.earrings); + JewelryNBT.addMetal(earrings, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + if (meta == 0) molder.jewelBase = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())); + else if (meta == 1) molder.jewelBase = ring; + else if (meta == 2) molder.jewelBase = necklace; + else if (meta == 3) molder.jewelBase = bracelet; + else if (meta == 4) molder.jewelBase = earrings; + molder.hasJewelBase = true; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param hasMetal + */ + public void generateFurnace(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, boolean hasMetal) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, Blocks.furnace, metadata, i, j, k, sbb); + TileEntityFurnace furnace = (TileEntityFurnace)world.getTileEntity(i1, j1, k1); + if (furnace != null){ + if (random.nextBoolean()) furnace.setInventorySlotContents(1, new ItemStack(Items.coal, 1 + random.nextInt(16))); + if (hasMetal){ + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = random.nextInt(max - min + 1) + min; + furnace.setInventorySlotContents(2, metal); + } + } + } + + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + * + * @param par1 + * @return + */ + @Override + protected int getVillagerType(int par1) + { + return 3000; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/d097cbcdc9df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/d097cbcdc9df00141dc6c962aec96210 deleted file mode 100644 index 651b084..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/d097cbcdc9df00141dc6c962aec96210 +++ /dev/null @@ -1,84 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectBlazePowder extends ModifierEffects -{ - public EffectBlazePowder() - { - super(new ItemStack(Items.blaze_powder)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemNecklace && exists){ - // Positive for necklace - if (player.isBurning() && rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) player.extinguish(); - // Negative for necklace - if (player.isInWater()) player.attackEntityFrom(DamageSource.drown, 1f + (JewelryNBT.numberOfModifiers(item) - 1) * 0.1F); - } - // Negative for bracelet - if (jewelry instanceof ItemBracelet && exists && player.isInWater()){ - double slowAmount = 0.6D + (JewelryNBT.numberOfModifiers(item) - 1)*0.05D; - player.motionX *= slowAmount; - player.motionY *= slowAmount; - player.motionZ *= slowAmount; - player.motionY -= (0.02D + (JewelryNBT.numberOfModifiers(item) - 1)*0.005D); - if (player.isCollidedHorizontally) player.motionY = 0.30000001192092896D; - } - // Negative for earrings - if (jewelry instanceof ItemEarrings && exists){ - if (player.getAir() >= 300) player.setAir(player.getAir() / 2); - else player.setAir(player.getAir() - JewelryNBT.numberOfModifiers(item)); - } - } - - @Override - public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Balanced for ring - if (jewelry instanceof ItemRing && exists && !player.isInWater()) target.setFire(13 - JewelryNBT.numberOfModifiers(item)); - return false; - } - - @Override - public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - return false; - } - - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - {} - - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (jewelry instanceof ItemEarrings && exists && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){ - // Positive for earrings - int stackSize = JewelryNBT.modifierSize(item, modifier); - player.heal((float)(0.05 * stackSize)); - playerInfo.setBoolean("negateDamage", true); - } - // Positive for bracelet - if (jewelry instanceof ItemBracelet && exists) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) playerInfo.setBoolean("negateDamage", true); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/f0452224fde50014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/f0452224fde50014127dc373d78c1666 new file mode 100644 index 0000000..313edf6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/f0452224fde50014127dc373d78c1666 @@ -0,0 +1,94 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 0; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public void onBlockDestroyedByPlayer(World world, int i, int j, int k, int meta) + { + TileEntityMidasTouch te = (TileEntityMidasTouch)world.getTileEntity(i, j, k); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + super.onBlockDestroyedByPlayer(world, i, j, k, meta); + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/50cdf66ecfdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/50cdf66ecfdf00141dc6c962aec96210 deleted file mode 100644 index 70fdcec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/50cdf66ecfdf00141dc6c962aec96210 +++ /dev/null @@ -1,124 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.commands; - -/** - * @author Sorin - * - */ -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; - -public class JewelrycraftCommands extends CommandBase -{ - private List aliases; - - public JewelrycraftCommands() - { - this.aliases = new ArrayList(); - this.aliases.add("jw"); - this.aliases.add("jewelry"); - } - - @Override - public String getCommandName() - { - return "jewelrycraft"; - } - - @Override - public String getCommandUsage(ICommandSender var1) - { - String use = "/jewelrycraft [points]"; -// use += "/jewelrycraft |"; -// use += "/jewelrycraft "; - return use; - } - - @Override - public List getCommandAliases() - { - return aliases; - } - - @Override - public void processCommand(ICommandSender commandSender, String[] astring) - { - if (astring.length == 0 || astring[0].equals("help")) throw new WrongUsageException(getCommandUsage(commandSender)); - if (astring[0].equals("getCursePoints")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - commandSender.addChatMessage(new ChatComponentTranslation(Integer.toString(JewelrycraftUtil.getCursePoints(entityplayermp)))); - }else if (astring[0].equals("addCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points); - }else if (astring[0].equals("setCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points - JewelrycraftUtil.getCursePoints(entityplayermp)); - } -// else if (astring[0].equals("addModifier")){ -// ItemStack item = new ItemStack(CommandBase.getItemByText(commandSender, astring[1])); -// EntityPlayerMP entityplayermp = getPlayer(commandSender, commandSender.getCommandSenderName()); -// ArrayList modifier = new ArrayList(); -// modifier.add(item); -// JewelryNBT.addModifiers(entityplayermp.getCurrentEquippedItem(), modifier); -// } -// else if (astring[0].equals("addCurse")){ -// EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); -// int curse = Integer.valueOf(astring[2]); -// int grade = Integer.valueOf(astring[3]); -// NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(entityplayermp, "Jewelrycraft"); -// if(curse < Curse.getCurseList().size() && grade <= 2) -// { -// EntityEventHandler.addCurse(entityplayermp, playerInfo, curse, grade); -// JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); -// } -// else if(curse >= Curse.getCurseList().size()) entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse ID exceedes the maximum value of " + (Curse.getCurseList().size() - 1))); -// else entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse grade exceedes the maximum value of 2")); -// -// } - } - - @Override - public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring) - { - final List MATCHES = new LinkedList(); - final String ARG_LC = astring[astring.length - 1].toLowerCase(); - if (astring.length == 1){ - if ("addCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCursePoints"); - if ("getCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("getCursePoints"); - if ("setCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("setCursePoints"); -// if ("addModifier".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addModifier"); -// if ("addCurse".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCurse"); - } -// else if (astring.length == 2){ -// if (!astring[0].equals("addModifier")){ -// for(String un: MinecraftServer.getServer().getAllUsernames()) -// if (un.toLowerCase().startsWith(ARG_LC)) MATCHES.add(un); -// }else if (!astring[0].equals("addCurse")) return getListOfStringsFromIterableMatchingLastWord(astring, Item.itemRegistry.getKeys()); -// } - return MATCHES.isEmpty() ? null : MATCHES; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/8031ad1933e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/8031ad1933e100141e1cc3c3be242e56 new file mode 100644 index 0000000..71064eb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/8031ad1933e100141e1cc3c3be242e56 @@ -0,0 +1,190 @@ +/* + * Mod made by DarkKnight during the Modjam 3 + * It's an awesome mod + * I love me! :D + */ +package darkknight.jewelrycraft; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Logger; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; +import cpw.mods.fml.relauncher.Side; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.gui.GuiHandler; +import darkknight.jewelrycraft.commands.JewelrycraftCommands; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.curses.CurseList; +import darkknight.jewelrycraft.damage.DamageSourceList; +import darkknight.jewelrycraft.effects.EffectsList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.events.BucketHandler; +import darkknight.jewelrycraft.events.EntityEventHandler; +import darkknight.jewelrycraft.events.KeyBindings; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketClearColorCache; +import darkknight.jewelrycraft.network.PacketKeyPressEvent; +import darkknight.jewelrycraft.network.PacketRequestLiquidData; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; +import darkknight.jewelrycraft.network.PacketRequestSetSlot; +import darkknight.jewelrycraft.network.PacketSendCurseStats; +import darkknight.jewelrycraft.network.PacketSendLiquidData; +import darkknight.jewelrycraft.network.PacketSendPlayerInfo; +import darkknight.jewelrycraft.proxy.CommonProxy; +import darkknight.jewelrycraft.recipes.CraftingRecipes; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; +import darkknight.jewelrycraft.worldGen.Generation; +import darkknight.jewelrycraft.worldGen.village.ComponentJewelry; +import darkknight.jewelrycraft.worldGen.village.JCTrades; +import darkknight.jewelrycraft.worldGen.village.VillageJewelryHandler; + +@Mod (modid = Variables.MODID, name = Variables.MODNAME, version = Variables.VERSION, guiFactory = Variables.CONFIG_GUI) +public class JewelrycraftMod +{ + @Instance (Variables.MODID) + public static JewelrycraftMod instance; + @SidedProxy (clientSide = Variables.CLIENT_PROXY, serverSide = Variables.SERVER_PROXY) + public static CommonProxy proxy; + public static final Logger logger = Logger.getLogger("Jewelrycraft"); + public static File dir; + public static CreativeTabs jewelrycraft = new CreativeTabs(Variables.MODID){ + @Override + public Item getTabIconItem() + { + return Item.getItemFromBlock(BlockList.jewelCraftingTable); + } + }; + public static CreativeTabs liquids = new CreativeTabLiquids("Liquids"); + public static NBTTagCompound saveData = new NBTTagCompound(); + public static NBTTagCompound clientData = new NBTTagCompound(); + public static File liquidsConf; + public static SimpleNetworkWrapper netWrapper; + public static boolean fancyRender; + + /** + * Pre initialization of mod stuff. + * + * @param e FMLPreInitializationEvent + * @throws IOException Signals that an I/O exception has occurred. + */ + @EventHandler + public void preInit(FMLPreInitializationEvent e) throws IOException + { + ConfigHandler.INSTANCE.loadConfig(e); + BlockList.preInit(e); + ItemList.preInit(e); + CraftingRecipes.preInit(e); + CurseList.preInit(e); + OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot)); + OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre)); + VillagerRegistry.instance().registerVillagerId(3000); + VillagerRegistry.instance().registerVillageTradeHandler(3000, new JCTrades()); + VillagerRegistry.instance().registerVillageCreationHandler(new VillageJewelryHandler()); + try{ + MapGenStructureIO.func_143031_a(ComponentJewelry.class, Variables.MODID + ":Jewelry"); + } + catch(Throwable e2){ + logger.severe("Error registering Jewelrycraft Structures with Vanilla Minecraft: this is expected in versions earlier than 1.7.10"); + } + MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); + MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE); + BucketHandler.INSTANCE.buckets.put(BlockList.moltenMetal, ItemList.bucket); + + ModMetadata metadata = e.getModMetadata(); + List authorList = new ArrayList(); + + authorList.add("OnyxDarkKnight"); + authorList.add("bspkrs"); + authorList.add("domi1819"); + + dir = e.getModConfigurationDirectory(); + proxy.preInit(); + netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Variables.MODID); + netWrapper.registerMessage(PacketRequestLiquidData.class, PacketRequestLiquidData.class, 0, Side.SERVER); + netWrapper.registerMessage(PacketSendLiquidData.class, PacketSendLiquidData.class, 1, Side.CLIENT); + netWrapper.registerMessage(PacketClearColorCache.class, PacketClearColorCache.class, 2, Side.CLIENT); + netWrapper.registerMessage(PacketKeyPressEvent.class, PacketKeyPressEvent.class, 3, Side.SERVER); + netWrapper.registerMessage(PacketRequestPlayerInfo.class, PacketRequestPlayerInfo.class, 4, Side.SERVER); + netWrapper.registerMessage(PacketSendPlayerInfo.class, PacketSendPlayerInfo.class, 5, Side.CLIENT); + netWrapper.registerMessage(PacketSendCurseStats.class, PacketSendCurseStats.class, 6, Side.CLIENT); + netWrapper.registerMessage(PacketRequestSetSlot.class, PacketRequestSetSlot.class, 7, Side.SERVER); + + metadata.autogenerated = false; + metadata.authorList = authorList; + metadata.url = "https://github.com/sor1n/Jewelrycraft"; + + createEntity(EntityHeart.class, Variables.MODID + ".Heart", 0xFF0000, 0xFF0000, false); + createEntity(EntityHalfHeart.class, Variables.MODID + ".Half-Heart", 0x000000, 0xFF0000, false); + + } + + public void createEntity(Class entity, String entityName, int solidColor, int spotColor, boolean hasSpawnEgg) + { + int randomID = EntityRegistry.findGlobalUniqueEntityId(); + if(hasSpawnEgg) EntityRegistry.registerGlobalEntityID(entity, entityName, randomID, solidColor, spotColor); + else EntityRegistry.registerGlobalEntityID(entity, entityName, randomID); + EntityRegistry.registerModEntity(entity, entityName, randomID, this, 40, 3, true); + } + + /** + * Initializes the world generation and key bindings. + * + * @param e FMLInitializationEvent + */ + @EventHandler + public void init(FMLInitializationEvent e) + { + GameRegistry.registerWorldGenerator(new Generation(), 0); + if (FMLCommonHandler.instance().getSide() == Side.CLIENT) FMLCommonHandler.instance().bus().register(new KeyBindings()); + new GuiHandler(); + FMLCommonHandler.instance().bus().register(ConfigHandler.INSTANCE); + } + + /** + * Post initialization of metals, modifiers and others. + * + * @param e FMLPostInitializationEvent + */ + @EventHandler + public void postInit(FMLPostInitializationEvent e) + { + JewelrycraftUtil.addMetals(); + JewelrycraftUtil.jamcrafters(); + EffectsList.postInit(e); + DamageSourceList.postInit(e); + proxy.postInit(); + } + + @Mod.EventHandler + public void serverLoad(FMLServerStartingEvent event) + { + event.registerServerCommand(new JewelrycraftCommands()); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/a0107643fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/a0107643fce40014174fe663e69b8422 new file mode 100644 index 0000000..49637bd --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/a0107643fce40014174fe663e69b8422 @@ -0,0 +1,67 @@ +package darkknight.jewelrycraft.item; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import javax.imageio.ImageIO; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.effects.ModifierEffects; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldifiedObject +{ + public ItemGoldifiedObject() + { + } + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/b0134cea38e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/b0134cea38e100141e1cc3c3be242e56 new file mode 100644 index 0000000..904f3b4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/b0134cea38e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int MAX_VILLAGE_JEWELERS; + public static int JEWELER_WEIGHT; + public static int INGOT_CHEST_MIN; + public static int INGOT_CHEST_MAX; + public static int INGOT_CHEST_MAX_STACK; + public static int GEM_CHEST_MIN; + public static int GEM_CHEST_MAX; + public static int FURNACE_MIN_INGOT_STACK; + public static int FURNACE_MAX_INGOT_STACK; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + JEWELER_WEIGHT = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + INGOT_CHEST_MIN = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX_STACK = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + GEM_CHEST_MIN = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + GEM_CHEST_MAX = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + FURNACE_MIN_INGOT_STACK = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + FURNACE_MAX_INGOT_STACK = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/b0c9916cfde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/b0c9916cfde40014174fe663e69b8422 new file mode 100644 index 0000000..a42a1f3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/b0c9916cfde40014174fe663e69b8422 @@ -0,0 +1,77 @@ +package darkknight.jewelrycraft.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.tileentity.TileEntityAltar; +import darkknight.jewelrycraft.tileentity.TileEntityBlockShadow; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.Variables; + +public class BlockList +{ + public static Block shadowOre, smelter, molder, displayer, jewelCraftingTable, shadowBlock, shadowEye, jewelAltar, handPedestal, shadowHand, midasTouchBlock; + public static BlockMoltenMetal moltenMetal; + public static Fluid moltenMetalFluid; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + shadowOre = new BlockJCOre().setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockTextureName(Variables.MODID + ":oreShadow").setBlockName(Variables.MODID + ".oreShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + smelter = new BlockSmelter().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".smelter").setCreativeTab(JewelrycraftMod.jewelrycraft); + molder = new BlockMolder(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".molder").setCreativeTab(JewelrycraftMod.jewelrycraft); + displayer = new BlockDisplayer(Material.iron).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypeMetal).setBlockName(Variables.MODID + ".displayer").setCreativeTab(JewelrycraftMod.jewelrycraft); + jewelCraftingTable = new BlockJewelrsCraftingTable(Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".jewelCraftingTable").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowBlock = new BlockShadow().setHardness(5.0F).setResistance(7.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName(Variables.MODID + ":blockShadow").setBlockName(Variables.MODID + ".blockShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + jewelAltar = new BlockJewelAltar().setHardness(5.0F).setResistance(2.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName(Variables.MODID + ":altar").setBlockName(Variables.MODID + ".altar").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowEye = new BlockShadowEye().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".shadowEye").setCreativeTab(JewelrycraftMod.jewelrycraft); + handPedestal = new BlockHandPedestal(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".handPedestal").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowHand = new BlockShadowHand(Material.rock).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".shadowHand").setCreativeTab(JewelrycraftMod.jewelrycraft).setBlockUnbreakable(); + midasTouchBlock = new BlockMidasTouch(Material.iron).setHardness(3.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal).setBlockName(Variables.MODID + ".midasTouchBlock"); + + GameRegistry.registerBlock(shadowOre, "shadowOre"); + GameRegistry.registerBlock(shadowBlock, "shadowBlock"); + GameRegistry.registerBlock(smelter, "Smelter"); + GameRegistry.registerBlock(molder, "Molder"); + GameRegistry.registerBlock(jewelCraftingTable, "jewelCraftingTable"); + GameRegistry.registerBlock(displayer, "Displayer"); + GameRegistry.registerBlock(jewelAltar, "Altar"); + GameRegistry.registerBlock(shadowEye, "Shadow Eye"); + GameRegistry.registerBlock(handPedestal, "Stone Bricks Pedestal"); + GameRegistry.registerBlock(shadowHand, "Shadow Hand"); + GameRegistry.registerBlock(midasTouchBlock, "Midas Touch Block"); + + GameRegistry.registerTileEntity(TileEntitySmelter.class, Variables.MODID + ":smelter"); + GameRegistry.registerTileEntity(TileEntityMolder.class, Variables.MODID + ":molder"); + GameRegistry.registerTileEntity(TileEntityJewelrsCraftingTable.class, Variables.MODID + ":table"); + GameRegistry.registerTileEntity(TileEntityDisplayer.class, Variables.MODID + ":displayer"); + GameRegistry.registerTileEntity(TileEntityBlockShadow.class, Variables.MODID + ":blockShadow"); + GameRegistry.registerTileEntity(TileEntityAltar.class, Variables.MODID + ":altar"); + GameRegistry.registerTileEntity(TileEntityShadowEye.class, Variables.MODID + ":shadowEye"); + GameRegistry.registerTileEntity(TileEntityHandPedestal.class, Variables.MODID + ":handPedestal"); + GameRegistry.registerTileEntity(TileEntityShadowHand.class, Variables.MODID + ":shadowHand"); + GameRegistry.registerTileEntity(TileEntityMidasTouch.class, Variables.MODID + ":midsaTouch"); + + moltenMetalFluid = new Fluid("metal.molten").setLuminosity(15).setDensity(3000).setTemperature(2000).setViscosity(6000); + if (!FluidRegistry.registerFluid(moltenMetalFluid)) moltenMetalFluid = FluidRegistry.getFluid("metal.molten"); + moltenMetal = new BlockMoltenMetal(moltenMetalFluid, Material.lava); + GameRegistry.registerBlock(moltenMetal, "moltenMetalLiquid"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/c09197b00ade00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/c09197b00ade00141043c3025ec60dfc deleted file mode 100644 index b276345..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/c09197b00ade00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int alpha = (ingotColor >> 24) & 0xff; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor4f((float)red / 255, (float)green / 255, (float)blue / 255, (float)alpha / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/30c6932ffde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/30c6932ffde40014174fe663e69b8422 new file mode 100644 index 0000000..07bb2b6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/30c6932ffde40014174fe663e69b8422 @@ -0,0 +1,46 @@ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldObject extends Item +{ + public ItemGoldifiedObject() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/e007edb70fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/e007edb70fe60014127dc373d78c1666 new file mode 100644 index 0000000..2a5e97d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/e007edb70fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.4F, 1.0F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/f0eac1132de60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/f0eac1132de60014127dc373d78c1666 new file mode 100644 index 0000000..4275db1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/f0eac1132de60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 1 : 0) - ((tabList.get(1).enabled)?2:0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/002a225726e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/002a225726e60014127dc373d78c1666 new file mode 100644 index 0000000..dfeb767 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/002a225726e60014127dc373d78c1666 @@ -0,0 +1,74 @@ +package main.java.tconstruct.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/10491e1095e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/10491e1095e3001412c4c4819c88e86b new file mode 100644 index 0000000..b23d77d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/10491e1095e3001412c4c4819c88e86b @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntity tile = world.getTileEntity(x, y, z); + if(((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.boundingBox.calculateXOffset(((TileEntityMidasTouch)tile).target.boundingBox, 0f)); + this.setBlockBounds((float)((TileEntityMidasTouch)tile).target.boundingBox.minX, (float)((TileEntityMidasTouch)tile).target.boundingBox.minY, (float)((TileEntityMidasTouch)tile).target.boundingBox.minZ, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxX, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxY, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxZ); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40572ab1dee50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40572ab1dee50014109ec019d2f6c0dc new file mode 100644 index 0000000..8a30566 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40572ab1dee50014109ec019d2f6c0dc @@ -0,0 +1,93 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("ingot ")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40aec02197e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40aec02197e3001412c4c4819c88e86b new file mode 100644 index 0000000..833c904 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40aec02197e3001412c4c4819c88e86b @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.myEntitySize); + this.setBlockBounds(0F, 0F, 0F, 1F, ((TileEntityMidasTouch)tile).target.height, 1F); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/a0fb3f132be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/a0fb3f132be60014127dc373d78c1666 new file mode 100644 index 0000000..6728181 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/a0fb3f132be60014127dc373d78c1666 @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/b0d0b3d167dd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/b0d0b3d167dd001412dce27813e7be4a deleted file mode 100644 index 8a8b0d3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/b0d0b3d167dd001412dce27813e7be4a +++ /dev/null @@ -1,123 +0,0 @@ -package darkknight.jewelrycraft.events; - -import java.util.Iterator; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.entities.renders.RenderHelper; -import darkknight.jewelrycraft.item.render.BraceletRender; -import darkknight.jewelrycraft.item.render.EarringsRender; -import darkknight.jewelrycraft.item.render.MaskRender; -import darkknight.jewelrycraft.model.ModelBracelet; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class PlayerRenderHandler -{ - MaskRender mask = new MaskRender(); - EarringsRender earrings = new EarringsRender(); - BraceletRender bracelet = new BraceletRender(); - public static String[] infamyCache = new String[]{}; - - @SubscribeEvent - public void renderScreen(RenderPlayerEvent.Specials.Post event) - { - ModelBiped main = event.renderer.modelBipedMain; - Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); - if (infamyCache != null){ - while (players.hasNext()){ - EntityPlayer player = players.next(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); -// System.out.println(player + " | " + playerInfo); - if (checkPlayerInfamy(player.getDisplayName()) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){ - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(1.6f, 1.6f, 1.6f); - GL11.glTranslatef(-0.25F, -0.25F, -0.25F); - mask.doRender(event.entityPlayer, 0F, 0F, 0F, 0F, 0F); - GL11.glPopMatrix(); - } - if (playerInfo.hasKey("ext17") && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext17"); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(0.07f, 0.07f, 0.07f); - GL11.glTranslatef(0.0F, 3.0F, -2.0F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - earrings.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - GL11.glPopMatrix(); - } - for(int i = 10; i <= 13; i++) - if (playerInfo.hasKey("ext" + i) && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glTranslatef((i / 12 == 1) ? -0.275F : 0.475F, 0.2F + ((i / 12 == 1) ? (i - 12) * 0.08F : (i - 10) * 0.08F), 0F); - if (player.isSneaking()) GL11.glTranslatef(0F, 0F, -((i == 10 || i == 12) ? (0.1F) : 0.05F)); - if (i / 12 == 1){ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedRightArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0.0F); - }else{ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedLeftArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - } - GL11.glPopMatrix(); - } - } - } - } - - /** - * @param string - * @return - */ - private boolean checkPlayerInfamy(String string) - { - for(int i = 0; i < infamyCache.length; i++) - if (infamyCache[i].equals(string)) return true; - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/c09495102ee60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/c09495102ee60014127dc373d78c1666 new file mode 100644 index 0000000..ae4561c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/c09495102ee60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.*; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.*; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.*; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.*; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glPushMatrix(); + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + GL11.glPopMatrix(); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/d08f4aa603de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/d08f4aa603de00141043c3025ec60dfc deleted file mode 100644 index 1153688..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/d08f4aa603de00141043c3025ec60dfc +++ /dev/null @@ -1,278 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; -// if (target != null && worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D)).contains(target)){ -// active = false; -// timer = -1; -// } - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - else if(pedestal != null && target != null) JewelrycraftUtil.addCursePoints(target, 20); - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/d0a333fafbe40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/d0a333fafbe40014174fe663e69b8422 new file mode 100644 index 0000000..a72948e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/d0a333fafbe40014174fe663e69b8422 @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.*; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemGoldifiedObject goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/2028a19f36e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/2028a19f36e100141e1cc3c3be242e56 new file mode 100644 index 0000000..244533c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/2028a19f36e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean canFurnacesGenerateIngots; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + canFurnacesGenerateIngots = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + maxVillageJewelers = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + jewelerWeight = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + ingotChestMin = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMax = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/308908c731e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/308908c731e100141e1cc3c3be242e56 new file mode 100644 index 0000000..0d35710 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/308908c731e100141e1cc3c3be242e56 @@ -0,0 +1,190 @@ +/* + * Mod made by DarkKnight during the Modjam 3 + * It's an awesome mod + * I love me! :D + */ +package darkknight.jewelrycraft; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Logger; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; +import cpw.mods.fml.relauncher.Side; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.gui.GuiHandler; +import darkknight.jewelrycraft.commands.JewelrycraftCommands; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.curses.CurseList; +import darkknight.jewelrycraft.damage.DamageSourceList; +import darkknight.jewelrycraft.effects.EffectsList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.events.BucketHandler; +import darkknight.jewelrycraft.events.EntityEventHandler; +import darkknight.jewelrycraft.events.KeyBindings; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketClearColorCache; +import darkknight.jewelrycraft.network.PacketKeyPressEvent; +import darkknight.jewelrycraft.network.PacketRequestLiquidData; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; +import darkknight.jewelrycraft.network.PacketRequestSetSlot; +import darkknight.jewelrycraft.network.PacketSendCurseStats; +import darkknight.jewelrycraft.network.PacketSendLiquidData; +import darkknight.jewelrycraft.network.PacketSendPlayerInfo; +import darkknight.jewelrycraft.proxy.CommonProxy; +import darkknight.jewelrycraft.recipes.CraftingRecipes; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; +import darkknight.jewelrycraft.worldGen.Generation; +import darkknight.jewelrycraft.worldGen.village.ComponentJewelry; +import darkknight.jewelrycraft.worldGen.village.JCTrades; +import darkknight.jewelrycraft.worldGen.village.VillageJewelryHandler; + +@Mod (modid = Variables.MODID, name = Variables.MODNAME, version = Variables.VERSION) +public class JewelrycraftMod +{ + @Instance (Variables.MODID) + public static JewelrycraftMod instance; + @SidedProxy (clientSide = "darkknight.jewelrycraft.proxy.ClientProxy", serverSide = "darkknight.jewelrycraft.proxy.CommonProxy") + public static CommonProxy proxy; + public static final Logger logger = Logger.getLogger("Jewelrycraft"); + public static File dir; + public static CreativeTabs jewelrycraft = new CreativeTabs(Variables.MODID){ + @Override + public Item getTabIconItem() + { + return Item.getItemFromBlock(BlockList.jewelCraftingTable); + } + }; + public static CreativeTabs liquids = new CreativeTabLiquids("Liquids"); + public static NBTTagCompound saveData = new NBTTagCompound(); + public static NBTTagCompound clientData = new NBTTagCompound(); + public static File liquidsConf; + public static SimpleNetworkWrapper netWrapper; + public static boolean fancyRender; + + /** + * Pre initialization of mod stuff. + * + * @param e FMLPreInitializationEvent + * @throws IOException Signals that an I/O exception has occurred. + */ + @EventHandler + public void preInit(FMLPreInitializationEvent e) throws IOException + { + ConfigHandler.INSTANCE.loadConfig(e); + BlockList.preInit(e); + ItemList.preInit(e); + CraftingRecipes.preInit(e); + CurseList.preInit(e); + OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot)); + OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre)); + VillagerRegistry.instance().registerVillagerId(3000); + VillagerRegistry.instance().registerVillageTradeHandler(3000, new JCTrades()); + VillagerRegistry.instance().registerVillageCreationHandler(new VillageJewelryHandler()); + try{ + MapGenStructureIO.func_143031_a(ComponentJewelry.class, Variables.MODID + ":Jewelry"); + } + catch(Throwable e2){ + logger.severe("Error registering Jewelrycraft Structures with Vanilla Minecraft: this is expected in versions earlier than 1.7.10"); + } + MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); + MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE); + BucketHandler.INSTANCE.buckets.put(BlockList.moltenMetal, ItemList.bucket); + + ModMetadata metadata = e.getModMetadata(); + List authorList = new ArrayList(); + + authorList.add("OnyxDarkKnight"); + authorList.add("bspkrs"); + authorList.add("domi1819"); + + dir = e.getModConfigurationDirectory(); + proxy.preInit(); + netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Variables.MODID); + netWrapper.registerMessage(PacketRequestLiquidData.class, PacketRequestLiquidData.class, 0, Side.SERVER); + netWrapper.registerMessage(PacketSendLiquidData.class, PacketSendLiquidData.class, 1, Side.CLIENT); + netWrapper.registerMessage(PacketClearColorCache.class, PacketClearColorCache.class, 2, Side.CLIENT); + netWrapper.registerMessage(PacketKeyPressEvent.class, PacketKeyPressEvent.class, 3, Side.SERVER); + netWrapper.registerMessage(PacketRequestPlayerInfo.class, PacketRequestPlayerInfo.class, 4, Side.SERVER); + netWrapper.registerMessage(PacketSendPlayerInfo.class, PacketSendPlayerInfo.class, 5, Side.CLIENT); + netWrapper.registerMessage(PacketSendCurseStats.class, PacketSendCurseStats.class, 6, Side.CLIENT); + netWrapper.registerMessage(PacketRequestSetSlot.class, PacketRequestSetSlot.class, 7, Side.SERVER); + + metadata.autogenerated = false; + metadata.authorList = authorList; + metadata.url = "https://github.com/sor1n/Jewelrycraft"; + + createEntity(EntityHeart.class, Variables.MODID + ".Heart", 0xFF0000, 0xFF0000, false); + createEntity(EntityHalfHeart.class, Variables.MODID + ".Half-Heart", 0x000000, 0xFF0000, false); + +// EntityRegistry.addSpawn(EntityMob.class, 5, 2, 3, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.plains, BiomeGenBase.beach, BiomeGenBase.coldBeach, BiomeGenBase.frozenRiver); + } + + public void createEntity(Class entity, String entityName, int solidColor, int spotColor, boolean hasSpawnEgg) + { + int randomID = EntityRegistry.findGlobalUniqueEntityId(); + if(hasSpawnEgg) EntityRegistry.registerGlobalEntityID(entity, entityName, randomID, solidColor, spotColor); + else EntityRegistry.registerGlobalEntityID(entity, entityName, randomID); + EntityRegistry.registerModEntity(entity, entityName, randomID, this, 40, 3, true); + } + + /** + * Initializes the world generation and key bindings. + * + * @param e FMLInitializationEvent + */ + @EventHandler + public void init(FMLInitializationEvent e) + { + GameRegistry.registerWorldGenerator(new Generation(), 0); + if (FMLCommonHandler.instance().getSide() == Side.CLIENT) FMLCommonHandler.instance().bus().register(new KeyBindings()); + new GuiHandler(); + } + + /** + * Post initialization of metals, modifiers and others. + * + * @param e FMLPostInitializationEvent + */ + @EventHandler + public void postInit(FMLPostInitializationEvent e) + { + JewelrycraftUtil.addMetals(); + JewelrycraftUtil.jamcrafters(); + EffectsList.postInit(e); + DamageSourceList.postInit(e); + proxy.postInit(); + } + + @Mod.EventHandler + public void serverLoad(FMLServerStartingEvent event) + { + event.registerServerCommand(new JewelrycraftCommands()); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/309c6aa024e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/309c6aa024e60014127dc373d78c1666 new file mode 100644 index 0000000..6728181 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/309c6aa024e60014127dc373d78c1666 @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/40e0dc622bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/40e0dc622bde00141043c3025ec60dfc deleted file mode 100644 index 286627e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/40e0dc622bde00141043c3025ec60dfc +++ /dev/null @@ -1,466 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - System.out.println(curseNo + " " + Curse.availableCurses); - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss()){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - Curse.availableCurses.add(l); - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/609361c93ce100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/609361c93ce100141e1cc3c3be242e56 new file mode 100644 index 0000000..adaddd3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/609361c93ce100141e1cc3c3be242e56 @@ -0,0 +1,66 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static int RITUAL_TIME; + + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int MAX_VILLAGE_JEWELERS; + public static int JEWELER_WEIGHT; + public static int INGOT_CHEST_MIN; + public static int INGOT_CHEST_MAX; + public static int INGOT_CHEST_MAX_STACK; + public static int GEM_CHEST_MIN; + public static int GEM_CHEST_MAX; + public static int FURNACE_MIN_INGOT_STACK; + public static int FURNACE_MAX_INGOT_STACK; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + RITUAL_TIME = config.getInt( "Ritual Time", categories[0], 1000, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for the ritual to end."); + + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + JEWELER_WEIGHT = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + INGOT_CHEST_MIN = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX_STACK = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + GEM_CHEST_MIN = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + GEM_CHEST_MAX = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + FURNACE_MIN_INGOT_STACK = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + FURNACE_MAX_INGOT_STACK = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/a003543c36e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/a003543c36e100141e1cc3c3be242e56 new file mode 100644 index 0000000..015bbd9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/a003543c36e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int jewelryCraftingTime; + public static boolean generateVillageNetherstar; + public static boolean canFurnacesGenerateIngots; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + jewelryCraftingTime = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + generateVillageNetherstar = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + canFurnacesGenerateIngots = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + maxVillageJewelers = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + jewelerWeight = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + ingotChestMin = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMax = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/e0326bc32bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/e0326bc32bde00141043c3025ec60dfc deleted file mode 100644 index dc8d297..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/e0326bc32bde00141043c3025ec60dfc +++ /dev/null @@ -1,123 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.commands; - -/** - * @author Sorin - * - */ -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; - -public class JewelrycraftCommands extends CommandBase -{ - private List aliases; - - public JewelrycraftCommands() - { - this.aliases = new ArrayList(); - this.aliases.add("jw"); - this.aliases.add("jewelry"); - } - - @Override - public String getCommandName() - { - return "jewelrycraft"; - } - - @Override - public String getCommandUsage(ICommandSender var1) - { - String use = "/jewelrycraft [points]"; -// use += "/jewelrycraft |"; -// use += "/jewelrycraft "; - return use; - } - - @Override - public List getCommandAliases() - { - return aliases; - } - - @Override - public void processCommand(ICommandSender commandSender, String[] astring) - { - if (astring.length == 0 || astring[0].equals("help")) throw new WrongUsageException(getCommandUsage(commandSender)); - if (astring[0].equals("getCursePoints")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - commandSender.addChatMessage(new ChatComponentTranslation(Integer.toString(JewelrycraftUtil.getCursePoints(entityplayermp)))); - }else if (astring[0].equals("addCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points); - }else if (astring[0].equals("setCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points - JewelrycraftUtil.getCursePoints(entityplayermp)); - } -// else if (astring[0].equals("addModifier")){ -// ItemStack item = new ItemStack(CommandBase.getItemByText(commandSender, astring[1])); -// EntityPlayerMP entityplayermp = getPlayer(commandSender, commandSender.getCommandSenderName()); -// ArrayList modifier = new ArrayList(); -// modifier.add(item); -// JewelryNBT.addModifiers(entityplayermp.getCurrentEquippedItem(), modifier); -// } -// else if (astring[0].equals("addCurse")){ -// EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); -// int curse = Integer.valueOf(astring[2]); -// int grade = Integer.valueOf(astring[3]); -// NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(entityplayermp, "Jewelrycraft"); -// if(curse < Curse.getCurseList().size() && grade <= 2) -// { -// EntityEventHandler.addCurse(entityplayermp, playerInfo, curse, grade); -// JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); -// } -// else if(curse >= Curse.getCurseList().size()) entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse ID exceedes the maximum value of " + (Curse.getCurseList().size() - 1))); -// else entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse grade exceedes the maximum value of 2")); -// -// } - } - - @Override - public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring) - { - final List MATCHES = new LinkedList(); - final String ARG_LC = astring[astring.length - 1].toLowerCase(); - if (astring.length == 1){ - if ("addCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCursePoints"); - if ("getCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("getCursePoints"); - if ("setCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("setCursePoints"); -// if ("addModifier".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addModifier"); -// if ("addCurse".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCurse"); - }else if (astring.length == 2){ - if (!astring[0].equals("addModifier")){ - for(String un: MinecraftServer.getServer().getAllUsernames()) - if (un.toLowerCase().startsWith(ARG_LC)) MATCHES.add(un); - }else if (!astring[0].equals("addCurse")) return getListOfStringsFromIterableMatchingLastWord(astring, Item.itemRegistry.getKeys()); - } - return MATCHES.isEmpty() ? null : MATCHES; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/90bc489493e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/90bc489493e3001412c4c4819c88e86b new file mode 100644 index 0000000..c6df60c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/90bc489493e3001412c4c4819c88e86b @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.tileentity; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityMidasTouch extends TileEntity +{ + public Entity target; + + public TileEntityMidasTouch() + {} + + public void setEntity(Entity ent) + { + target = ent; + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + if (target != null){ + int id = EntityList.getEntityID(target); + NBTTagCompound tag = new NBTTagCompound(); + target.writeToNBT(tag); + nbt.setInteger("entityID", id); + nbt.setTag("entity", tag); + } + } + + /** + * @param nbt + */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + NBTTagCompound en = (NBTTagCompound)nbt.getTag("entity"); + int entityID = nbt.getInteger("entityID"); + EntityLivingBase entity = (EntityLivingBase)EntityList.createEntityByID(entityID, worldObj); + entity.readFromNBT(en); + target = entity; + } + + /** + * + */ + @Override + public void updateEntity() + { + super.updateEntity(); + } + + /** + * @return + */ + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + /** + * @param net + * @param packet + */ + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + readFromNBT(packet.func_148857_g()); + worldObj.func_147479_m(xCoord, yCoord, zCoord); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/f05c135726e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/f05c135726e60014127dc373d78c1666 new file mode 100644 index 0000000..99d9741 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/f05c135726e60014127dc373d78c1666 @@ -0,0 +1,24 @@ +package main.java.tconstruct.client; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class InventoryTabVanilla extends AbstractTab +{ + public InventoryTabVanilla() + { + super(0, 0, 0, new ItemStack(Blocks.crafting_table)); + } + + @Override + public void onTabClicked () + { + TabRegistry.openInventoryGui(); + } + + @Override + public boolean shouldAddToList () + { + return true; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/b0ea5e5c03de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/b0ea5e5c03de00141043c3025ec60dfc deleted file mode 100644 index d102547..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/b0ea5e5c03de00141043c3025ec60dfc +++ /dev/null @@ -1,94 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && pos != -1){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if (rand.nextInt(3) == 0 && (arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0)) arrow.setDead(); - } - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && pos != -1){ - if (player.motionY < 0) player.motionY *= 0.6D; - player.capabilities.setPlayerWalkSpeed(0.1F); -// player.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.001D); - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80, 1)); - player.fallDistance = 0F; - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && pos != -1 && enemyData.getInteger("reAttacked") == 0){ - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (jewelry instanceof ItemNecklace && pos != -1 && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && pos != -1 && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/f01a9f8d0fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/f01a9f8d0fe60014127dc373d78c1666 new file mode 100644 index 0000000..0ced66b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/f01a9f8d0fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.6F); + GL11.glRotatef(75f, 0f, 1f, 0f); + GL11.glRotatef(-15f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); +// GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); +// GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/20a0aab003e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/20a0aab003e60014127dc373d78c1666 new file mode 100644 index 0000000..009fcba --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/20a0aab003e60014127dc373d78c1666 @@ -0,0 +1,41 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.block.BlockMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +/** + * @author Sorin + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + // System.out.println("Broken " + event.getResult()); + ItemStack item = event.getPlayer().inventory.getCurrentItem(); + if (event.block instanceof BlockMidasTouch && item != null && event.block.getHarvestLevel(event.blockMetadata) >= item.getItem().getHarvestLevel(item, "pickaxe")){ + System.out.println(event.block.getHarvestLevel(3) + " " + item.getItem().getHarvestLevel(item, "pickaxe")); + TileEntityMidasTouch te = (TileEntityMidasTouch)event.world.getTileEntity(event.x, event.y, event.z); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + } + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/40a455692be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/40a455692be60014127dc373d78c1666 new file mode 100644 index 0000000..c1de9eb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/40a455692be60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || !tabList.get(0).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(0).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/40c3ebde71e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/40c3ebde71e300141084bb8bfb075c08 new file mode 100644 index 0000000..89a05e0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/40c3ebde71e300141084bb8bfb075c08 @@ -0,0 +1,38 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.damage.DamageSourceList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; +import darkknight.jewelrycraft.util.Variables; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && !(target instanceof EntityMob) && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart)){ + target.setDead(); + world.setBlock(target.posX, target.posY, target.posZ, BlockList.midasTouchBlock, 0, 2); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/0091fdd79ce3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/0091fdd79ce3001412c4c4819c88e86b new file mode 100644 index 0000000..81589a5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/0091fdd79ce3001412c4c4819c88e86b @@ -0,0 +1,96 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 0; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public void breakBlock(World world, int i, int j, int k, Block par5, int par6) + { + TileEntityMidasTouch te = (TileEntityMidasTouch)world.getTileEntity(i, j, k); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); +// world.removeTileEntity(i, j, k); + System.out.println("drop"); + super.breakBlock(world, i, j, k, par5, par6); + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/80e3852ffde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/80e3852ffde40014174fe663e69b8422 new file mode 100644 index 0000000..a499d75 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/80e3852ffde40014174fe663e69b8422 @@ -0,0 +1,46 @@ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldifiedObject extends Item +{ + public ItemGoldifiedObject() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/a03c4cbb97e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/a03c4cbb97e3001412c4c4819c88e86b new file mode 100644 index 0000000..c7e9a98 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/a03c4cbb97e3001412c4c4819c88e86b @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.width); + this.setBlockBounds(1f - ((TileEntityMidasTouch)tile).target.width/2, 0F, 1f -((TileEntityMidasTouch)tile).target.width/2, 1f +((TileEntityMidasTouch)tile).target.width/2, ((TileEntityMidasTouch)tile).target.height, 1f +((TileEntityMidasTouch)tile).target.width/2); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/206721badae50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/206721badae50014109ec019d2f6c0dc new file mode 100644 index 0000000..0409095 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/206721badae50014109ec019d2f6c0dc @@ -0,0 +1,63 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.*; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + return null; + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/30297e3828e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/30297e3828e60014127dc373d78c1666 new file mode 100644 index 0000000..497d5a9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/30297e3828e60014127dc373d78c1666 @@ -0,0 +1,17 @@ +package darkknight.jewelrycraft.events; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent; + +/** + * @author Sorin + * + */ +public class EventCommonHandler +{ + @SubscribeEvent + public void onItemCrafted(PlayerEvent.ItemCraftedEvent event) + { + System.out.println(event.crafting + " " + event.craftMatrix.getInventoryName()); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/90cc7cc9c8df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/90cc7cc9c8df00141dc6c962aec96210 deleted file mode 100644 index 503da22..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/90cc7cc9c8df00141dc6c962aec96210 +++ /dev/null @@ -1,744 +0,0 @@ -package darkknight.jewelrycraft.util; - -import java.util.ArrayList; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class JewelryNBT -{ - // TODO NBT Tag Adding - /** - * @param item The item you want to add the NBT data on - * @param metal The metal you want to add on the item - */ - public static void addMetal(ItemStack item, ItemStack metal) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound ingotNBT = new NBTTagCompound(); - metal.writeToNBT(ingotNBT); - itemStackData.setTag("ingot", ingotNBT); - } - - /** - * @param item The item you want to add the NBT data on - * @param gem The gem you want to add on the item - */ - public static void addGem(ItemStack item, ItemStack gem) - { - if (gem != null){ - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound gemNBT = new NBTTagCompound(); - gem.writeToNBT(gemNBT); - itemStackData.setTag("gem", gemNBT); - } - } - - /** - * @param item The item you want to add the NBT data on - * @param modifier The modifier you want to add on the item - */ - public static void addModifiers(ItemStack item, ArrayList modifier) - { - if (modifier != null){ - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - for(int i = 0; i < modifier.size(); i++){ - NBTTagCompound modifierNBT = new NBTTagCompound(); - modifier.get(i).writeToNBT(modifierNBT); - itemStackData.setTag("modifier" + i, modifierNBT); - } - itemStackData.setInteger("modifierSize", modifier.size()); - } - } - - /** - * @param item The item you want to add the NBT data on - * @param entity The entity to add on the item - */ - public static void addEntity(ItemStack item, EntityLivingBase entity) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound entityNBT = new NBTTagCompound(); - entity.writeToNBT(entityNBT); - itemStackData.setTag("entity", entityNBT); - } - - /** - * @param item - * @param entity - */ - public static void addEntityID(ItemStack item, EntityLivingBase entity) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound entityNBT = new NBTTagCompound(); - int id = EntityList.getEntityID(entity); - entityNBT.setInteger("entityID", id); - itemStackData.setTag("entityID", entityNBT); - } - - /** - * @param item - * @param x - * @param y - * @param z - */ - public static void addCoordonates(ItemStack item, double x, double y, double z) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound coords = new NBTTagCompound(); - coords.setDouble("x", x); - coords.setDouble("y", y); - coords.setDouble("z", z); - itemStackData.setTag("x", coords); - itemStackData.setTag("y", coords); - itemStackData.setTag("z", coords); - } - - /** - * @param item - * @param world - * @param x - * @param y - * @param z - */ - public static void addTileEntityBlock(ItemStack item, World world, int x, int y, int z) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound tileNBT = new NBTTagCompound(); - NBTTagCompound block = new NBTTagCompound(); - world.getTileEntity(x, y, z).writeToNBT(tileNBT); - itemStackData.setTag("tile", tileNBT); - block.setInteger("blockID", Block.getIdFromBlock(world.getBlock(x, y, z))); - block.setInteger("metadata", world.getBlockMetadata(x, y, z)); - block.setInteger("blockX", x); - block.setInteger("blockY", y); - block.setInteger("blockZ", z); - itemStackData.setTag("metadata", block); - itemStackData.setTag("blockID", block); - itemStackData.setTag("blockX", block); - itemStackData.setTag("blockY", block); - itemStackData.setTag("blockZ", block); - } - - /** - * @param item - * @param block - * @param metadata - */ - public static void addBlock(ItemStack item, int block, int metadata) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound blockNBT = new NBTTagCompound(); - blockNBT.setInteger("blockID", block); - itemStackData.setTag("blockID", blockNBT); - blockNBT.setInteger("metadata", metadata); - itemStackData.setTag("metadata", blockNBT); - } - - /** - * @param item - * @param x - * @param y - * @param z - */ - public static void addBlockCoordonates(ItemStack item, int x, int y, int z) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound coords = new NBTTagCompound(); - coords.setInteger("blockX", x); - coords.setInteger("blockY", y); - coords.setInteger("blockZ", z); - itemStackData.setTag("blockX", coords); - itemStackData.setTag("blockY", coords); - itemStackData.setTag("blockZ", coords); - } - - /** - * @param item - * @param x - * @param y - * @param z - * @param dim - * @param name - */ - public static void addCoordonatesAndDimension(ItemStack item, double x, double y, double z, int dim, String name) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound coords = new NBTTagCompound(); - coords.setDouble("x", x); - coords.setDouble("y", y); - coords.setDouble("z", z); - coords.setInteger("dimension", dim); - coords.setString("dimName", name); - itemStackData.setTag("x", coords); - itemStackData.setTag("y", coords); - itemStackData.setTag("z", coords); - itemStackData.setTag("dimension", coords); - itemStackData.setTag("dimName", coords); - } - - /** - * @param item - */ - public static void addFakeEnchantment(ItemStack item) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - itemStackData.setTag("ench", new NBTTagList()); - } - - /** - * @param item - * @param color - */ - public static void addIngotColor(ItemStack item, int color) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound colors = new NBTTagCompound(); - colors.setInteger("ingotColor", color); - itemStackData.setTag("ingotColor", colors); - } - - // TODO - /** - * @param item - * @param color - */ - public static void addGemColor(ItemStack item, int color) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound colors = new NBTTagCompound(); - colors.setInteger("gemColor", color); - itemStackData.setTag("gemColor", colors); - } - - /** - * @param item - * @param list - */ - @SuppressWarnings ("rawtypes") - public static void addEntities(ItemStack item, List list) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound entityNBT = new NBTTagCompound(); - for(int i = 0; i < list.size(); i++) - ((EntityLivingBase)list.get(i)).writeToNBT(entityNBT); - itemStackData.setTag("entities", entityNBT); - } - - // TODO NBT Tag Removing - /** - * @param item - * @param tag - */ - public static void removeNBT(ItemStack item, String tag) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - itemStackData.removeTag(tag); - } - - /** - * @param item - */ - public static void removeEntity(ItemStack item) - { - JewelryNBT.removeNBT(item, "entityID"); - JewelryNBT.removeNBT(item, "entity"); - JewelryNBT.removeNBT(item, "ench"); - } - - /** - * @param item - */ - public static void removeBlock(ItemStack item) - { - JewelryNBT.removeNBT(item, "blockID"); - JewelryNBT.removeNBT(item, "metadata"); - JewelryNBT.removeNBT(item, "tile"); - JewelryNBT.removeNBT(item, "blockX"); - JewelryNBT.removeNBT(item, "blockY"); - JewelryNBT.removeNBT(item, "blockZ"); - } - - // TODO NTB Tag Checking - /** - * @param item - * @param tag - * @return - */ - public static boolean hasTag(ItemStack item, String tag) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) itemStackData = item.getTagCompound(); - else{ - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - if (itemStackData.hasKey(tag)) return true; - return false; - } - - /** - * @param stack - * @param gem - * @return - */ - public static boolean isGemX(ItemStack stack, ItemStack gem) - { - if (gem(stack) != null && gem(stack).getItem() == gem.getItem() && gem(stack).getItemDamage() == gem.getItemDamage()) return true; - return false; - } - - /** - * @param stack - * @param modifier - * @return - */ - public static int doesModifierExist(ItemStack stack, ItemStack modifier) - { - if (modifier(stack) != null){ - ArrayList list = modifier(stack); - for(int i = 0; i < list.size(); i++) - if (list.get(i).getItem() == modifier.getItem() && list.get(i).getItemDamage() == modifier.getItemDamage()) return i; - } - return -1; - } - - public static int modifierSize(ItemStack stack, ItemStack modifier) - { - if (modifier(stack) != null){ - ArrayList list = modifier(stack); - for(int i = 0; i < list.size(); i++) - if (list.get(i).getItem() == modifier.getItem() && list.get(i).getItemDamage() == modifier.getItemDamage()) return list.get(i).stackSize; - } - return -1; - } - - public static int numberOfModifiers(ItemStack stack) - { - if (modifier(stack) != null) return modifier(stack).size(); - return -1; - } - - /** - * @param stack - * @param ingot - * @return - */ - public static boolean isIngotX(ItemStack stack, ItemStack ingot) - { - if (ingot(stack) != null && ingot(stack).getItem() == ingot.getItem() && ingot(stack).getItemDamage() == ingot.getItemDamage()) return true; - return false; - } - - /** - * @param stack - * @param player - * @param entity - * @return - */ - public static boolean isEntityX(ItemStack stack, EntityPlayer player, EntityLivingBase entity) - { - if (entity != null && entity instanceof EntityLivingBase && entity(stack, player) != null && entity(stack, player).equals(entity)) return true; - return false; - } - - /** - * @param stack - * @param dimName - * @return - */ - public static boolean isDimNameX(ItemStack stack, String dimName) - { - if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; - return false; - } - - /** - * @param stack - * @param dimension - * @return - */ - public static boolean isDimensionX(ItemStack stack, int dimension) - { - if (dimension(stack) != -2 && dimension(stack) == dimension) return true; - return false; - } - - // TODO Return components based on NBT - /** - * @param stack - * @return - */ - public static ItemStack gem(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gem")){ - NBTTagCompound jewelNBT = (NBTTagCompound)stack.getTagCompound().getTag("gem"); - ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); - gem.readFromNBT(jewelNBT); - return gem; - } - return null; - } - - /** - * @param stack - * @return - */ - public static ArrayList modifier(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()){ - int size = stack.getTagCompound().getInteger("modifierSize"); - ArrayList list = new ArrayList(); - for(int i = 0; i < size; i++){ - ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); - NBTTagCompound modifierNBT = (NBTTagCompound)stack.getTagCompound().getTag("modifier" + i); - modifier.readFromNBT(modifierNBT); - list.add(modifier); - } - return list; - } - return null; - } - - /** - * @param stack - * @return - */ - public static ItemStack ingot(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("ingot")){ - NBTTagCompound ingotNBT = (NBTTagCompound)stack.getTagCompound().getTag("ingot"); - ItemStack ingot = new ItemStack(Item.getItemById(0), 0, 0); - ingot.readFromNBT(ingotNBT); - return ingot; - } - return null; - } - - /** - * @param stack - * @param player - * @return - */ - public static EntityLivingBase entity(ItemStack stack, EntityPlayer player) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("entityID") && stack.getTagCompound().hasKey("entity")){ - NBTTagCompound enID = (NBTTagCompound)stack.getTagCompound().getTag("entityID"); - NBTTagCompound en = (NBTTagCompound)stack.getTagCompound().getTag("entity"); - int entityID = 0; - entityID = enID.getInteger("entityID"); - EntityLivingBase entity = (EntityLivingBase)EntityList.createEntityByID(entityID, player.worldObj); - if (entity != null && entity instanceof EntityLivingBase){ - entity.readFromNBT(en); - return entity; - }else return null; - } - return null; - } - - /** - * @param stack - * @return - */ - public static TileEntity tileEntity(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("tile")){ - NBTTagCompound tileNBT = (NBTTagCompound)stack.getTagCompound().getTag("tile"); - TileEntity tile = TileEntity.createAndLoadEntity(tileNBT); - if (tile != null && tile instanceof TileEntity){ - tile.readFromNBT(tileNBT); - return tile; - }else return null; - } - return null; - } - - /** - * @param stack - * @return - */ - public static String dimName(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("dimName")){ - NBTTagCompound dim = (NBTTagCompound)stack.getTagCompound().getTag("dimName"); - String name = dim.getString("dimName"); - return name; - } - return null; - } - - /** - * @param stack - * @return - */ - public static String modeName(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("mode")){ - NBTTagCompound dim = (NBTTagCompound)stack.getTagCompound().getTag("mode"); - String name = dim.getString("mode"); - return name; - } - return null; - } - - /** - * @param stack - * @return - */ - public static int dimension(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("dimension")){ - NBTTagCompound dim = (NBTTagCompound)stack.getTagCompound().getTag("dimension"); - int dimension = dim.getInteger("dimension"); - return dimension; - } - return -2; - } - - /** - * @param stack - * @return - */ - public static int blockCoordX(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockX")){ - NBTTagCompound x = (NBTTagCompound)stack.getTagCompound().getTag("blockX"); - int posX = x.getInteger("blockX"); - return posX; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static int blockCoordY(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockY")){ - NBTTagCompound y = (NBTTagCompound)stack.getTagCompound().getTag("blockY"); - int posY = y.getInteger("blockY"); - return posY; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static int blockCoordZ(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockZ")){ - NBTTagCompound z = (NBTTagCompound)stack.getTagCompound().getTag("blockZ"); - int posZ = z.getInteger("blockZ"); - return posZ; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static int blockID(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockID")){ - NBTTagCompound blockID = (NBTTagCompound)stack.getTagCompound().getTag("blockID"); - int blockId = blockID.getInteger("blockID"); - return blockId; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static int blockMetadata(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("metadata")){ - NBTTagCompound metadataNBT = (NBTTagCompound)stack.getTagCompound().getTag("metadata"); - int metadata = metadataNBT.getInteger("metadata"); - return metadata; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static double playerPosX(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("x")){ - NBTTagCompound x = (NBTTagCompound)stack.getTagCompound().getTag("x"); - double posX = x.getDouble("x"); - return posX; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static double playerPosY(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("y")){ - NBTTagCompound y = (NBTTagCompound)stack.getTagCompound().getTag("y"); - double posY = y.getDouble("y"); - return posY; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static double playerPosZ(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("z")){ - NBTTagCompound z = (NBTTagCompound)stack.getTagCompound().getTag("z"); - double posZ = z.getDouble("z"); - return posZ; - } - return -1; - } - - /** - * @param stack - * @return - */ - public static int ingotColor(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("ingotColor")){ - NBTTagCompound colors = (NBTTagCompound)stack.getTagCompound().getTag("ingotColor"); - int color = colors.getInteger("ingotColor"); - return color; - } - return 16777215; - } - - // TODO - /** - * @param stack - * @return - */ - public static int gemColor(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemColor")){ - NBTTagCompound colors = (NBTTagCompound)stack.getTagCompound().getTag("gemColor"); - int color = colors.getInteger("gemColor"); - return color; - } - return 16777215; - } - - /** - * @param stack - * @param player - * @return - */ - @SuppressWarnings ({"rawtypes", "unchecked", "null"}) - public static List entities(ItemStack stack, EntityPlayer player) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("entities")){ - NBTTagCompound enID = (NBTTagCompound)stack.getTagCompound().getTag("entitiesID"); - List list = null; - int[] entityID; - EntityLivingBase entity; - entityID = enID.getIntArray("entitiesID"); - for(int element: entityID){ - entity = (EntityLivingBase)EntityList.createEntityByID(element, player.worldObj); - list.add(entity); - } - return list; - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/20c24219cedf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/20c24219cedf00141dc6c962aec96210 deleted file mode 100644 index 26f5b0f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/20c24219cedf00141dc6c962aec96210 +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - if(rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2 + JewelryNBT.numberOfModifiers(item)/4)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX)*(rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0? 1:-1); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ)*(rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0? 1:-1); - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 150 - JewelryNBT.numberOfModifiers(item)*10, 2 - JewelryNBT.numberOfModifiers(item)/5)); - // Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(500) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - if (jewelry instanceof ItemRing && exists && rand.nextInt(200) == 12){ - // Negative ring - Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.0F); - // Positive ring - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/700a357f67dd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/700a357f67dd001412dce27813e7be4a deleted file mode 100644 index d6876f8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/700a357f67dd001412dce27813e7be4a +++ /dev/null @@ -1,123 +0,0 @@ -package darkknight.jewelrycraft.events; - -import java.util.Iterator; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.entities.renders.RenderHelper; -import darkknight.jewelrycraft.item.render.BraceletRender; -import darkknight.jewelrycraft.item.render.EarringsRender; -import darkknight.jewelrycraft.item.render.MaskRender; -import darkknight.jewelrycraft.model.ModelBracelet; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class PlayerRenderHandler -{ - MaskRender mask = new MaskRender(); - EarringsRender earrings = new EarringsRender(); - BraceletRender bracelet = new BraceletRender(); - public static String[] infamyCache = new String[]{}; - - @SubscribeEvent - public void renderScreen(RenderPlayerEvent.Specials.Post event) - { - ModelBiped main = event.renderer.modelBipedMain; - Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); - if (infamyCache != null){ - while (players.hasNext()){ - EntityPlayer player = players.next(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - System.out.println(playerInfo); - if (checkPlayerInfamy(player.getDisplayName()) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){ - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(1.6f, 1.6f, 1.6f); - GL11.glTranslatef(-0.25F, -0.25F, -0.25F); - mask.doRender(event.entityPlayer, 0F, 0F, 0F, 0F, 0F); - GL11.glPopMatrix(); - } - if (playerInfo.hasKey("ext17") && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext17"); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(0.07f, 0.07f, 0.07f); - GL11.glTranslatef(0.0F, 3.0F, -2.0F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - earrings.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - GL11.glPopMatrix(); - } - for(int i = 10; i <= 13; i++) - if (playerInfo.hasKey("ext" + i) && player == event.entityPlayer){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glTranslatef((i / 12 == 1) ? -0.275F : 0.475F, 0.2F + ((i / 12 == 1) ? (i - 12) * 0.08F : (i - 10) * 0.08F), 0F); - if (player.isSneaking()) GL11.glTranslatef(0F, 0F, -((i == 10 || i == 12) ? (0.1F) : 0.05F)); - if (i / 12 == 1){ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedRightArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0.0F); - }else{ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedLeftArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - } - GL11.glPopMatrix(); - } - } - } - } - - /** - * @param string - * @return - */ - private boolean checkPlayerInfamy(String string) - { - for(int i = 0; i < infamyCache.length; i++) - if (infamyCache[i].equals(string)) return true; - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/80a6c431dae50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/80a6c431dae50014109ec019d2f6c0dc new file mode 100644 index 0000000..a886880 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/80a6c431dae50014109ec019d2f6c0dc @@ -0,0 +1,60 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.*; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + return null; + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/9070315200e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/9070315200e50014174fe663e69b8422 new file mode 100644 index 0000000..22fbda3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/9070315200e50014174fe663e69b8422 @@ -0,0 +1,54 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + System.out.println(JewelryNBT.item(stack).getIconIndex()); + if (JewelryNBT.item(stack) != null && pass >= 0) return getIconIndex(JewelryNBT.item(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/c061a2c326de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/c061a2c326de00141043c3025ec60dfc deleted file mode 100644 index f156440..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/c061a2c326de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 20) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/008e9c8b2ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/008e9c8b2ce60014127dc373d78c1666 new file mode 100644 index 0000000..39c0121 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/008e9c8b2ce60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/905ab41326e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/905ab41326e60014127dc373d78c1666 new file mode 100644 index 0000000..ddf9398 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/905ab41326e60014127dc373d78c1666 @@ -0,0 +1,71 @@ +package darkknight.jewelrycraft.client.gui; + +import main.java.tconstruct.client.tabs.TabRegistry; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.client.JewelryInventory; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab; +import darkknight.jewelrycraft.events.KeyBindings; + +public class GuiJewelry extends GuiContainer +{ + ResourceLocation texture; + + /** + * @param containerJewelryTab + * @param texture + */ + public GuiJewelry(ContainerJewelryTab containerJewelryTab, ResourceLocation texture) + { + super(containerJewelryTab); + xSize = 194; + ySize = 166; + this.texture = texture; + } + + /** + * @param f + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) + { + GL11.glColor3f(1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + } + + /** + * @param mouseX + * @param mouseY + */ + @Override + public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + {} + + /** + * @param charecter + * @param key + */ + @Override + protected void keyTyped(char charecter, int key) + { + super.keyTyped(charecter, key); + if (key == KeyBindings.inventory.getKeyCode()) mc.thePlayer.closeScreen(); + } + + @Override + public void initGui () + { + super.initGui(); + int cornerX = guiLeft; + int cornerY = guiTop; + this.buttonList.clear(); + TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class); + TabRegistry.addTabsToList(this.buttonList); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/a066fa7271e300141084bb8bfb075c08 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/a066fa7271e300141084bb8bfb075c08 new file mode 100644 index 0000000..e80ad70 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/a066fa7271e300141084bb8bfb075c08 @@ -0,0 +1,36 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import darkknight.jewelrycraft.damage.DamageSourceList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; +import darkknight.jewelrycraft.util.Variables; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && !(target instanceof EntityMob) && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart)){ + target.setDead(); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/60bee40466dd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/60bee40466dd001412dce27813e7be4a deleted file mode 100644 index 4d2ae5c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/60bee40466dd001412dce27813e7be4a +++ /dev/null @@ -1,122 +0,0 @@ -package darkknight.jewelrycraft.events; - -import java.util.Iterator; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.entities.renders.RenderHelper; -import darkknight.jewelrycraft.item.render.BraceletRender; -import darkknight.jewelrycraft.item.render.EarringsRender; -import darkknight.jewelrycraft.item.render.MaskRender; -import darkknight.jewelrycraft.model.ModelBracelet; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class PlayerRenderHandler -{ - MaskRender mask = new MaskRender(); - EarringsRender earrings = new EarringsRender(); - BraceletRender bracelet = new BraceletRender(); - public static String[] infamyCache = new String[]{}; - - @SubscribeEvent - public void renderScreen(RenderPlayerEvent.Specials.Post event) - { - ModelBiped main = event.renderer.modelBipedMain; - Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); - if (infamyCache != null){ - while (players.hasNext()){ - EntityPlayer player = players.next(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (checkPlayerInfamy(player.getDisplayName()) && event.entityPlayer.getDisplayName().equals(player.getDisplayName())){ - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(1.6f, 1.6f, 1.6f); - GL11.glTranslatef(-0.25F, -0.25F, -0.25F); - mask.doRender(event.entityPlayer, 0F, 0F, 0F, 0F, 0F); - GL11.glPopMatrix(); - } - if (playerInfo.hasKey("ext17")){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext17"); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 90, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, -1); - GL11.glRotatef(90F, 0, 1F, 0F); - RenderHelper.translateToHeadLevel(player); - GL11.glScalef(0.07f, 0.07f, 0.07f); - GL11.glTranslatef(0.0F, 3.0F, -2.0F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - earrings.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - GL11.glPopMatrix(); - } - for(int i = 10; i <= 13; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - GL11.glPushMatrix(); - GL11.glColor4f(1, 1, 1, 1); - GL11.glTranslatef((i / 12 == 1) ? -0.275F : 0.475F, 0.2F + ((i / 12 == 1) ? (i - 12) * 0.08F : (i - 10) * 0.08F), 0F); - if (player.isSneaking()) GL11.glTranslatef(0F, 0F, -((i == 10 || i == 12) ? (0.1F) : 0.05F)); - if (i / 12 == 1){ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedRightArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedRightArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0.0F); - }else{ - GL11.glScalef(0.05f, 0.03f, 0.05f); - GL11.glRotatef(main.bipedLeftArm.rotateAngleX * (180F / (float)Math.PI), 1F, 0F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleY * (180F / (float)Math.PI), 0F, 1F, 0F); - GL11.glRotatef(main.bipedLeftArm.rotateAngleZ * (180F / (float)Math.PI), 0F, 0F, 1F); - int gemColor = -1; - int ingotColor = -1; - if (JewelryNBT.gem(item) != null) gemColor = JewelryNBT.gemColor(item); - if (JewelryNBT.ingot(item) != null) ingotColor = JewelryNBT.ingotColor(item); - bracelet.doRender(event.entityPlayer, 0F, 0F, (float)ingotColor, (float)gemColor, 0F); - } - GL11.glPopMatrix(); - } - } - } - } - - /** - * @param string - * @return - */ - private boolean checkPlayerInfamy(String string) - { - for(int i = 0; i < infamyCache.length; i++) - if (infamyCache[i].equals(string)) return true; - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/909313c197e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/909313c197e3001412c4c4819c88e86b new file mode 100644 index 0000000..4567d02 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/909313c197e3001412c4c4819c88e86b @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.width); + this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width/2, 0F, 0.5f -((TileEntityMidasTouch)tile).target.width/2, 1f +((TileEntityMidasTouch)tile).target.width/2, ((TileEntityMidasTouch)tile).target.height, 1f +((TileEntityMidasTouch)tile).target.width/2); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/d0c430372ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/d0c430372ce60014127dc373d78c1666 new file mode 100644 index 0000000..3549582 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/d0c430372ce60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || tabList.get(1).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/e0e674522ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/e0e674522ce60014127dc373d78c1666 new file mode 100644 index 0000000..51f9820 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/e0e674522ce60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || !tabList.get(0).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla)) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/90de1e2936e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/90de1e2936e100141e1cc3c3be242e56 new file mode 100644 index 0000000..b9a276b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/90de1e2936e100141e1cc3c3be242e56 @@ -0,0 +1,186 @@ +package darkknight.jewelrycraft.tileentity; + +import java.util.Random; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class TileEntitySmelter extends TileEntity +{ + public int melting, flow, n = 0, p = 0; + public boolean hasMetal, hasMoltenMetal, isDirty, pouring; + public ItemStack metal, moltenMetal; + public float quantity, pouredQuantity = 0.1f; + + /** + * + */ + public TileEntitySmelter() + { + melting = 0; + pouring = false; + flow = 0; + quantity = 0f; + hasMetal = false; + hasMoltenMetal = false; + metal = new ItemStack(Item.getItemById(0), 0, 0); + moltenMetal = new ItemStack(Item.getItemById(0), 0, 0); + isDirty = false; + } + + /** + * @param nbt + */ + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + nbt.setInteger("melting", melting); + nbt.setFloat("quantity", quantity); + nbt.setBoolean("hasMetal", hasMetal); + nbt.setBoolean("hasMoltenMetal", hasMoltenMetal); + nbt.setBoolean("pouring", pouring); + NBTTagCompound tag = new NBTTagCompound(); + NBTTagCompound tag1 = new NBTTagCompound(); + metal.writeToNBT(tag); + nbt.setTag("metal", tag); + moltenMetal.writeToNBT(tag1); + nbt.setTag("moltenMetal", tag1); + } + + /** + * @param nbt + */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + melting = nbt.getInteger("melting"); + quantity = nbt.getFloat("quantity"); + hasMetal = nbt.getBoolean("hasMetal"); + hasMoltenMetal = nbt.getBoolean("hasMoltenMetal"); + pouring = nbt.getBoolean("pouring"); + metal = new ItemStack(Item.getItemById(0), 0, 0); + metal.readFromNBT(nbt.getCompoundTag("metal")); + moltenMetal = new ItemStack(Item.getItemById(0), 0, 0); + moltenMetal.readFromNBT(nbt.getCompoundTag("moltenMetal")); + } + + /** + * + */ + @Override + public void updateEntity() + { + super.updateEntity(); + Random rand = new Random(); + if (isDirty){ + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + isDirty = false; + } + if (p > 0) --p; + else p = 5; + if (n == 0 && p == 0){ + flow += 16; + if (flow >= 16 * 20) n = 1; + } + if (n == 1 && p == 0){ + flow -= 16; + if (flow <= 0) n = 0; + } + if (hasMetal) for(int l = 0; l < 2; ++l) + worldObj.spawnParticle("flame", xCoord + rand.nextFloat(), (double)yCoord + 0.3F, zCoord + rand.nextFloat(), 0.0D, 0.0D, 0.0D); + if (rand.nextInt(65) == 0){ + double d5 = xCoord + rand.nextFloat(); + double d7 = yCoord; + double d6 = zCoord + rand.nextFloat(); + worldObj.playSound(d5, d7, d6, "liquid.lavapop", 0.2F + rand.nextFloat() * 0.2F, 0.9F + rand.nextFloat() * 0.15F, false); + } + if (hasMetal && !hasMoltenMetal){ + boolean isOre = JewelrycraftUtil.isOre(metal); + if (melting > 0) melting--; + if (melting == 0){ + hasMetal = false; + if (!isOre) moltenMetal = metal; + else{ + moltenMetal = JewelrycraftUtil.getIngotFromOre(metal.getItem()); + moltenMetal.stackSize *= 2; + } + hasMoltenMetal = true; + if (!isOre) quantity = 0.1f * metal.stackSize; + else quantity = 0.2f * metal.stackSize; + metal = new ItemStack(Item.getItemById(0), 0, 0); + melting = -1; + isDirty = true; + } + }else if (hasMoltenMetal){ + boolean isOre = JewelrycraftUtil.isOre(metal); + if (melting > 0) melting--; + if (melting == 0){ + hasMetal = false; + if (!isOre) moltenMetal.stackSize += metal.stackSize; + else moltenMetal.stackSize += metal.stackSize * 2; + if (!isOre) quantity += 0.1f * metal.stackSize; + else quantity += 0.2f * metal.stackSize; + metal = new ItemStack(Item.getItemById(0), 0, 0); + melting = -1; + isDirty = true; + } + } + TileEntityMolder me = null; + if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 0 && worldObj.getTileEntity(xCoord, yCoord, zCoord - 1) != null && worldObj.getTileEntity(xCoord, yCoord, zCoord - 1) instanceof TileEntityMolder) me = (TileEntityMolder)worldObj.getTileEntity(xCoord, yCoord, zCoord - 1); + else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 1 && worldObj.getTileEntity(xCoord + 1, yCoord, zCoord) != null && worldObj.getTileEntity(xCoord + 1, yCoord, zCoord) instanceof TileEntityMolder) me = (TileEntityMolder)worldObj.getTileEntity(xCoord + 1, yCoord, zCoord); + else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 2 && worldObj.getTileEntity(xCoord, yCoord, zCoord + 1) != null && worldObj.getTileEntity(xCoord, yCoord, zCoord + 1) instanceof TileEntityMolder) me = (TileEntityMolder)worldObj.getTileEntity(xCoord, yCoord, zCoord + 1); + else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 3 && worldObj.getTileEntity(xCoord - 1, yCoord, zCoord) != null && worldObj.getTileEntity(xCoord - 1, yCoord, zCoord) instanceof TileEntityMolder) me = (TileEntityMolder)worldObj.getTileEntity(xCoord - 1, yCoord, zCoord); + if (pouring && pouredQuantity > 0f){ + quantity -= 0.01f; + pouredQuantity -= 0.01f; + me.quantity += 0.01f; + if (!me.hasMoltenMetal){ + me.moltenMetal = moltenMetal; + me.hasMoltenMetal = true; + } + if (pouredQuantity <= 0f){ + pouring = false; + pouredQuantity = 0.1f; + me.cooling = ConfigHandler.INGOT_COOLING_TIME; + } + if (quantity <= 0f){ + quantity = 0f; + hasMoltenMetal = false; + moltenMetal = new ItemStack(Item.getItemById(0), 0, 0); + // pouring = false; + me.cooling = ConfigHandler.INGOT_COOLING_TIME; + } + me.isDirty = true; + } + } + + /** + * @return + */ + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + /** + * @param net + * @param packet + */ + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + readFromNBT(packet.func_148857_g()); + worldObj.func_147479_m(xCoord, yCoord, zCoord); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/102ad27afde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/102ad27afde40014174fe663e69b8422 new file mode 100644 index 0000000..d17def9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/102ad27afde40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + public static Item goldifiedObject; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldObject().setUnlocalizedName(Variables.MODID + ".goldObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/203f4a6a07e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/203f4a6a07e50014174fe663e69b8422 new file mode 100644 index 0000000..34c4920 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/203f4a6a07e50014174fe663e69b8422 @@ -0,0 +1,61 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/905dc04d2bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/905dc04d2bde00141043c3025ec60dfc deleted file mode 100644 index 1667bd7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/905dc04d2bde00141043c3025ec60dfc +++ /dev/null @@ -1,466 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - System.out.println(curseNo + " " + Curse.availableCurses); - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss()){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/90c5727dfde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/90c5727dfde40014174fe663e69b8422 new file mode 100644 index 0000000..13859cf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/90c5727dfde40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + public static Item goldifiedObject; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); +// jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldObject().setUnlocalizedName(Variables.MODID + ".goldObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/a0f6c7b4fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/a0f6c7b4fde40014174fe663e69b8422 new file mode 100644 index 0000000..e55c31f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/a0f6c7b4fde40014174fe663e69b8422 @@ -0,0 +1,43 @@ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldObject extends Item +{ + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/201cc7f23ce100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/201cc7f23ce100141e1cc3c3be242e56 new file mode 100644 index 0000000..9553111 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/201cc7f23ce100141e1cc3c3be242e56 @@ -0,0 +1,66 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static int RITUAL_TIME; + + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int MAX_VILLAGE_JEWELERS; + public static int JEWELER_WEIGHT; + public static int INGOT_CHEST_MIN; + public static int INGOT_CHEST_MAX; + public static int INGOT_CHEST_MAX_STACK; + public static int GEM_CHEST_MIN; + public static int GEM_CHEST_MAX; + public static int FURNACE_MIN_INGOT_STACK; + public static int FURNACE_MAX_INGOT_STACK; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile(),true); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + RITUAL_TIME = config.getInt( "Ritual Time", categories[0], 1000, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for the ritual to end."); + + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + JEWELER_WEIGHT = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + INGOT_CHEST_MIN = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX_STACK = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + GEM_CHEST_MIN = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + GEM_CHEST_MAX = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + FURNACE_MIN_INGOT_STACK = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + FURNACE_MAX_INGOT_STACK = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/406cb68309de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/406cb68309de00141043c3025ec60dfc deleted file mode 100644 index 55fb25c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/406cb68309de00141043c3025ec60dfc +++ /dev/null @@ -1,184 +0,0 @@ -package darkknight.jewelrycraft.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/6037b5cdcedf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/6037b5cdcedf00141dc6c962aec96210 deleted file mode 100644 index c1e2dd8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/6037b5cdcedf00141dc6c962aec96210 +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2 + JewelryNBT.numberOfModifiers(item) / 4)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 150 - JewelryNBT.numberOfModifiers(item) * 10, 2 - JewelryNBT.numberOfModifiers(item) / 5)); - // Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(520 - JewelryNBT.numberOfModifiers(item) * 20) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - // Negative ring - if (jewelry instanceof ItemRing && exists) Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 2F - JewelryNBT.numberOfModifiers(item) * 0.1F); - // Positive ring - if (jewelry instanceof ItemRing && exists && rand.nextInt(180 + JewelryNBT.numberOfModifiers(item)*20) == 12){ - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/b032073032e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/b032073032e100141e1cc3c3be242e56 new file mode 100644 index 0000000..f47fa57 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/b032073032e100141e1cc3c3be242e56 @@ -0,0 +1,63 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int ingotCoolingTime; + public static int ingotMeltingTime; + public static int jewelryCraftingTime; + public static boolean generateVillageNetherstar; + public static boolean canFurnacesGenerateIngots; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + ingotCoolingTime = config.get(categories[0], "Molder Ingot Cooling Time", ingotCoolingTime, "This sets the number of ticks you need to wait before the mold is cooled.").getInt(100); + ingotMeltingTime = config.get(categories[0], "Ingot Melting Time", ingotMeltingTime, "This sets the number of ticks you need to wait before an ingot is completely smelted.").getInt(1500); + jewelryCraftingTime = config.get(categories[0], "Jewelry Crafting Time", jewelryCraftingTime, "This sets the number of ticks it takes for a jewel to be modified.").getInt(200); + generateVillageNetherstar = config.get(categories[1], "Netherstar Generation", generateVillageNetherstar, "If set to true Nether Stars will be able to generate in Jewelers chests.").getBoolean(false); + canFurnacesGenerateIngots = config.get(categories[1], "Furnace Ingots Generation", canFurnacesGenerateIngots, "If set to true jewelers will generate ingots in furnaces.").getBoolean(true); + maxVillageJewelers = config.get(categories[1], "Maximum Jewelers", maxVillageJewelers, "Sets how many jewelers can be in a village.").getInt(1); + jewelerWeight = config.get(categories[1], "Jewelers Weight", jewelerWeight, "Chance of getting a jeweler in a village. The higher the value, the higher the chance.").getInt(30); + ingotChestMin = config.get(categories[1], "Ingot Chest Min", ingotChestMin, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)").getInt(1); + ingotChestMax = config.get(categories[1], "Ingot Chest Max", ingotChestMax, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)").getInt(4); + ingotChestMaxStack = config.get(categories[1], "Ingot Chest Max Stack", ingotChestMaxStack, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest.").getInt(2); + jewelsChestMin = config.get(categories[1], "Jewelers Chest Min", jewelsChestMin, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler.").getInt(2); + jewelsChestMax = config.get(categories[1], "Jewelers Chest Max", jewelsChestMax, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler.").getInt(5); + furnacesIngotStackMin = config.get(categories[1], "Ingot Furnace Min", furnacesIngotStackMin, "Determines the minimum number of ingots that can generate in a furnace.").getInt(2); + furnacesIngotStackMax = config.get(categories[1], "Ingot Furnace Max", furnacesIngotStackMax, "Determines the maximum number of ingots that can generate in a furnace.").getInt(5); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/d0592b5d92e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/d0592b5d92e3001417b2e384bf7c3702 new file mode 100644 index 0000000..389aebc --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/d0592b5d92e3001417b2e384bf7c3702 @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); +// RenderManager.instance.render + RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, RenderManager.instance.renderPosX, midas.target.posY - Minecraft.getMinecraft().thePlayer.posY, midas.target.posZ - Minecraft.getMinecraft().thePlayer.posZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/e027ffc10fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/e027ffc10fe60014127dc373d78c1666 new file mode 100644 index 0000000..d9a74ae --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/e027ffc10fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.4F, 0.9F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/1003962904de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/1003962904de00141043c3025ec60dfc deleted file mode 100644 index 88ab92e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/1003962904de00141043c3025ec60dfc +++ /dev/null @@ -1,278 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (active && target != null && worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D)).contains(target)){ - active = false; - timer = -1; - } - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - else if(pedestal != null && target != null) JewelrycraftUtil.addCursePoints(target, 20); - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/10f4b42522e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/10f4b42522e60014127dc373d78c1666 new file mode 100644 index 0000000..ec158e3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/10f4b42522e60014127dc373d78c1666 @@ -0,0 +1,16 @@ +package darkknight.jewelrycraft.events; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent; + +/** + * @author Sorin + * + */ +public class EventCommonHandler +{ + @SubscribeEvent + public void onItemCrafted(PlayerEvent.ItemCraftedEvent event) + { + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/10f60dd394e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/10f60dd394e3001412c4c4819c88e86b new file mode 100644 index 0000000..9c61922 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/10f60dd394e3001412c4c4819c88e86b @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntity tile = world.getTileEntity(x, y, z); + if(((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target); + this.setBlockBounds((float)((TileEntityMidasTouch)tile).target.boundingBox.minX, (float)((TileEntityMidasTouch)tile).target.boundingBox.minY, (float)((TileEntityMidasTouch)tile).target.boundingBox.minZ, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxX, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxY, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxZ); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/8065ef51d1df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/8065ef51d1df00141dc6c962aec96210 deleted file mode 100644 index 3a3445f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/8065ef51d1df00141dc6c962aec96210 +++ /dev/null @@ -1,119 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.commands; - -/** - * @author Sorin - * - */ -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; - -public class JewelrycraftCommands extends CommandBase -{ - private List aliases; - - public JewelrycraftCommands() - { - this.aliases = new ArrayList(); - this.aliases.add("jw"); - this.aliases.add("jewelry"); - } - - @Override - public String getCommandName() - { - return "jewelrycraft"; - } - - @Override - public String getCommandUsage(ICommandSender var1) - { - return "/jewelrycraft [points]"; - } - - @Override - public List getCommandAliases() - { - return aliases; - } - - @Override - public void processCommand(ICommandSender commandSender, String[] astring) - { - if (astring.length == 0 || astring[0].equals("help")) throw new WrongUsageException(getCommandUsage(commandSender)); - if (astring[0].equals("getCursePoints")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - commandSender.addChatMessage(new ChatComponentTranslation(Integer.toString(JewelrycraftUtil.getCursePoints(entityplayermp)))); - }else if (astring[0].equals("addCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points); - }else if (astring[0].equals("setCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points - JewelrycraftUtil.getCursePoints(entityplayermp)); - } - // else if (astring[0].equals("addModifier")){ - // ItemStack item = new ItemStack(CommandBase.getItemByText(commandSender, astring[1])); - // EntityPlayerMP entityplayermp = getPlayer(commandSender, commandSender.getCommandSenderName()); - // ArrayList modifier = new ArrayList(); - // modifier.add(item); - // JewelryNBT.addModifiers(entityplayermp.getCurrentEquippedItem(), modifier); - // } - // else if (astring[0].equals("addCurse")){ - // EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - // int curse = Integer.valueOf(astring[2]); - // int grade = Integer.valueOf(astring[3]); - // NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(entityplayermp, "Jewelrycraft"); - // if(curse < Curse.getCurseList().size() && grade <= 2) - // { - // EntityEventHandler.addCurse(entityplayermp, playerInfo, curse, grade); - // JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - // } - // else if(curse >= Curse.getCurseList().size()) entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse ID exceedes the maximum value of " + (Curse.getCurseList().size() - 1))); - // else entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse grade exceedes the maximum value of 2")); - // - // } - } - - @Override - public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring) - { - final List MATCHES = new LinkedList(); - final String ARG_LC = astring[astring.length - 1].toLowerCase(); - if (astring.length == 1){ - if ("addCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCursePoints"); - if ("getCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("getCursePoints"); - if ("setCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("setCursePoints"); - // if ("addModifier".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addModifier"); - // if ("addCurse".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCurse"); - }else if (astring.length == 2){ - for(String un: MinecraftServer.getServer().getAllUsernames()) - if (un.toLowerCase().startsWith(ARG_LC)) MATCHES.add(un); - // else if (!astring[0].equals("addCurse")) return getListOfStringsFromIterableMatchingLastWord(astring, Item.itemRegistry.getKeys()); - } - return MATCHES.isEmpty() ? null : MATCHES; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/d0970b5004de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/d0970b5004de00141043c3025ec60dfc deleted file mode 100644 index 364ec79..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/d0970b5004de00141043c3025ec60dfc +++ /dev/null @@ -1,278 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (active && target != null && this.getDistanceFrom(target.posX, target.posY, target.posZ) > 25D){ - active = false; - timer = -1; - } - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - else if(pedestal != null && target != null) JewelrycraftUtil.addCursePoints(target, 20); - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/504bd33404e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/504bd33404e50014174fe663e69b8422 new file mode 100644 index 0000000..65e863e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/504bd33404e50014174fe663e69b8422 @@ -0,0 +1,58 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); +// System.out.println(item.getItem().getIconIndex(JewelryNBT.item(stack))); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return Block.getBlockFromItem(item.getItem()).getBlockTextureFromSide(1); + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/70d86f778de3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/70d86f778de3001417b2e384bf7c3702 new file mode 100644 index 0000000..981b9a5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/70d86f778de3001417b2e384bf7c3702 @@ -0,0 +1,38 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart)){ + world.setBlock((int)target.posX, (int)target.posY, (int)target.posZ, BlockList.midasTouchBlock, 0, 2); + + TileEntity midasTouchVictim = new TileEntityMidasTouch(target); + world.setTileEntity((int)target.posX, (int)target.posY, (int)target.posZ, midasTouchVictim); + target.setDead(); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/b00062e0ffe40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/b00062e0ffe40014174fe663e69b8422 new file mode 100644 index 0000000..01f16ca --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/b00062e0ffe40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + public static Item goldObj; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldObj = new ItemGoldObj().setUnlocalizedName(Variables.MODID + ".goldObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldObj, "goldObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/40cea7b326de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/40cea7b326de00141043c3025ec60dfc deleted file mode 100644 index 8222727..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/40cea7b326de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(20, 14 + (size + 20) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/904f212936e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/904f212936e100141e1cc3c3be242e56 new file mode 100644 index 0000000..2453924 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/904f212936e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int ingotMeltingTime; + public static int jewelryCraftingTime; + public static boolean generateVillageNetherstar; + public static boolean canFurnacesGenerateIngots; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + ingotMeltingTime = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + jewelryCraftingTime = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + generateVillageNetherstar = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + canFurnacesGenerateIngots = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + maxVillageJewelers = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + jewelerWeight = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + ingotChestMin = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMax = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + ingotChestMaxStack = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f004df7701e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f004df7701e50014174fe663e69b8422 new file mode 100644 index 0000000..5210d03 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f004df7701e50014174fe663e69b8422 @@ -0,0 +1,51 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + if(player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() != ItemList.goldObj){ + int index = player.inventory.currentItem; + ItemStack item = player.inventory.getCurrentItem(); + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/b0f547c42be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/b0f547c42be60014127dc373d78c1666 new file mode 100644 index 0000000..3256724 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/b0f547c42be60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || tabList.get(0).visible){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || tabList.get(0).visible) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/e01fa45502e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/e01fa45502e60014127dc373d78c1666 new file mode 100644 index 0000000..a42a1f3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/e01fa45502e60014127dc373d78c1666 @@ -0,0 +1,77 @@ +package darkknight.jewelrycraft.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.tileentity.TileEntityAltar; +import darkknight.jewelrycraft.tileentity.TileEntityBlockShadow; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.Variables; + +public class BlockList +{ + public static Block shadowOre, smelter, molder, displayer, jewelCraftingTable, shadowBlock, shadowEye, jewelAltar, handPedestal, shadowHand, midasTouchBlock; + public static BlockMoltenMetal moltenMetal; + public static Fluid moltenMetalFluid; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + shadowOre = new BlockJCOre().setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockTextureName(Variables.MODID + ":oreShadow").setBlockName(Variables.MODID + ".oreShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + smelter = new BlockSmelter().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".smelter").setCreativeTab(JewelrycraftMod.jewelrycraft); + molder = new BlockMolder(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".molder").setCreativeTab(JewelrycraftMod.jewelrycraft); + displayer = new BlockDisplayer(Material.iron).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypeMetal).setBlockName(Variables.MODID + ".displayer").setCreativeTab(JewelrycraftMod.jewelrycraft); + jewelCraftingTable = new BlockJewelrsCraftingTable(Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".jewelCraftingTable").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowBlock = new BlockShadow().setHardness(5.0F).setResistance(7.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName(Variables.MODID + ":blockShadow").setBlockName(Variables.MODID + ".blockShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + jewelAltar = new BlockJewelAltar().setHardness(5.0F).setResistance(2.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName(Variables.MODID + ":altar").setBlockName(Variables.MODID + ".altar").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowEye = new BlockShadowEye().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".shadowEye").setCreativeTab(JewelrycraftMod.jewelrycraft); + handPedestal = new BlockHandPedestal(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".handPedestal").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowHand = new BlockShadowHand(Material.rock).setStepSound(Block.soundTypePiston).setBlockName(Variables.MODID + ".shadowHand").setCreativeTab(JewelrycraftMod.jewelrycraft).setBlockUnbreakable(); + midasTouchBlock = new BlockMidasTouch(Material.iron).setHardness(3.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal).setBlockName(Variables.MODID + ".midasTouchBlock"); + + GameRegistry.registerBlock(shadowOre, "shadowOre"); + GameRegistry.registerBlock(shadowBlock, "shadowBlock"); + GameRegistry.registerBlock(smelter, "Smelter"); + GameRegistry.registerBlock(molder, "Molder"); + GameRegistry.registerBlock(jewelCraftingTable, "jewelCraftingTable"); + GameRegistry.registerBlock(displayer, "Displayer"); + GameRegistry.registerBlock(jewelAltar, "Altar"); + GameRegistry.registerBlock(shadowEye, "Shadow Eye"); + GameRegistry.registerBlock(handPedestal, "Stone Bricks Pedestal"); + GameRegistry.registerBlock(shadowHand, "Shadow Hand"); + GameRegistry.registerBlock(midasTouchBlock, "Midas Touch Block"); + + GameRegistry.registerTileEntity(TileEntitySmelter.class, Variables.MODID + ":smelter"); + GameRegistry.registerTileEntity(TileEntityMolder.class, Variables.MODID + ":molder"); + GameRegistry.registerTileEntity(TileEntityJewelrsCraftingTable.class, Variables.MODID + ":table"); + GameRegistry.registerTileEntity(TileEntityDisplayer.class, Variables.MODID + ":displayer"); + GameRegistry.registerTileEntity(TileEntityBlockShadow.class, Variables.MODID + ":blockShadow"); + GameRegistry.registerTileEntity(TileEntityAltar.class, Variables.MODID + ":altar"); + GameRegistry.registerTileEntity(TileEntityShadowEye.class, Variables.MODID + ":shadowEye"); + GameRegistry.registerTileEntity(TileEntityHandPedestal.class, Variables.MODID + ":handPedestal"); + GameRegistry.registerTileEntity(TileEntityShadowHand.class, Variables.MODID + ":shadowHand"); + GameRegistry.registerTileEntity(TileEntityMidasTouch.class, Variables.MODID + ":midsaTouch"); + + moltenMetalFluid = new Fluid("metal.molten").setLuminosity(15).setDensity(3000).setTemperature(2000).setViscosity(6000); + if (!FluidRegistry.registerFluid(moltenMetalFluid)) moltenMetalFluid = FluidRegistry.getFluid("metal.molten"); + moltenMetal = new BlockMoltenMetal(moltenMetalFluid, Material.lava); + GameRegistry.registerBlock(moltenMetal, "moltenMetalLiquid"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/f08bbf16c9df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/f08bbf16c9df00141dc6c962aec96210 deleted file mode 100644 index 67769c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/f08bbf16c9df00141dc6c962aec96210 +++ /dev/null @@ -1,94 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && pos != -1){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if (rand.nextInt(3) == 0 && (arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0)) arrow.setDead(); - } - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && pos != -1){ - if (player.motionY < 0) player.motionY *= 0.6D; -// player.capabilities.setPlayerWalkSpeed(0.1F); -// player.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.001D); - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80, 1)); - player.fallDistance = 0F; - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && pos != -1 && enemyData.getInteger("reAttacked") == 0){ - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (jewelry instanceof ItemNecklace && pos != -1 && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && pos != -1 && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/30c5a0be10e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/30c5a0be10e60014127dc373d78c1666 new file mode 100644 index 0000000..8a1f8a9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/30c5a0be10e60014127dc373d78c1666 @@ -0,0 +1,585 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.4F, 0.45F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/6023bb4999e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/6023bb4999e3001412c4c4819c88e86b new file mode 100644 index 0000000..522a726 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/6023bb4999e3001412c4c4819c88e86b @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; +// System.out.println(midas.target.rotationYaw); +// GL11.glRotatef(, 0.0F, 1.0F, 0.0F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.xCoord - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, midas.target.rotationYaw, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/802536bc07de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/802536bc07de00141043c3025ec60dfc deleted file mode 100644 index f120450..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/802536bc07de00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = ingotColor >> 16 & 0xff; - int green = ingotColor >> 8 & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal2.render(f5); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal3.render(f5); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/e0c5a699fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/e0c5a699fde40014174fe663e69b8422 new file mode 100644 index 0000000..a9b0e1a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/e0c5a699fde40014174fe663e69b8422 @@ -0,0 +1,164 @@ +package darkknight.jewelrycraft.item; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; +import org.lwjgl.input.Keyboard; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.ReflectionHelper; +import cpw.mods.fml.relauncher.Side; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class ItemThiefGloves extends Item +{ + public Random rand = new Random(); + + /** + * + */ + public ItemThiefGloves() + { + setCreativeTab(CreativeTabs.tabTools); + setMaxStackSize(1); + setMaxDamage(10); + } + + /** + * @param stack + * @param player + * @param entity + * @return + */ + @Override + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity) + { + if (entity instanceof EntityVillager){ + EntityVillager villager = (EntityVillager)entity; + int wealth = (Integer)ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "wealth", "field_70956_bz"); + MerchantRecipeList buyingList = (MerchantRecipeList)ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "buyingList", "field_70963_i"); + int chance = 5; + boolean areOtherVillagersAround = false, canTheySeeYou = false; + AxisAlignedBB axisalignedbb = villager.boundingBox.expand(4.0D, 4.0D, 4.0D); + List entities = villager.worldObj.getEntitiesWithinAABBExcludingEntity(villager, axisalignedbb); + for(Object s: entities) + if (s instanceof EntityVillager){ + areOtherVillagersAround = true; + chance += rand.nextInt(2); + if (((EntityVillager)s).canEntityBeSeen(player)){ + chance += 2; + canTheySeeYou = true; + } + } + if (villager.canEntityBeSeen(player)) chance += 5; + if (player.isPotionActive(Potion.invisibility)) chance -= 0.8 * chance; + if (player.capabilities.isCreativeMode) chance = 1; + int steal = rand.nextInt(chance); + if (steal == 0){ + villager.dropItem(Items.emerald, wealth); + ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 0, "wealth", "field_70956_bz"); + } + if (buyingList != null){ + Iterator iterator = buyingList.iterator(); + if (steal == 0){ + while (iterator.hasNext()){ + MerchantRecipe recipe = (MerchantRecipe)iterator.next(); + int toolUses = (Integer)ReflectionHelper.getPrivateValue(MerchantRecipe.class, recipe, "toolUses", "field_77400_d"); + int quantity; + if (recipe.getItemToSell().isStackable()) quantity = recipe.getItemToSell().stackSize * (7 - toolUses); + else quantity = recipe.getItemToSell().stackSize; + ItemStack s = new ItemStack(recipe.getItemToSell().getItem(), quantity, recipe.getItemToSell().getItemDamage()); + s.setTagCompound(recipe.getItemToSell().getTagCompound()); + if (player.inventory.addItemStackToInventory(s)) ; + else villager.entityDropItem(s, 0); + if (!player.capabilities.isCreativeMode) JewelrycraftUtil.addCursePoints(player, 5); + player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + ": Hmmm... I seem to have lost my " + s.getDisplayName() + "!")); + stack.damageItem(1, player); + } + buyingList.clear(); + ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 300, "timeUntilReset", "field_70961_j"); + ReflectionHelper.setPrivateValue(EntityVillager.class, villager, true, "needsInitilization", "field_70959_by"); + player.addChatMessage(new ChatComponentText("You hear a faint whisper in your ear: ")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "Those who steal but don't get caught get rewarded and do not.")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "Embrace the path you have gone, for the darkness will not")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "dwell on.")); + }else{ + stack.damageItem(1, player); + if (!player.capabilities.isCreativeMode) JewelrycraftUtil.addCursePoints(player, 25); + if (player.isPotionActive(Potion.invisibility)){ + player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " sensed a strange presence around him, making him cling on to his items. You didn't get anything.")); + } + else{ + if (areOtherVillagersAround){ + if (!canTheySeeYou){ + player.addChatMessage(new ChatComponentText("As he was passing by, a random villager caught you trying to steal from Villager #" + villager.getProfession() + ".")); + player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " curses you for the attempt.")); + return true; + } + else{ + player.addChatMessage(new ChatComponentText("A villager nearby saw you trying to steal from Villager #" + villager.getProfession() + ".")); + player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " curses you for the attempt.")); + return true; + } + }else{ + player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " caught you trying to steal from him.")); + player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " curses you for the attempt.")); + return true; + } + } + } + } + return true; + }else return super.itemInteractionForEntity(stack, player, entity); + } + + /** + * @param stack + * @param player + * @param list + * @param par4 + */ + @Override + @SuppressWarnings ("unchecked") + public void addInformation(ItemStack stack, EntityPlayer player, @SuppressWarnings ("rawtypes") List list, boolean par4) + { + if (!shouldAddAdditionalInfo()) list.add(EnumChatFormatting.GRAY + additionalInfoInstructions()); + else{ + list.add(EnumChatFormatting.GRAY + "Right click with the gloves,"); + list.add(EnumChatFormatting.GRAY + "while sneaking, on a villager"); + list.add(EnumChatFormatting.GRAY + "to steal his stuff."); + } + } + + /** + * @return + */ + public static boolean shouldAddAdditionalInfo() + { + if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) return true; + return false; + } + + /** + * @return + */ + public static String additionalInfoInstructions() + { + String message = "\247oPress \247b\2477\247o for more information."; + return message; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/70f5abaa35e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/70f5abaa35e100141e1cc3c3be242e56 new file mode 100644 index 0000000..627ca48 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/70f5abaa35e100141e1cc3c3be242e56 @@ -0,0 +1,63 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int ingotCoolingTime; + public static int ingotMeltingTime; + public static int jewelryCraftingTime; + public static boolean generateVillageNetherstar; + public static boolean canFurnacesGenerateIngots; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + ingotCoolingTime = config.get(categories[0], "Molder Ingot Cooling Time", ingotCoolingTime, "This sets the number of ticks you need to wait before the mold is cooled.").getInt(100); + ingotMeltingTime = config.get(categories[0], "Ingot Melting Time", ingotMeltingTime, "This sets the number of ticks you need to wait before an ingot is completely smelted.").getInt(1500); + jewelryCraftingTime = config.get(categories[0], "Jewelry Crafting Time", jewelryCraftingTime, "This sets the number of ticks it takes for a jewel to be modified.").getInt(200); + generateVillageNetherstar = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + canFurnacesGenerateIngots = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + maxVillageJewelers = config.get(categories[1], "Maximum Jewelers", maxVillageJewelers, "Sets how many jewelers can be in a village.").getInt(1); + jewelerWeight = config.get(categories[1], "Jewelers Weight", jewelerWeight, "Chance of getting a jeweler in a village. The higher the value, the higher the chance.").getInt(30); + ingotChestMin = config.get(categories[1], "Ingot Chest Min", ingotChestMin, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)").getInt(1); + ingotChestMax = config.get(categories[1], "Ingot Chest Max", ingotChestMax, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)").getInt(4); + ingotChestMaxStack = config.get(categories[1], "Ingot Chest Max Stack", ingotChestMaxStack, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest.").getInt(2); + jewelsChestMin = config.get(categories[1], "Jewelers Chest Min", jewelsChestMin, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler.").getInt(2); + jewelsChestMax = config.get(categories[1], "Jewelers Chest Max", jewelsChestMax, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler.").getInt(5); + furnacesIngotStackMin = config.get(categories[1], "Ingot Furnace Min", furnacesIngotStackMin, "Determines the minimum number of ingots that can generate in a furnace.").getInt(2); + furnacesIngotStackMax = config.get(categories[1], "Ingot Furnace Max", furnacesIngotStackMax, "Determines the maximum number of ingots that can generate in a furnace.").getInt(5); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/50bc8a77d0df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/50bc8a77d0df00141dc6c962aec96210 deleted file mode 100644 index d8c8e51..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/50bc8a77d0df00141dc6c962aec96210 +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2 + JewelryNBT.numberOfModifiers(item) / 4)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 150 - JewelryNBT.numberOfModifiers(item) * 10, 2 - JewelryNBT.numberOfModifiers(item) / 5)); - // Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(520 - JewelryNBT.numberOfModifiers(item) * 20) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - // Negative ring - if (jewelry instanceof ItemRing && exists) Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.2F - JewelryNBT.numberOfModifiers(item) * 0.1F); - // Positive ring - if (jewelry instanceof ItemRing && exists && rand.nextInt(180 + JewelryNBT.numberOfModifiers(item)*20) == 12){ - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100 + JewelryNBT.numberOfModifiers(item)*30, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/d063631307e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/d063631307e50014174fe663e69b8422 new file mode 100644 index 0000000..3432c76 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/d063631307e50014174fe663e69b8422 @@ -0,0 +1,93 @@ +package darkknight.jewelrycraft.proxy; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.InventoryTabVanilla; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.TabRegistry; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.entities.renders.HeartRender; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.item.render.ItemRender; +import darkknight.jewelrycraft.model.ModelDisplayer; +import darkknight.jewelrycraft.model.ModelHalfHeart; +import darkknight.jewelrycraft.model.ModelHandPedestal; +import darkknight.jewelrycraft.model.ModelHeart; +import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; +import darkknight.jewelrycraft.model.ModelMolder; +import darkknight.jewelrycraft.model.ModelShadowEye; +import darkknight.jewelrycraft.model.ModelShadowHand; +import darkknight.jewelrycraft.model.ModelSmelter; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMidasTouchRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/ShadowHand.png"); + TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMidasTouch.class, new TileEntityMidasTouchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); + + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); + VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation(Variables.MODID, "textures/entities/jeweler.png")); + + RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); + + TabRegistry.registerTab(new InventoryTabVanilla()); + TabRegistry.registerTab(new TabJewelry()); + MinecraftForge.EVENT_BUS.register(new TabRegistry()); + MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); + ResourceLocation jeweleryTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/a05f4f052dde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/a05f4f052dde00141043c3025ec60dfc deleted file mode 100644 index 2353237..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/a05f4f052dde00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/1035499a26de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/1035499a26de00141043c3025ec60dfc deleted file mode 100644 index f0a322c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/1035499a26de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.5f, 0.5f, 0.0f); - drawTexturedModalRect(20, 24 + (size + 12) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/20231c3ffee50014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/20231c3ffee50014127dc373d78c1666 new file mode 100644 index 0000000..0238cf8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/20231c3ffee50014127dc373d78c1666 @@ -0,0 +1,20 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +/** + * @author Sorin + * + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + System.out.println("Broken"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/20a9f8c891e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/20a9f8c891e3001417b2e384bf7c3702 new file mode 100644 index 0000000..3dc5a44 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/20a9f8c891e3001417b2e384bf7c3702 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, te.xCoord, 0D, 0D, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/706fd6f390e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/706fd6f390e3001417b2e384bf7c3702 new file mode 100644 index 0000000..1593dd6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/706fd6f390e3001417b2e384bf7c3702 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glColor4f(1F, 0.0F, 1.0F, 0.3F); + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + RenderManager.instance.renderEntityStatic(midas.target, 1F, false); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/90e9856afce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/90e9856afce40014174fe663e69b8422 new file mode 100644 index 0000000..bcf52b4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/90e9856afce40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.*; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/f0dbfc7597e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/f0dbfc7597e3001412c4c4819c88e86b new file mode 100644 index 0000000..0a028cf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/f0dbfc7597e3001412c4c4819c88e86b @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.width); + this.setBlockBounds(1 - ((TileEntityMidasTouch)tile).target.width, 0F, 1 - ((TileEntityMidasTouch)tile).target.width, ((TileEntityMidasTouch)tile).target.width, ((TileEntityMidasTouch)tile).target.height, ((TileEntityMidasTouch)tile).target.width); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/3010dd8c3de100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/3010dd8c3de100141e1cc3c3be242e56 new file mode 100644 index 0000000..f3d10a0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/3010dd8c3de100141e1cc3c3be242e56 @@ -0,0 +1,26 @@ +package darkknight.jewelrycraft.config; + +import cpw.mods.fml.client.config.GuiConfig; +import cpw.mods.fml.client.config.IConfigElement; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.common.config.ConfigElement; +import java.util.ArrayList; +import java.util.List; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigGui extends GuiConfig +{ + public ConfigGui(GuiScreen parent) + { + super(parent, getElements(), Variables.MODID, Variables.MODID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.INSTANCE.config.toString())); + } + + @SuppressWarnings ({"rawtypes"}) + private static List getElements() + { + List list = new ArrayList(ConfigHandler.categories.length); + for(String category: ConfigHandler.categories) + list.add(new ConfigElement(ConfigHandler.INSTANCE.config.getCategory(category.toLowerCase()))); + return list; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/90df506301e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/90df506301e50014174fe663e69b8422 new file mode 100644 index 0000000..ddf14d8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/90df506301e50014174fe663e69b8422 @@ -0,0 +1,55 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null && Block.getBlockFromItem(item.getItem()) == null) + return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/10498d82cbdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/10498d82cbdf00141dc6c962aec96210 deleted file mode 100644 index 804520a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/10498d82cbdf00141dc6c962aec96210 +++ /dev/null @@ -1,97 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import java.util.Iterator; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectFeather extends ModifierEffects -{ - public EffectFeather() - { - super(new ItemStack(Items.feather)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive earrings - if (jewelry instanceof ItemEarrings && exists){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D); - List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb); - if (!player.worldObj.isRemote && list != null && !list.isEmpty()){ - Iterator iterator = list.iterator(); - while (iterator.hasNext()){ - EntityArrow arrow = (EntityArrow)iterator.next(); - if ((arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0) && rand.nextInt(2 + JewelryNBT.numberOfModifiers(item)) == 0) arrow.setDead(); - } - } - } - - if (jewelry instanceof ItemBracelet && exists){ - // Positive bracelet - if (player.motionY < 0) player.motionY *= 0.6D; - // Negative bracelet - if (!player.isPotionActive(Potion.moveSlowdown) || player.getActivePotionEffect(Potion.moveSlowdown).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 80, 1)); - player.fallDistance = 0F; - } - } - - @Override - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - NBTTagCompound enemyData = target.getEntityData(); - if (jewelry instanceof ItemRing && exists && enemyData.getInteger("reAttacked") == 0){ - // Negative ring - enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); - target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); - // Positive ring - if (rand.nextInt(2) == 0){ - enemyData.setInteger("stunTime", 50); - enemyData.setBoolean("stunned", true); - } - playerInfo.setBoolean("weakDamage", true); - } - if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0); - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ - player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!")); - playerInfo.setBoolean("negateDamage", true); - } - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F); - // Negative earrings - if (jewelry instanceof ItemEarrings && exists && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/20ac2f520bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/20ac2f520bde00141043c3025ec60dfc deleted file mode 100644 index 46c5a8e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/20ac2f520bde00141043c3025ec60dfc +++ /dev/null @@ -1,185 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - System.out.println(f3 + " " + 0xf3); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/308fca16fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/308fca16fde40014174fe663e69b8422 new file mode 100644 index 0000000..ae58ad0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/308fca16fde40014174fe663e69b8422 @@ -0,0 +1,66 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.block.material.Material; +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static Item goldifiedObject; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject(Material.air).setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/7050e4ed2ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/7050e4ed2ce60014127dc373d78c1666 new file mode 100644 index 0000000..02688b3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/7050e4ed2ce60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2 - ((t instanceof TabJewelry)?1:0)) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/d03e9ab32be60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/d03e9ab32be60014127dc373d78c1666 new file mode 100644 index 0000000..edfd5b1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/d03e9ab32be60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + if (!tabList.get(1).visible){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!tabList.get(1).visible) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/f06f10cbdee50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/f06f10cbdee50014109ec019d2f6c0dc new file mode 100644 index 0000000..069d5c3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/f06f10cbdee50014109ec019d2f6c0dc @@ -0,0 +1,93 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + if(changeItem(curItem) != null) result = changeItem(curItem); +// player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" ingot") || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("ingot ")) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/0043edd426de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/0043edd426de00141043c3025ec60dfc deleted file mode 100644 index 7ce8c54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/0043edd426de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(40 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/00bb5944dae50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/00bb5944dae50014109ec019d2f6c0dc new file mode 100644 index 0000000..5a834c4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/00bb5944dae50014109ec019d2f6c0dc @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.*; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + return null; + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/50ed324c0bde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/50ed324c0bde00141043c3025ec60dfc deleted file mode 100644 index 0f6eade..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/50ed324c0bde00141043c3025ec60dfc +++ /dev/null @@ -1,185 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = (ingotColor >> 16) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - System.out.println(red + " " + green + " "); - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/9013b88010e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/9013b88010e60014127dc373d78c1666 new file mode 100644 index 0000000..ab4898c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/9013b88010e60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); +// if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); +// } +// else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ +// GL11.glTranslatef(-0.3F, 0.4F, 0.93F); +// GL11.glRotatef(45f, 0f, 1f, 0f); +// GL11.glRotatef(-25f, 0f, 0f, 1f); +// } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/a00b420edde50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/a00b420edde50014109ec019d2f6c0dc new file mode 100644 index 0000000..8105d5c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/a00b420edde50014109ec019d2f6c0dc @@ -0,0 +1,92 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockPressurePlate; +import net.minecraft.block.BlockPressurePlateWeighted; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + else if(currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget ") || currItem.getItem().getUnlocalizedName().toLowerCase().contains(" nugget")) return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + else if(JewelrycraftUtil.isMetal(currItem)) return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + else if(Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + return null; + } + + public boolean isGoldenObject(Item item) + { + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) || item.equals(Items.golden_chestplate) || + item.equals(Items.golden_leggings) || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) || item.equals(Items.golden_shovel) || + item.equals(Items.golden_pickaxe) || item.equals(Items.golden_axe) || item.equals(Items.golden_hoe) || item.equals(Items.golden_horse_armor) || + Block.getBlockFromItem(item).equals(Blocks.gold_block) || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/c0eb43b700e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/c0eb43b700e50014174fe663e69b8422 new file mode 100644 index 0000000..6d4bb3a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/c0eb43b700e50014174fe663e69b8422 @@ -0,0 +1,53 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.item(stack) != null && pass >= 0) return JewelryNBT.item(stack).getItem().getIconIndex(JewelryNBT.item(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/00004ede9ae3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/00004ede9ae3001412c4c4819c88e86b new file mode 100644 index 0000000..f9a583a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/00004ede9ae3001412c4c4819c88e86b @@ -0,0 +1,95 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public void breakBlock(World world, int i, int j, int k, Block par5, int par6) + { + TileEntityMidasTouch te = (TileEntityMidasTouch)world.getTileEntity(i, j, k); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(((TileEntityMidasTouch)tile).target.width * ((TileEntityMidasTouch)tile).target.height), 0)); +// world.removeTileEntity(i, j, k); + super.breakBlock(world, i, j, k, par5, par6); + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/b04cd9362ede00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/b04cd9362ede00141043c3025ec60dfc deleted file mode 100644 index b7fbeb5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/b04cd9362ede00141043c3025ec60dfc +++ /dev/null @@ -1,109 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ -// for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(5 + 16*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15, resolution.getScaledHeight() - 20, 16777215); -// if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5 + 16*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15, resolution.getScaledHeight() - 20, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 16*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/f00e0e670fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/f00e0e670fe60014127dc373d78c1666 new file mode 100644 index 0000000..bd6bc0f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/f00e0e670fe60014127dc373d78c1666 @@ -0,0 +1,579 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(-0.3F, 0.3F, 0.6F); + GL11.glRotatef(75f, 0f, 1f, 0f); + GL11.glRotatef(15f, 0f, 1f, 0f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/f095e7a126de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/f095e7a126de00141043c3025ec60dfc deleted file mode 100644 index 3fb6c1c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/f095e7a126de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.5f, 0.5f, 0.0f); - drawTexturedModalRect(20, 20 + (size + 20) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/d07f155726e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/d07f155726e60014127dc373d78c1666 new file mode 100644 index 0000000..dfeb767 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/d07f155726e60014127dc373d78c1666 @@ -0,0 +1,74 @@ +package main.java.tconstruct.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/00dc62a998e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/00dc62a998e3001412c4c4819c88e86b new file mode 100644 index 0000000..c66477f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/00dc62a998e3001412c4c4819c88e86b @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; +// GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + System.out.println(midas.target.rotationYaw); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.target.posX - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/70d65d9f29de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/70d65d9f29de00141043c3025ec60dfc deleted file mode 100644 index 1557064..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/70d65d9f29de00141043c3025ec60dfc +++ /dev/null @@ -1,122 +0,0 @@ -/** - * - */ -package darkknight.jewelrycraft.commands; - -/** - * @author Sorin - * - */ -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; - -public class JewelrycraftCommands extends CommandBase -{ - private List aliases; - - public JewelrycraftCommands() - { - this.aliases = new ArrayList(); - this.aliases.add("jw"); - this.aliases.add("jewelry"); - } - - @Override - public String getCommandName() - { - return "jewelrycraft"; - } - - @Override - public String getCommandUsage(ICommandSender var1) - { - String use = "/jewelrycraft [points] | "; - use += "/jewelrycraft |"; - use += "/jewelrycraft "; - return use; - } - - @Override - public List getCommandAliases() - { - return aliases; - } - - @Override - public void processCommand(ICommandSender commandSender, String[] astring) - { - if (astring.length == 0 || astring[0].equals("help")) throw new WrongUsageException(getCommandUsage(commandSender)); - if (astring[0].equals("getCursePoints")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - commandSender.addChatMessage(new ChatComponentTranslation(Integer.toString(JewelrycraftUtil.getCursePoints(entityplayermp)))); - }else if (astring[0].equals("addCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points); - }else if (astring[0].equals("setCursePoints")){ - int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0); - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - JewelrycraftUtil.addCursePoints(entityplayermp, points - JewelrycraftUtil.getCursePoints(entityplayermp)); - }else if (astring[0].equals("addModifier")){ - ItemStack item = new ItemStack(CommandBase.getItemByText(commandSender, astring[1])); - EntityPlayerMP entityplayermp = getPlayer(commandSender, commandSender.getCommandSenderName()); - ArrayList modifier = new ArrayList(); - modifier.add(item); - JewelryNBT.addModifiers(entityplayermp.getCurrentEquippedItem(), modifier); - }else if (astring[0].equals("addCurse")){ - EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]); - int curse = Integer.valueOf(astring[2]); - int grade = Integer.valueOf(astring[3]); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(entityplayermp, "Jewelrycraft"); - if(curse < Curse.getCurseList().size() && grade <= 2) - { - System.out.println("add curse " + curse + " " + grade); - EntityEventHandler.addCurse(entityplayermp, playerInfo, curse, grade); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - else if(curse >= Curse.getCurseList().size()) entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse ID exceedes the maximum value of " + (Curse.getCurseList().size() - 1))); - else entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse grade exceedes the maximum value of 2")); - - } - } - - @Override - public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring) - { - final List MATCHES = new LinkedList(); - final String ARG_LC = astring[astring.length - 1].toLowerCase(); - if (astring.length == 1){ - if ("addCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCursePoints"); - if ("getCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("getCursePoints"); - if ("setCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("setCursePoints"); - if ("addModifier".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addModifier"); - if ("addCurse".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCurse"); - }else if (astring.length == 2){ - if (!astring[0].equals("addModifier")){ - for(String un: MinecraftServer.getServer().getAllUsernames()) - if (un.toLowerCase().startsWith(ARG_LC)) MATCHES.add(un); - }else if (!astring[0].equals("addCurse")) return getListOfStringsFromIterableMatchingLastWord(astring, Item.itemRegistry.getKeys()); - } - return MATCHES.isEmpty() ? null : MATCHES; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/c04086ad26e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/c04086ad26e60014127dc373d78c1666 new file mode 100644 index 0000000..4df220b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/c04086ad26e60014127dc373d78c1666 @@ -0,0 +1,97 @@ +package darkknight.jewelrycraft.proxy; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.VillagerRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.TabJewelry; +import darkknight.jewelrycraft.client.TabRegistry; +import darkknight.jewelrycraft.client.gui.InventoryTabVanilla; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.entities.renders.HeartRender; +import darkknight.jewelrycraft.events.PlayerRenderHandler; +import darkknight.jewelrycraft.events.ScreenHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.render.ItemRender; +import darkknight.jewelrycraft.model.ModelDisplayer; +import darkknight.jewelrycraft.model.ModelHalfHeart; +import darkknight.jewelrycraft.model.ModelHandPedestal; +import darkknight.jewelrycraft.model.ModelHeart; +import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; +import darkknight.jewelrycraft.model.ModelMolder; +import darkknight.jewelrycraft.model.ModelShadowEye; +import darkknight.jewelrycraft.model.ModelShadowHand; +import darkknight.jewelrycraft.model.ModelSmelter; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; +import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMidasTouchRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation(Variables.MODID, "textures/tileentities/ShadowHand.png"); + TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMidasTouch.class, new TileEntityMidasTouchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender); + + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation))); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation))); + MinecraftForgeClient.registerItemRenderer(ItemList.goldObj, new ItemRender()); + + VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation(Variables.MODID, "textures/entities/jeweler.png")); + + RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F)); + + if (!Loader.isModLoaded("TConstruct") && TabRegistry.getTabList().size() < 1) TabRegistry.registerTab(new InventoryTabVanilla()); + TabRegistry.registerTab(new TabJewelry()); + MinecraftForge.EVENT_BUS.register(new TabRegistry()); + MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler()); + ResourceLocation jeweleryTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/f0038df208de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/f0038df208de00141043c3025ec60dfc deleted file mode 100644 index 7faaa17..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/f0038df208de00141043c3025ec60dfc +++ /dev/null @@ -1,184 +0,0 @@ -package darkknight.jewelrycraft.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = (int)f3; - int red = ingotColor >> 16 & 0xff; - int green = ingotColor >> 8 & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/a0901cd92dde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/a0901cd92dde00141043c3025ec60dfc deleted file mode 100644 index 46765e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/a0901cd92dde00141043c3025ec60dfc +++ /dev/null @@ -1,106 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() - 50 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(5, resolution.getScaledHeight() - 50 + 16 * count, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15, resolution.getScaledHeight() - 45 + 16 * count, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() - 50 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/d0507977c8df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/d0507977c8df00141dc6c962aec96210 deleted file mode 100644 index 94f9447..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/d0507977c8df00141dc6c962aec96210 +++ /dev/null @@ -1,92 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class EffectBlazePowder extends ModifierEffects -{ - public EffectBlazePowder() - { - super(new ItemStack(Items.blaze_powder)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemNecklace && pos != -1){ - // Positive for necklace - if (player.isBurning() && rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) player.extinguish(); - // Negative for necklace - if (player.isInWater()) player.attackEntityFrom(DamageSource.drown, 1f + (JewelryNBT.numberOfModifiers(item) - 1) * 0.1F); - } - // Negative for bracelet - if (jewelry instanceof ItemBracelet && pos != -1 && player.isInWater()){ - player.motionX *= 0.6D; - player.motionY *= 0.6D; - player.motionZ *= 0.6D; - player.motionY -= 0.02D; - if (player.isCollidedHorizontally) player.motionY = 0.30000001192092896D; - } - // Negative for earrings - if (jewelry instanceof ItemEarrings && pos != -1){ - if (player.getAir() >= 300) player.setAir(player.getAir() / 2); - else player.setAir(player.getAir() - 1); - } - } - - @Override - public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - // Balanced for ring - if (jewelry instanceof ItemRing && pos != -1 && !player.isInWater()) target.setFire(2); - return false; - } - - @Override - public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - // int pos = JewelryNBT.doesModifierExist(item, modifier); - // if (jewelry instanceof ItemEarrings && pos != -1 && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){ - // //Positive for earrings - // int stackSize = JewelryNBT.modifier(item).get(pos).stackSize; - // player.heal((float)(0.05 * stackSize)); - // return true; - // } - // //Positive for bracelet - // if (jewelry instanceof ItemBracelet && pos != -1) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) return true; - return false; - } - - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) - {} - - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - int pos = JewelryNBT.doesModifierExist(item, modifier); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (jewelry instanceof ItemEarrings && pos != -1 && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){ - // Positive for earrings - int stackSize = JewelryNBT.modifier(item).get(pos).stackSize; - player.heal((float)(0.05 * stackSize)); - playerInfo.setBoolean("negateDamage", true); - } - // Positive for bracelet - if (jewelry instanceof ItemBracelet && pos != -1) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) playerInfo.setBoolean("negateDamage", true); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/705e53cd96e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/705e53cd96e3001412c4c4819c88e86b new file mode 100644 index 0000000..a69b87f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/705e53cd96e3001412c4c4819c88e86b @@ -0,0 +1,26 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.target.posX - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/80100efb96e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/80100efb96e3001412c4c4819c88e86b new file mode 100644 index 0000000..33a2363 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/80100efb96e3001412c4c4819c88e86b @@ -0,0 +1,72 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0F, 0F, 0F, 1F, ((TileEntityMidasTouch)tile).target.height, 1F); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/a053aefe94e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/a053aefe94e3001412c4c4819c88e86b new file mode 100644 index 0000000..f7cdd74 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/a053aefe94e3001412c4c4819c88e86b @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntity tile = world.getTileEntity(x, y, z); + if(((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.boundingBox.calculateXOffset(((TileEntityMidasTouch)tile).target.boundingBox, 1f)); + this.setBlockBounds((float)((TileEntityMidasTouch)tile).target.boundingBox.minX, (float)((TileEntityMidasTouch)tile).target.boundingBox.minY, (float)((TileEntityMidasTouch)tile).target.boundingBox.minZ, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxX, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxY, (float)((TileEntityMidasTouch)tile).target.boundingBox.maxZ); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/90c9eff2fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/90c9eff2fce40014174fe663e69b8422 new file mode 100644 index 0000000..a499d75 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/90c9eff2fce40014174fe663e69b8422 @@ -0,0 +1,46 @@ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldifiedObject extends Item +{ + public ItemGoldifiedObject() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e06464f935e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e06464f935e100141e1cc3c3be242e56 new file mode 100644 index 0000000..98564f1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e06464f935e100141e1cc3c3be242e56 @@ -0,0 +1,63 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int ingotCoolingTime; + public static int ingotMeltingTime; + public static int jewelryCraftingTime; + public static boolean generateVillageNetherstar; + public static boolean canFurnacesGenerateIngots; + public static int maxVillageJewelers; + public static int jewelerWeight; + public static int ingotChestMin; + public static int ingotChestMax; + public static int ingotChestMaxStack; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + ingotCoolingTime = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + ingotMeltingTime = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + jewelryCraftingTime = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + generateVillageNetherstar = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + canFurnacesGenerateIngots = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + maxVillageJewelers = config.get(categories[1], "Maximum Jewelers", maxVillageJewelers, "Sets how many jewelers can be in a village.").getInt(1); + jewelerWeight = config.get(categories[1], "Jewelers Weight", jewelerWeight, "Chance of getting a jeweler in a village. The higher the value, the higher the chance.").getInt(30); + ingotChestMin = config.get(categories[1], "Ingot Chest Min", ingotChestMin, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)").getInt(1); + ingotChestMax = config.get(categories[1], "Ingot Chest Max", ingotChestMax, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)").getInt(4); + ingotChestMaxStack = config.get(categories[1], "Ingot Chest Max Stack", ingotChestMaxStack, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest.").getInt(2); + jewelsChestMin = config.get(categories[1], "Jewelers Chest Min", jewelsChestMin, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler.").getInt(2); + jewelsChestMax = config.get(categories[1], "Jewelers Chest Max", jewelsChestMax, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler.").getInt(5); + furnacesIngotStackMin = config.get(categories[1], "Ingot Furnace Min", furnacesIngotStackMin, "Determines the minimum number of ingots that can generate in a furnace.").getInt(2); + furnacesIngotStackMax = config.get(categories[1], "Ingot Furnace Max", furnacesIngotStackMax, "Determines the maximum number of ingots that can generate in a furnace.").getInt(5); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e0c7efa692e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e0c7efa692e3001417b2e384bf7c3702 new file mode 100644 index 0000000..cb3c72b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e0c7efa692e3001417b2e384bf7c3702 @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.target.posX - Minecraft.getMinecraft().thePlayer.posX, midas.target.posY - Minecraft.getMinecraft().thePlayer.posY, midas.target.posZ - Minecraft.getMinecraft().thePlayer.posZ, 0F, 1F); +// RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, midas.target.posX - Minecraft.getMinecraft().thePlayer.posX, midas.target.posY - Minecraft.getMinecraft().thePlayer.posY, midas.target.posZ - Minecraft.getMinecraft().thePlayer.posZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e0f1689026e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e0f1689026e60014127dc373d78c1666 new file mode 100644 index 0000000..e65bf88 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e0f1689026e60014127dc373d78c1666 @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft.client.gui; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class InventoryTabVanilla extends AbstractTab +{ + public InventoryTabVanilla() + { + super(0, 0, 0, new ItemStack(Blocks.crafting_table)); + } + + @Override + public void onTabClicked () + { + TabRegistry.openInventoryGui(); + } + + @Override + public boolean shouldAddToList () + { + return true; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/509d9ad2cfdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/509d9ad2cfdf00141dc6c962aec96210 deleted file mode 100644 index 1f977b7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/509d9ad2cfdf00141dc6c962aec96210 +++ /dev/null @@ -1,102 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); -// if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(95, 7 + (size + 10) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); -// } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/90c6538936e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/90c6538936e100141e1cc3c3be242e56 new file mode 100644 index 0000000..00d62f0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/90c6538936e100141e1cc3c3be242e56 @@ -0,0 +1,260 @@ +package darkknight.jewelrycraft.block; + +import java.io.IOException; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.ItemMoltenMetalBucket; +import darkknight.jewelrycraft.network.PacketSendLiquidData; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; + +public class BlockSmelter extends BlockContainer +{ + Random rand = new Random(); + + public BlockSmelter() + { + super(Material.rock); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntitySmelter(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Spawns an item in the world at the specified location + * + * @param world + * @param x + * @param y + * @param z + * @param stack + */ + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 1.3D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + entityitem.delayBeforeCanPickup = 0; + world.spawnEntityInWorld(entityitem); + } + + @Override + public void breakBlock(World world, int i, int j, int k, Block par5, int par6) + { + TileEntitySmelter te = (TileEntitySmelter)world.getTileEntity(i, j, k); + if (te != null){ + if (te.hasMetal) dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.metal.copy()); + if (te.hasMoltenMetal && te.moltenMetal != null && Item.getIdFromItem(te.moltenMetal.getItem()) > 0){ + ItemStack metal = te.moltenMetal; + ItemStack item = te.moltenMetal; + if (Item.getIdFromItem(metal.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(metal.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(metal.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(metal.getItem()) == Block.getIdFromBlock(Blocks.carpet)) metal.setItemDamage(15 - metal.getItemDamage()); + int color = 16777215; + JewelryNBT.addMetal(item, metal); + try{ + color = ItemMoltenMetalBucket.color(item, 1); + System.out.println(color); + } + catch(IOException e){ + e.printStackTrace(); + } + JewelrycraftMod.saveData.setString(i + " " + j + " " + k + " " + world.provider.dimensionId, Item.getIdFromItem(metal.getItem()) + ":" + metal.getItemDamage() + ":" + color); + JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, i, j, k, Item.getIdFromItem(metal.getItem()), metal.getItemDamage(), color)); + world.setBlock(i, j, k, BlockList.moltenMetal, 0, 3); + int quant = (int)(te.quantity * 10); + if (quant == 1) world.setBlockMetadataWithNotify(i, j, k, 4, 3); + if (quant == 2) world.setBlockMetadataWithNotify(i, j, k, 4, 3); + if (quant == 3) world.setBlockMetadataWithNotify(i, j, k, 3, 3); + if (quant == 4) world.setBlockMetadataWithNotify(i, j, k, 3, 3); + if (quant == 5) world.setBlockMetadataWithNotify(i, j, k, 2, 3); + if (quant == 6) world.setBlockMetadataWithNotify(i, j, k, 2, 3); + if (quant == 7) world.setBlockMetadataWithNotify(i, j, k, 1, 3); + if (quant == 8) world.setBlockMetadataWithNotify(i, j, k, 1, 3); + if (quant == 9) world.setBlockMetadataWithNotify(i, j, k, 0, 3); + } + world.removeTileEntity(i, j, k); + } + super.breakBlock(world, i, j, k, par5, par6); + } + + @Override + public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) + { + TileEntitySmelter te = (TileEntitySmelter)world.getTileEntity(i, j, k); + ItemStack item = entityPlayer.inventory.getCurrentItem(); + if (te != null && te.hasMoltenMetal && te.quantity >= 0.9f && !te.pouring && item != null && item.getItem() == Items.bucket){ + te.quantity = 0f; + te.hasMoltenMetal = false; + ItemStack metalBucket = new ItemStack(ItemList.bucket, 1); + ItemStack ingot = te.moltenMetal.copy(); + if (Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.carpet)) ingot.setItemDamage(15 - ingot.getItemDamage()); + JewelryNBT.addMetal(metalBucket, ingot); + --item.stackSize; + entityPlayer.inventory.addItemStackToInventory(metalBucket); + te.isDirty = true; + return true; + } + if (te != null && !world.isRemote){ + if (te.hasMetal && entityPlayer.isSneaking()){ + dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.metal.copy()); + te.hasMetal = false; + te.melting = -1; + te.isDirty = true; + } + if (item != null && item.getItem() != null && !(item.getItem() instanceof ItemMoltenMetalBucket)){ + int index = -1; + for(int a = 0; a < JewelrycraftUtil.jamcraftPlayers.size(); a++) + if (entityPlayer.getUniqueID().toString().equals(JewelrycraftUtil.jamcraftPlayers.get(a))) index = a; + if(entityPlayer.capabilities.isCreativeMode) index = 1; + boolean canPlace = item != null && (JewelrycraftUtil.isMetal(item) || JewelrycraftUtil.isOre(item) || index >= 0); + boolean isOre = false, oreCoincidesWithMetal = false, itemCoincidesWithMetal = false, itemCoincidesWithMoltenMetal = false, overflow = false; + isOre = JewelrycraftUtil.isOre(item); + if (te.metal != null && te.metal.getItem() != null) itemCoincidesWithMetal = item.getItem().equals(te.metal.getItem()) && item.getItemDamage() == te.metal.getItemDamage(); + if (te.moltenMetal != null && te.moltenMetal.getItem() != null){ + itemCoincidesWithMoltenMetal = item.getItem().equals(te.moltenMetal.getItem()) && item.getItemDamage() == te.moltenMetal.getItemDamage(); + if (isOre) oreCoincidesWithMetal = te.moltenMetal.getItem().equals(JewelrycraftUtil.getIngotFromOre(item.getItem()).getItem()) && te.moltenMetal.getItemDamage() == JewelrycraftUtil.getIngotFromOre(item.getItem()).getItemDamage(); + } + overflow = isOre ? te.metal.stackSize * 0.2f + te.quantity < 0.8f : te.metal.stackSize * 0.1f + te.quantity < 0.9f; + boolean isValid = te.hasMoltenMetal ? itemCoincidesWithMoltenMetal : true; + if (te.quantity < 0.9f && !te.pouring && canPlace && isValid){ + boolean check = isOre ? oreCoincidesWithMetal && te.quantity < 0.8f : itemCoincidesWithMoltenMetal; + boolean check2 = isOre ? oreCoincidesWithMetal : itemCoincidesWithMetal; + if (!te.hasMetal && !te.hasMoltenMetal || !te.hasMetal && te.hasMoltenMetal && check){ + entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage." + Variables.MODID + ".smelter.nowsmeltingingot", item.getDisplayName()))); + te.metal = item.copy(); + // if (Item.getIdFromItem(te.metal.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(te.metal.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(te.metal.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(te.metal.getItem()) == Block.getIdFromBlock(Blocks.carpet)) te.metal.setItemDamage(15 - te.metal.getItemDamage()); + te.metal.stackSize = 1; + te.hasMetal = true; + te.melting = ConfigHandler.INGOT_MELTING_TIME; + if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize; + te.isDirty = true; + }else if (te.hasMetal && te.hasMoltenMetal && check2 && overflow || te.hasMetal && !te.hasMoltenMetal && itemCoincidesWithMetal && overflow){ + entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("Smelting extra " + (isOre ? "ores" : "ingots") + " (" + (te.metal.stackSize + 1) + ")"))); + te.metal.stackSize++; + te.hasMetal = true; + te.melting += ConfigHandler.INGOT_MELTING_TIME; + if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize; + te.isDirty = true; + } + te.isDirty = true; + }else if (item != null && (te.hasMetal || te.hasMoltenMetal) && !itemCoincidesWithMoltenMetal && te.quantity < 0.9f) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("Item does not match contents!"))); + else if (item != null && !item.getUnlocalizedName().toLowerCase().contains("ingot") && te.quantity < 0.9f) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.itemrenamedtoingot"))); + else if (item != null && te.quantity >= 0.9f) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("Smelter is at full capacity."))); + }else if (item != null && item.getItem() != null && item.getItem() instanceof ItemMoltenMetalBucket && !te.hasMoltenMetal && !te.hasMetal){ + te.hasMoltenMetal = true; + ItemStack ingot = JewelryNBT.ingot(item); + if (Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.carpet)) ingot.setItemDamage(15 - ingot.getItemDamage()); + te.moltenMetal = ingot; + te.quantity = 0.9f; + te.isDirty = true; + if (!entityPlayer.capabilities.isCreativeMode){ + --item.stackSize; + dropItem(world, entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, new ItemStack(Items.bucket)); + } + }else if (item == null && te.hasMoltenMetal && te.moltenMetal.getItem() != null) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage." + Variables.MODID + ".smelter.hasmolteningot", te.moltenMetal.getDisplayName()))); + world.setTileEntity(i, j, k, te); + } + return true; + } + + @Override + public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) + { + TileEntitySmelter te = (TileEntitySmelter)world.getTileEntity(i, j, k); + TileEntityMolder me = null; + if (world.getBlockMetadata(i, j, k) == 0 && world.getTileEntity(i, j, k - 1) != null && world.getTileEntity(i, j, k - 1) instanceof TileEntityMolder) me = (TileEntityMolder)world.getTileEntity(i, j, k - 1); + else if (world.getBlockMetadata(i, j, k) == 1 && world.getTileEntity(i + 1, j, k) != null && world.getTileEntity(i + 1, j, k) instanceof TileEntityMolder) me = (TileEntityMolder)world.getTileEntity(i + 1, j, k); + else if (world.getBlockMetadata(i, j, k) == 2 && world.getTileEntity(i, j, k + 1) != null && world.getTileEntity(i, j, k + 1) instanceof TileEntityMolder) me = (TileEntityMolder)world.getTileEntity(i, j, k + 1); + else if (world.getBlockMetadata(i, j, k) == 3 && world.getTileEntity(i - 1, j, k) != null && world.getTileEntity(i - 1, j, k) instanceof TileEntityMolder) me = (TileEntityMolder)world.getTileEntity(i - 1, j, k); + if (te != null && me != null && !world.isRemote) if (te.hasMoltenMetal && isConnectedToMolder(world, i, j, k) && me != null && me.hasMold && !me.hasMoltenMetal && !me.hasJewelBase){ + te.pouring = true; + te.isDirty = true; + }else if (te.hasMetal && te.melting > 0) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage." + Variables.MODID + ".smelter.metalismelting", te.metal.getDisplayName()) + " (" + (ConfigHandler.INGOT_MELTING_TIME * te.metal.stackSize - te.melting) * 100 / (ConfigHandler.ingotMeltingTime * te.metal.stackSize) + "%)")); + else if (te.hasMoltenMetal && !isConnectedToMolder(world, i, j, k)) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.molderismissing"))); + else if (!me.hasMold && te.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.molderhasnomold"))); + else if (me.hasMoltenMetal && te.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.molderhasmoltenmetal"))); + else if (me.hasJewelBase && te.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.modlerhasitem"))); + else player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.empty"))); + } + + /** + * Determines if a molder is placed in front of this + * + * @param world + * @param i + * @param j + * @param k + * @return true if a molder is attached, false otherwise + */ + public boolean isConnectedToMolder(World world, int i, int j, int k) + { + int blockMeta = world.getBlockMetadata(i, j, k); + if (blockMeta == 0 && world.getBlock(i, j, k - 1) instanceof BlockMolder) return true; + else if (blockMeta == 1 && world.getBlock(i + 1, j, k) instanceof BlockMolder) return true; + else if (blockMeta == 2 && world.getBlock(i, j, k + 1) instanceof BlockMolder) return true; + else if (blockMeta == 3 && world.getBlock(i - 1, j, k) instanceof BlockMolder) return true; + return false; + } + + @Override + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack) + { + int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + world.setBlockMetadataWithNotify(i, j, k, rotation, 2); + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon(Variables.MODID + ":smelter"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/0092ec402de60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/0092ec402de60014127dc373d78c1666 new file mode 100644 index 0000000..0a2e561 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/0092ec402de60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 1 : 0) - ((!tabList.get(1).enabled)?1:0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/50fc2bb229de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/50fc2bb229de00141043c3025ec60dfc deleted file mode 100644 index 248fa0c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/50fc2bb229de00141043c3025ec60dfc +++ /dev/null @@ -1,466 +0,0 @@ -package darkknight.jewelrycraft.events; - -import ibxm.Player; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraftforge.client.event.EntityViewRenderEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; -import net.minecraftforge.event.world.WorldEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemBaseJewelry; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - /** - * @param event - */ - @SubscribeEvent - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity); - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - final Entity entity = event.entity; - if (!event.world.isRemote && entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide"); - if (shouldGiveManual){ - ItemStack manual = new ItemStack(ItemList.guide); - if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual); - persistTag.setBoolean("givenGuide", true); - } - boolean render = persistTag.getBoolean("fancyRender"); - JewelrycraftMod.fancyRender = render; - for(Curse curse: Curse.getCurseList()) - if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0); - persistTag.setBoolean("sendInfo", true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) - { - Entity entity = event.entity; - if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){ - entity.motionX *= 0D; - entity.motionZ *= 0D; - entity.motionY *= 0D; - entity.rotationPitch = entity.prevRotationPitch; - entity.rotationYaw = entity.prevRotationYaw; - entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); - if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); - entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); - if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){ - player.motionX *= 0D; - player.motionZ *= 0D; - player.motionY *= 0D; - player.rotationPitch = entity.prevRotationPitch; - player.rotationYaw = entity.prevRotationYaw; - playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1); - if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false); - player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D); - } - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if(item != null) ((ItemBaseJewelry)item.getItem()).action(item, player); - } - if (!player.worldObj.isRemote){ - if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000); - if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true); - } - if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false); - if (playerInfo.getBoolean("sendInfo")){ - JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); - playerInfo.setBoolean("sendInfo", false); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.action(player.worldObj, player); - } - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityAttacked(LivingAttackEvent event) - { - Entity entity = event.entityLiving; - if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true); - if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("negateDamage")){ - playerInfo.setBoolean("negateDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount); - } - if (player.getHealth() != player.prevHealth){ - if (playerInfo.getFloat("WhiteHeart") > 0){ - playerInfo.setFloat("WhiteHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - if (playerInfo.getFloat("BlueHeart") > 0){ - float damage = playerInfo.getFloat("BlueHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlueHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlueHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - }else if (playerInfo.getFloat("BlackHeart") > 0){ - AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D); - List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb); - if (enemies != null && !enemies.isEmpty()){ - Iterator iterator = enemies.iterator(); - while (iterator.hasNext()){ - Entity enemy = (Entity)iterator.next(); - enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount); - } - } - float damage = playerInfo.getFloat("BlackHeart") - event.ammount; - if (damage >= 0){ - playerInfo.setFloat("BlackHeart", damage); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(event.ammount); - }else{ - playerInfo.setFloat("BlackHeart", 0f); - JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - player.heal(Math.abs(damage)); - } - } - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player); - }else if (event.source.getEntity() instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.source.getEntity(); - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for(int i = 0; i < 18; i++) - if (playerInfo.hasKey("ext" + i)){ - NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); - ItemStack item = ItemStack.loadItemStackFromNBT(nbt); - if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){ - event.setCanceled(true); - break; - } - if (playerInfo.getBoolean("weakDamage")){ - playerInfo.setBoolean("weakDamage", false); - event.setCanceled(true); - break; - } - ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount); - } - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onPlayerRespawn(PlayerEvent.Clone event) - { - EntityPlayer player = event.entityPlayer; - if (!player.worldObj.isRemote){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (playerInfo.hasKey("cursePoints")){ - int points = playerInfo.getInteger("cursePoints"); - for(int i = 1; i <= Variables.MAX_CURSES; i++) - if (points > (i - 1) * 1750) addCurse(player, playerInfo, i); - if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ - playerInfo.setInteger("curseTime", 23000); - playerInfo.setBoolean("reselectCurses", false); - } - } - playerInfo.setBoolean("sendInfo", true); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param player - * @param playerInfo - * @param curse - */ - public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo) - { - if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){ - int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size()); - Curse cur = Curse.availableCurses.get(no); - playerInfo.setInteger(cur.getName(), 1); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade) - { - Curse cur = Curse.getCurseList().get(curseID); - if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){ - System.out.println("add curse " + cur + " " + grade); - playerInfo.setInteger(cur.getName(), grade); - Curse.availableCurses.remove(cur); - playerInfo.setBoolean("sendInfo", true); - } - } - - @SubscribeEvent - public void itemToss(ItemTossEvent event) - { - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, Variables.MODID); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss()){ - EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem()); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - event.player.worldObj.spawnEntityInWorld(entityitem); - List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; - Iterator plrs = players.iterator(); - while (plrs.hasNext()) - ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!")); - event.setCanceled(true); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void playerFileSave(PlayerEvent.SaveToFile event) - { - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onEntityDead(LivingDeathEvent event) - { - final Entity entity = event.entity; - Random rand = new Random(); - String[] types = {"Red", "Blue", "White", "Black"}; - if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){ - EntityLiving live = (EntityLiving)entity; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(6) == 0){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(live.worldObj); - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - live.worldObj.spawnEntityInWorld(h); - } - } - } - } - if (entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlueHeart", 0f); - playerInfo.setFloat("BlackHeart", 0f); - playerInfo.setFloat("WhiteHeart", 0f); - if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){ - for(Curse l: Curse.getCurseList()){ - if (playerInfo.getInteger(l.getName()) == 1){ - playerInfo.setInteger(l.getName(), 0); - if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l); - }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1); - } - if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - playerInfo.setBoolean("sendInfo", true); - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player); - } - if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - if (!event.world.isRemote){ - new File(JewelrycraftMod.dir + File.separator + Variables.MODID).mkdirs(); - JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + Variables.MODID, "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg"); - try{ - if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) - { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{ - if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf)); - } - catch(EOFException e){ - e.printStackTrace(); - } - catch(IOException e){ - e.printStackTrace(); - } - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogColors(EntityViewRenderEvent.FogColors event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - event.red = 0f; - event.green = 0f; - event.blue = 0f; - } - } - if (event.isCancelable()) event.setCanceled(true); - } - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void fogDensity(EntityViewRenderEvent.FogDensity event) - {} - - /** - * @param event - */ - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void renderFog(EntityViewRenderEvent.RenderFogEvent event) - { - if (event.entity instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (persistTag.getBoolean("nearStartedRitual")){ - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); - GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F); - } - } - if (event.isCancelable()) event.setCanceled(true); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/101c29e799e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/101c29e799e3001412c4c4819c88e86b new file mode 100644 index 0000000..9f6222b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/101c29e799e3001412c4c4819c88e86b @@ -0,0 +1,72 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/b02994c8fce50014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/b02994c8fce50014127dc373d78c1666 new file mode 100644 index 0000000..7c02d6c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/b02994c8fce50014127dc373d78c1666 @@ -0,0 +1,94 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 0; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public void breakBlock(World world, int i, int j, int k, Block par5, int par6) + { + TileEntityMidasTouch te = (TileEntityMidasTouch)world.getTileEntity(i, j, k); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + super.breakBlock(world, i, j, k, par5, par6); + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/10c9048a91e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/10c9048a91e3001417b2e384bf7c3702 new file mode 100644 index 0000000..ed399b8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/10c9048a91e3001417b2e384bf7c3702 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1F, 0.0F, 1.0F); + RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, 0D, 0D, 0D, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/702ef9a103e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/702ef9a103e60014127dc373d78c1666 new file mode 100644 index 0000000..4536b39 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/702ef9a103e60014127dc373d78c1666 @@ -0,0 +1,40 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.block.BlockMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +/** + * @author Sorin + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + // System.out.println("Broken " + event.getResult()); + ItemStack item = event.getPlayer().inventory.getCurrentItem(); + if (event.block instanceof BlockMidasTouch && item != null && event.block.getHarvestLevel(3) >= item.getItem().getHarvestLevel(item, "pickaxe")){ + TileEntityMidasTouch te = (TileEntityMidasTouch)event.world.getTileEntity(event.x, event.y, event.z); +// if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + } + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/1007be1adae50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/1007be1adae50014109ec019d2f6c0dc new file mode 100644 index 0000000..7a566f0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/1007be1adae50014109ec019d2f6c0dc @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(Item currItem) + { + if(currItem instanceof ItemSword){ + + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/a0d9c8ff2ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/a0d9c8ff2ce60014127dc373d78c1666 new file mode 100644 index 0000000..bf728cf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/a0d9c8ff2ce60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2 - ((t instanceof TabJewelry)?3:0)) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/d0a08c8ed0df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/d0a08c8ed0df00141dc6c962aec96210 deleted file mode 100644 index 6d8b9ef..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/d0a08c8ed0df00141dc6c962aec96210 +++ /dev/null @@ -1,87 +0,0 @@ -package darkknight.jewelrycraft.effects; - -import net.minecraft.block.BlockOre; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.biome.BiomeGenBase; -import cpw.mods.fml.relauncher.ReflectionHelper; -import darkknight.jewelrycraft.item.ItemBracelet; -import darkknight.jewelrycraft.item.ItemEarrings; -import darkknight.jewelrycraft.item.ItemNecklace; -import darkknight.jewelrycraft.item.ItemRing; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class EffectEnderEye extends ModifierEffects -{ - private boolean originalVD = false; - private float originalViewDistance; - - public EffectEnderEye() - { - super(new ItemStack(Items.ender_eye)); - } - - @Override - public void action(ItemStack item, EntityPlayer player, Item jewelry) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - if (jewelry instanceof ItemEarrings && exists && !player.worldObj.isRemote){ - for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){ - EntityEnderman enderman = (EntityEnderman)e; - ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g"); - Vec3 vec3 = player.getLook(1.0F).normalize(); - Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ); - double d0 = vec31.lengthVector(); - vec31 = vec31.normalize(); - double d1 = vec3.dotProduct(vec31); - if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){ - // Positive earrings - if (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0) enderman.setTarget(null); - // Negative earrings - if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2 + JewelryNBT.numberOfModifiers(item) / 4)); - } - } - } - // Positive necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote){ - ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); - if (chunkposition != null){ - Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ) * (rand.nextInt(JewelryNBT.numberOfModifiers(item)) == 0 ? 1 : -1); - } - } - // Positive bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 150 - JewelryNBT.numberOfModifiers(item) * 10, 2 - JewelryNBT.numberOfModifiers(item) / 5)); - // Negative bracelet - if (jewelry instanceof ItemBracelet && exists && !player.worldObj.isRemote && rand.nextInt(520 - JewelryNBT.numberOfModifiers(item) * 20) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1), player.posY, player.posZ + rand.nextInt(30) * (rand.nextBoolean() ? -1 : 1)); - // Negative ring - if (jewelry instanceof ItemRing && exists) Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 2.1F - JewelryNBT.numberOfModifiers(item) * 0.1F); - // Positive ring - if (jewelry instanceof ItemRing && exists && rand.nextInt(180 + JewelryNBT.numberOfModifiers(item)*20) == 12){ - for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++) - for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++) - for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++) - if (player.worldObj.getBlock(i, j, k) instanceof BlockOre) player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you.")); - } - } - - @Override - public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) - { - boolean exists = JewelryNBT.doesModifierExist(item, modifier); - // Negative necklace - if (jewelry instanceof ItemNecklace && exists && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100 + JewelryNBT.numberOfModifiers(item)*30, 1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/e0841f8b23e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/e0841f8b23e60014127dc373d78c1666 new file mode 100644 index 0000000..5402bc6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/e0841f8b23e60014127dc373d78c1666 @@ -0,0 +1,76 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * @author TinkersCOnstruct + */ +@SideOnly(Side.CLIENT) +public abstract class AbstractTab extends GuiButton +{ + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ItemStack renderStack; + RenderItem itemRenderer = new RenderItem(); + + public AbstractTab(int id, int posX, int posY, ItemStack renderStack) + { + super(id, posX, posY, 28, 32, ""); + this.renderStack = renderStack; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : 1; + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + mc.renderEngine.bindTexture(this.texture); + GL11.glRotatef(90F, 0F, 0F, 1F); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + GL11.glRotatef(-90F, 0F, 0F, 1F); + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + this.onTabClicked(); + } + + return inWindow; + } + + public abstract void onTabClicked (); + + public abstract boolean shouldAddToList (); +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/60bb815703e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/60bb815703e50014174fe663e69b8422 new file mode 100644 index 0000000..2a639d2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/60bb815703e50014174fe663e69b8422 @@ -0,0 +1,57 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null){ + if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return Block.getBlockFromItem(item.getItem()).getIcon(0, 0); + }else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/00f951d59ce3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/00f951d59ce3001412c4c4819c88e86b new file mode 100644 index 0000000..f06b435 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/00f951d59ce3001412c4c4819c88e86b @@ -0,0 +1,96 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public void breakBlock(World world, int i, int j, int k, Block par5, int par6) + { + TileEntityMidasTouch te = (TileEntityMidasTouch)world.getTileEntity(i, j, k); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); +// world.removeTileEntity(i, j, k); + System.out.println("drop"); + super.breakBlock(world, i, j, k, par5, par6); + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/b0a9941f9be3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/b0a9941f9be3001412c4c4819c88e86b new file mode 100644 index 0000000..1055fc5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/b0a9941f9be3001412c4c4819c88e86b @@ -0,0 +1,95 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public void breakBlock(World world, int i, int j, int k, Block par5, int par6) + { + TileEntityMidasTouch te = (TileEntityMidasTouch)world.getTileEntity(i, j, k); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height), 0)); +// world.removeTileEntity(i, j, k); + super.breakBlock(world, i, j, k, par5, par6); + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/d0b7446a2ee60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/d0b7446a2ee60014127dc373d78c1666 new file mode 100644 index 0000000..9f8e1b1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/d0b7446a2ee60014127dc373d78c1666 @@ -0,0 +1,580 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.*; +import net.minecraft.client.renderer.tileentity.*; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.*; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.*; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glPushMatrix(); + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + GL11.glPopMatrix(); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + RenderHelper.enableStandardItemLighting(); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + RenderHelper.disableStandardItemLighting(); + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if(type.equals(type.ENTITY)){ + GL11.glTranslatef(0.0F, 0.0265F, 0.0F); + GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.625F, 0.625F, 0.625F); + } + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else if(type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glTranslatef(-0.35F, 0.4F, 0.93F); + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(-25f, 0f, 0f, 1f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/20c13d5102de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/20c13d5102de00141043c3025ec60dfc deleted file mode 100644 index bba603a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/20c13d5102de00141043c3025ec60dfc +++ /dev/null @@ -1,272 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player1: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player1 != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player1, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - EntityPlayer player = worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 6F); - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/80522dbd25e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/80522dbd25e60014127dc373d78c1666 new file mode 100644 index 0000000..6a6830d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/80522dbd25e60014127dc373d78c1666 @@ -0,0 +1,24 @@ +package main.java.tconstruct.client.tabs; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class InventoryTabVanilla extends AbstractTab +{ + public InventoryTabVanilla() + { + super(0, 0, 0, new ItemStack(Blocks.crafting_table)); + } + + @Override + public void onTabClicked () + { + TabRegistry.openInventoryGui(); + } + + @Override + public boolean shouldAddToList () + { + return true; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/e07bb9c32ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/e07bb9c32ce60014127dc373d78c1666 new file mode 100644 index 0000000..591b83e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/e07bb9c32ce60014127dc373d78c1666 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + t.id = count; + t.xPosition = cornerX + (count - 2 - (t instanceof TabJewelry?2:0)) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/f03670018ee3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/f03670018ee3001417b2e384bf7c3702 new file mode 100644 index 0000000..07f5a94 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/f03670018ee3001417b2e384bf7c3702 @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor4f(1F, 0.0F, 0.0F, 1F); + RenderManager.instance.renderEntityStatic(midas.target, 1F, false); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/40b7090927de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/40b7090927de00141043c3025ec60dfc deleted file mode 100644 index bde143e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/40b7090927de00141043c3025ec60dfc +++ /dev/null @@ -1,105 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 10 + (size + 6) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ - for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size); - if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/a015049497e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/a015049497e3001412c4c4819c88e86b new file mode 100644 index 0000000..0199fbb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/a015049497e3001412c4c4819c88e86b @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.width); + this.setBlockBounds(-((TileEntityMidasTouch)tile).target.width, 0F, -((TileEntityMidasTouch)tile).target.width, ((TileEntityMidasTouch)tile).target.width, ((TileEntityMidasTouch)tile).target.height, ((TileEntityMidasTouch)tile).target.width); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/b08f72dafce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/b08f72dafce40014174fe663e69b8422 new file mode 100644 index 0000000..a499d75 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/b08f72dafce40014174fe663e69b8422 @@ -0,0 +1,46 @@ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public abstract class ItemGoldifiedObject extends Item +{ + public ItemGoldifiedObject() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.gem(stack) != null) return this.getIconIndex(JewelryNBT.gem(stack)); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return (StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/d05828652ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/d05828652ce60014127dc373d78c1666 new file mode 100644 index 0000000..8565d63 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/d05828652ce60014127dc373d78c1666 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ +// if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla) || tabList.get(1).enabled){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; +// } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || tabList.get(1).enabled) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/f0200353dbe50014109ec019d2f6c0dc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/f0200353dbe50014109ec019d2f6c0dc new file mode 100644 index 0000000..e86f926 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/f0200353dbe50014109ec019d2f6c0dc @@ -0,0 +1,67 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.*; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + ItemStack curItem = player.inventory.getCurrentItem(); + if(curItem != null && curItem.getItem() != ItemList.goldObj){ + int index = player.inventory.currentItem; + ItemStack item = curItem; + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); + JewelryNBT.addItem(result, item); + player.inventory.setInventorySlotContents(index, result); + } + } + + public ItemStack changeItem(ItemStack currItem) + { + if(currItem.getItem() instanceof ItemSword) return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemSpade) return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemPickaxe) return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemAxe) return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemHoe) return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 0) return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 1) return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 2) return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + else if(currItem.getItem() instanceof ItemArmor && ((ItemArmor)currItem.getItem()).armorType == 3) return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + return null; + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/20a6758b0ade00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/20a6758b0ade00141043c3025ec60dfc deleted file mode 100644 index 70f9c6b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/20a6758b0ade00141043c3025ec60dfc +++ /dev/null @@ -1,185 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int red = (ingotColor >> 24) & 0xff; - int green = (ingotColor >> 8) & 0xff; - int blue = ingotColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/4093e81d8ee3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/4093e81d8ee3001417b2e384bf7c3702 new file mode 100644 index 0000000..be1ccdc --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/4093e81d8ee3001417b2e384bf7c3702 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glColor4f(1F, 0.0F, 1.0F, 0.3F); + GL11.glTranslatef(0.5F, 0.0F, 0.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + RenderManager.instance.renderEntityStatic(midas.target, 1F, false); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/60962c202ce60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/60962c202ce60014127dc373d78c1666 new file mode 100644 index 0000000..5e33706 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/60962c202ce60014127dc373d78c1666 @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.client.*; + +/** + * @author TinkersConstruct + */ +public class TabRegistry +{ + private static ArrayList tabList = new ArrayList(); + + public static void registerTab(AbstractTab tab) + { + tabList.add(tab); + } + + public static ArrayList getTabList() + { + return tabList; + } + + @SideOnly (Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + if ((event.gui instanceof GuiInventory)){ + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); + addTabsToList(event.buttonList); + } + } + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + + public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) + { + int count = 2 + (Loader.isModLoaded("TConstruct") ? 2 : 0); + for(int i = 0; i < tabList.size(); i++){ + AbstractTab t = tabList.get(i); + if (t.shouldAddToList()){ + System.out.println(tabList.get(0).enabled); + if (!(Loader.isModLoaded("TConstruct") && t instanceof InventoryTabVanilla)){ + t.id = count; + t.xPosition = cornerX + (count - 2) * 28; + t.yPosition = cornerY - 28; + t.enabled = !t.getClass().equals(selectedButton); + count++; + } + } + } + } + + public static void addTabsToList(List buttonList) + { + for(AbstractTab tab: tabList){ + if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla)) buttonList.add(tab); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/a0481eabfee50014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/a0481eabfee50014127dc373d78c1666 new file mode 100644 index 0000000..dbc40e7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/a0481eabfee50014127dc373d78c1666 @@ -0,0 +1,94 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 0; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public void breakBlock(World world, int i, int j, int k, Block block, int meta) + { + TileEntityMidasTouch te = (TileEntityMidasTouch)world.getTileEntity(i, j, k); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + super.breakBlock(world, i, j, k, block, meta); + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/c0204a4dfde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/c0204a4dfde40014174fe663e69b8422 new file mode 100644 index 0000000..c3781ad --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/c0204a4dfde40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + public static Item goldifiedObject; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldObject(); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/2015b91c37e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/2015b91c37e100141e1cc3c3be242e56 new file mode 100644 index 0000000..6def0a2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/2015b91c37e100141e1cc3c3be242e56 @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.config; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.util.Variables; + +public class ConfigHandler +{ + public static Configuration config; + public static final ConfigHandler INSTANCE = new ConfigHandler(); + public static final String[] categories = { "Timers", "Village Generation"}; + + public static int INGOT_COOLING_TIME; + public static int INGOT_MELTING_TIME; + public static int GEM_PLACEMENT_TIME; + public static boolean GENERATE_VILLAGE_NETHERSTAR; + public static boolean CAN_FURNACE_GENERATE_INGOTS; + public static int MAX_VILLAGE_JEWELERS; + public static int JEWELER_WEIGHT; + public static int INGOT_CHEST_MIN; + public static int INGOT_CHEST_MAX; + public static int INGOT_CHEST_MAX_STACK; + public static int jewelsChestMin; + public static int jewelsChestMax; + public static int furnacesIngotStackMin; + public static int furnacesIngotStackMax; + + public void loadConfig(FMLPreInitializationEvent event) + { + config = new Configuration(event.getSuggestedConfigurationFile()); + config.load(); + syncConfigs(); + } + + private void syncConfigs() + { + INGOT_COOLING_TIME = config.getInt("Molder Ingot Cooling Time", categories[0], 100, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before the mold is cooled."); + INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted."); + GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified."); + GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests."); + CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces."); + MAX_VILLAGE_JEWELERS = config.getInt("Maximum Jewelers", categories[1], 1, 0, Integer.MAX_VALUE, "Sets how many jewelers can be in a village."); + JEWELER_WEIGHT = config.getInt("Jewelers Weight", categories[1], 30, 0, Integer.MAX_VALUE, "Chance of getting a jeweler in a village. The higher the value, the higher the chance."); + INGOT_CHEST_MIN = config.getInt("Ingot Chest Min", categories[1], 1, 0, Integer.MAX_VALUE, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX = config.getInt("Ingot Chest Max", categories[1], 4, 0, Integer.MAX_VALUE, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)"); + INGOT_CHEST_MAX_STACK = config.getInt("Ingot Chest Max Stack", categories[1], 2, 0, Integer.MAX_VALUE, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest."); + jewelsChestMin = config.getInt("Jewelers Chest Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + jewelsChestMax = config.getInt("Jewelers Chest Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler."); + furnacesIngotStackMin = config.getInt("Ingot Furnace Min", categories[1], 2, 0, Integer.MAX_VALUE, "Determines the minimum number of ingots that can generate in a furnace."); + furnacesIngotStackMax = config.getInt("Ingot Furnace Max", categories[1], 5, 0, Integer.MAX_VALUE, "Determines the maximum number of ingots that can generate in a furnace."); + if (config.hasChanged()) config.save(); + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if (event.modID.equals(Variables.MODID)) syncConfigs(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/50e88c160ade00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/50e88c160ade00141043c3025ec60dfc deleted file mode 100644 index cf49b68..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/50e88c160ade00141043c3025ec60dfc +++ /dev/null @@ -1,186 +0,0 @@ -package darkknight.jewelrycraft.model; - -import java.awt.Color; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import org.lwjgl.opengl.GL11; - -/** - * ModelBiped - Either Mojang or a mod author Created using Tabula 4.1.1 - */ -public class ModelBracelet extends ModelBase -{ - public ModelRenderer metal1; - public ModelRenderer metal2; - public ModelRenderer metal3; - public ModelRenderer metal4; - public ModelRenderer gem1; - public ModelRenderer gem2; - public ModelRenderer gem3; - public ModelRenderer gem4; - public ModelRenderer gem5; - public ModelRenderer gem6; - public ModelRenderer gem7; - public ModelRenderer gem8; - public ModelRenderer gem9; - - public ModelBracelet() - { - this.textureWidth = 16; - this.textureHeight = 16; - this.metal4 = new ModelRenderer(this, 0, 8); - this.metal4.setRotationPoint(-5.0F, 12.0F, -2.0F); - this.metal4.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem4 = new ModelRenderer(this, 0, 0); - this.gem4.setRotationPoint(-3.0F, 12.8F, -3.5F); - this.gem4.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(gem4, 0.0F, 0.008901179185171082F, 0.0F); - this.gem3 = new ModelRenderer(this, 0, 0); - this.gem3.setRotationPoint(-4.8F, 12.2F, -3.5F); - this.gem3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem2 = new ModelRenderer(this, 0, 0); - this.gem2.setRotationPoint(-1.5F, 12.8F, -3.5F); - this.gem2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem1 = new ModelRenderer(this, 0, 0); - this.gem1.setRotationPoint(0.3F, 12.2F, -3.5F); - this.gem1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.metal1 = new ModelRenderer(this, 0, 8); - this.metal1.setRotationPoint(-5.0F, 12.0F, -3.0F); - this.metal1.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem6 = new ModelRenderer(this, 0, 0); - this.gem6.setRotationPoint(-4.3F, 12.7F, -3.5F); - this.gem6.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.gem7 = new ModelRenderer(this, 0, 0); - this.gem7.setRotationPoint(-3.8F, 12.7F, -3.5F); - this.gem7.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.gem8 = new ModelRenderer(this, 0, 0); - this.gem8.setRotationPoint(-0.2F, 12.7F, -3.5F); - this.gem8.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F); - this.metal2 = new ModelRenderer(this, 0, 8); - this.metal2.setRotationPoint(-5.0F, 12.0F, 2.0F); - this.metal2.addBox(0.0F, 0.0F, 0.0F, 6, 2, 1, 0.0F); - this.gem5 = new ModelRenderer(this, 0, 0); - this.gem5.setRotationPoint(-2.5F, 12.3F, -3.5F); - this.gem5.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1, 0.0F); - this.metal3 = new ModelRenderer(this, 0, 8); - this.metal3.setRotationPoint(0.0F, 12.0F, -2.0F); - this.metal3.addBox(0.0F, 0.0F, 0.0F, 1, 2, 4, 0.0F); - this.gem9 = new ModelRenderer(this, 0, 0); - this.gem9.setRotationPoint(-0.7F, 12.7F, -3.5F); - this.gem9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glDisable(GL11.GL_LIGHTING); - System.out.println((int)f3); - if ((int)f3 != -1){ - int ingotColor = Math.abs((int)f3); - int red = ingotColor >> 16 & 0xff; - int green = ingotColor >> 8 & 0xff; - int blue = ingotColor & 0xff; - float[] hsb = Color.RGBtoHSB(red, green, blue, null); - GL11.glColor3f(hsb[0], hsb[1], hsb[2]); - this.metal1.render(f5); - this.metal2.render(f5); - this.metal3.render(f5); - this.metal4.render(f5); - } - if ((int)f4 != -1){ - int gemColor = (int)f4; - int red = gemColor >> 16 & 0xff; - int green = gemColor >> 8 & 0xff; - int blue = gemColor & 0xff; - GL11.glColor3f((float)red / 255, (float)green / 255, (float)blue / 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_DST_COLOR); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem4.offsetX, this.gem4.offsetY, this.gem4.offsetZ); - GL11.glTranslatef(this.gem4.rotationPointX * f5, this.gem4.rotationPointY * f5, this.gem4.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem4.offsetX, -this.gem4.offsetY, -this.gem4.offsetZ); - GL11.glTranslatef(-this.gem4.rotationPointX * f5, -this.gem4.rotationPointY * f5, -this.gem4.rotationPointZ * f5); - this.gem4.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem3.offsetX, this.gem3.offsetY, this.gem3.offsetZ); - GL11.glTranslatef(this.gem3.rotationPointX * f5, this.gem3.rotationPointY * f5, this.gem3.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem3.offsetX, -this.gem3.offsetY, -this.gem3.offsetZ); - GL11.glTranslatef(-this.gem3.rotationPointX * f5, -this.gem3.rotationPointY * f5, -this.gem3.rotationPointZ * f5); - this.gem3.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem2.offsetX, this.gem2.offsetY, this.gem2.offsetZ); - GL11.glTranslatef(this.gem2.rotationPointX * f5, this.gem2.rotationPointY * f5, this.gem2.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem2.offsetX, -this.gem2.offsetY, -this.gem2.offsetZ); - GL11.glTranslatef(-this.gem2.rotationPointX * f5, -this.gem2.rotationPointY * f5, -this.gem2.rotationPointZ * f5); - this.gem2.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem1.offsetX, this.gem1.offsetY, this.gem1.offsetZ); - GL11.glTranslatef(this.gem1.rotationPointX * f5, this.gem1.rotationPointY * f5, this.gem1.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem1.offsetX, -this.gem1.offsetY, -this.gem1.offsetZ); - GL11.glTranslatef(-this.gem1.rotationPointX * f5, -this.gem1.rotationPointY * f5, -this.gem1.rotationPointZ * f5); - this.gem1.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem6.offsetX, this.gem6.offsetY, this.gem6.offsetZ); - GL11.glTranslatef(this.gem6.rotationPointX * f5, this.gem6.rotationPointY * f5, this.gem6.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem6.offsetX, -this.gem6.offsetY, -this.gem6.offsetZ); - GL11.glTranslatef(-this.gem6.rotationPointX * f5, -this.gem6.rotationPointY * f5, -this.gem6.rotationPointZ * f5); - this.gem6.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem7.offsetX, this.gem7.offsetY, this.gem7.offsetZ); - GL11.glTranslatef(this.gem7.rotationPointX * f5, this.gem7.rotationPointY * f5, this.gem7.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem7.offsetX, -this.gem7.offsetY, -this.gem7.offsetZ); - GL11.glTranslatef(-this.gem7.rotationPointX * f5, -this.gem7.rotationPointY * f5, -this.gem7.rotationPointZ * f5); - this.gem7.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem8.offsetX, this.gem8.offsetY, this.gem8.offsetZ); - GL11.glTranslatef(this.gem8.rotationPointX * f5, this.gem8.rotationPointY * f5, this.gem8.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem8.offsetX, -this.gem8.offsetY, -this.gem8.offsetZ); - GL11.glTranslatef(-this.gem8.rotationPointX * f5, -this.gem8.rotationPointY * f5, -this.gem8.rotationPointZ * f5); - this.gem8.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem5.offsetX, this.gem5.offsetY, this.gem5.offsetZ); - GL11.glTranslatef(this.gem5.rotationPointX * f5, this.gem5.rotationPointY * f5, this.gem5.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem5.offsetX, -this.gem5.offsetY, -this.gem5.offsetZ); - GL11.glTranslatef(-this.gem5.rotationPointX * f5, -this.gem5.rotationPointY * f5, -this.gem5.rotationPointZ * f5); - this.gem5.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(this.gem9.offsetX, this.gem9.offsetY, this.gem9.offsetZ); - GL11.glTranslatef(this.gem9.rotationPointX * f5, this.gem9.rotationPointY * f5, this.gem9.rotationPointZ * f5); - GL11.glScaled(0.5D, 0.5D, 0.5D); - GL11.glTranslatef(-this.gem9.offsetX, -this.gem9.offsetY, -this.gem9.offsetZ); - GL11.glTranslatef(-this.gem9.rotationPointX * f5, -this.gem9.rotationPointY * f5, -this.gem9.rotationPointZ * f5); - this.gem9.render(f5); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_BLEND); - } - GL11.glEnable(GL11.GL_LIGHTING); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/80a33c36fde40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/80a33c36fde40014174fe663e69b8422 new file mode 100644 index 0000000..f395f9f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/80a33c36fde40014174fe663e69b8422 @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.util.Variables; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + public static Item molds; + public static Item clayMolds; + public static Item crystal; + public static ItemRing ring; + public static ItemNecklace necklace; + public static ItemBracelet bracelet; + public static ItemEarrings earrings; + public static Item guide; + public static Item jewelryModifier; + public static ItemMoltenMetalBucket bucket; + public static ItemMoltenMetal metal; + public static Item goldifiedObject; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + thiefGloves = new ItemThiefGloves().setUnlocalizedName(Variables.MODID + ".thiefGloves").setTextureName(Variables.MODID + ":thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new Item().setUnlocalizedName(Variables.MODID + ".ingotShadow").setTextureName(Variables.MODID + ":ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds().setUnlocalizedName(Variables.MODID + ".mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + ring = (ItemRing)new ItemRing().setUnlocalizedName(Variables.MODID + ".ring").setTextureName(Variables.MODID + ":ring").setCreativeTab(JewelrycraftMod.jewelrycraft); + necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName(Variables.MODID + ".necklace").setTextureName(Variables.MODID + ":necklace").setCreativeTab(JewelrycraftMod.jewelrycraft); + bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName(Variables.MODID + ".bracelet").setTextureName(Variables.MODID + ":bracelet").setCreativeTab(JewelrycraftMod.jewelrycraft); + earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName(Variables.MODID + ".earrings").setTextureName(Variables.MODID + ":earrings").setCreativeTab(JewelrycraftMod.jewelrycraft); + crystal = new ItemCrystal().setUnlocalizedName(Variables.MODID + ".crystal").setTextureName(Variables.MODID + ":crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); + guide = new ItemGuide().setUnlocalizedName(Variables.MODID + ".guide").setTextureName(Variables.MODID + ":guide").setCreativeTab(JewelrycraftMod.jewelrycraft); + bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName(Variables.MODID + ".bucket"); + metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName(Variables.MODID + ".bucket"); + jewelryModifier = new ItemJewelryModifier().setUnlocalizedName(Variables.MODID + ".jewelryModifier").setTextureName(Variables.MODID + ":jewelryModifier").setCreativeTab(JewelrycraftMod.jewelrycraft); + goldifiedObject = new ItemGoldifiedObject().setUnlocalizedName(Variables.MODID + ".goldifiedObject"); + + GameRegistry.registerItem(thiefGloves, "thiefGloves"); + GameRegistry.registerItem(shadowIngot, "shadowIngot"); + GameRegistry.registerItem(molds, "molds"); + GameRegistry.registerItem(clayMolds, "clayMolds"); + GameRegistry.registerItem(ring, "ring"); + GameRegistry.registerItem(necklace, "necklace"); + GameRegistry.registerItem(bracelet, "bracelet"); + GameRegistry.registerItem(earrings, "earrings"); + GameRegistry.registerItem(crystal, "crystal"); + GameRegistry.registerItem(guide, "guide"); + GameRegistry.registerItem(bucket, "moltenMetalBucket"); + GameRegistry.registerItem(metal, "moltenMetal"); + GameRegistry.registerItem(jewelryModifier, "jewelryModifier"); + GameRegistry.registerItem(goldifiedObject, "goldifiedObject"); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/007cb0a590e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/007cb0a590e3001417b2e384bf7c3702 new file mode 100644 index 0000000..eec4f55 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/007cb0a590e3001417b2e384bf7c3702 @@ -0,0 +1,85 @@ +package darkknight.jewelrycraft.tileentity; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityMidasTouch extends TileEntity +{ + public Entity target; + + public TileEntityMidasTouch() + { + } + + public void setEntity(Entity ent) + { + target = ent; + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + if (target != null){ + int id = EntityList.getEntityID(target); + NBTTagCompound tag = new NBTTagCompound(); + target.writeToNBT(tag); + nbt.setInteger("entityID", id); + nbt.setTag("entity", tag); + } + } + + /** + * @param nbt + */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + if (nbt.hasKey("entityID") && nbt.hasKey("entity")){ + NBTTagCompound en = (NBTTagCompound)nbt.getTag("entity"); + int entityID = nbt.getInteger("entityID"); + EntityLivingBase entity = (EntityLivingBase)EntityList.createEntityByID(entityID, worldObj); + entity.readFromNBT(en); + target = entity; + } + } + + /** + * + */ + @Override + public void updateEntity() + { + super.updateEntity(); + // System.out.println(target); + } + + /** + * @return + */ + @Override + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + /** + * @param net + * @param packet + */ + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) + { + readFromNBT(packet.func_148857_g()); + worldObj.func_147479_m(xCoord, yCoord, zCoord); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/00dc645002e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/00dc645002e50014174fe663e69b8422 new file mode 100644 index 0000000..f13e940 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/00dc645002e50014174fe663e69b8422 @@ -0,0 +1,56 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) if (Block.getBlockFromItem(item.getItem()) == Blocks.air) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return Block.getBlockFromItem(item.getItem()).getIcon(0, 0); + else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/802b95f798e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/802b95f798e3001412c4c4819c88e86b new file mode 100644 index 0000000..1c311a2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/802b95f798e3001412c4c4819c88e86b @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; +// System.out.println(midas.target.rotationYaw); +// GL11.glRotatef(, 0.0F, 1.0F, 0.0F); + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.target.posX - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, 23F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/b0b6ee38c4df00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/b0b6ee38c4df00141dc6c962aec96210 deleted file mode 100644 index 906a5b1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/b0b6ee38c4df00141dc6c962aec96210 +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Mod made by DarkKnight during the Modjam 3 - * It's an awesome mod - * I love me! :D - */ -package darkknight.jewelrycraft; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Logger; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.gen.structure.MapGenStructureIO; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.oredict.OreDictionary; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.ModMetadata; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.VillagerRegistry; -import cpw.mods.fml.relauncher.Side; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.client.gui.GuiHandler; -import darkknight.jewelrycraft.commands.JewelrycraftCommands; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.curses.CurseList; -import darkknight.jewelrycraft.damage.DamageSourceList; -import darkknight.jewelrycraft.effects.EffectsList; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.events.BucketHandler; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.events.KeyBindings; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.network.PacketClearColorCache; -import darkknight.jewelrycraft.network.PacketKeyPressEvent; -import darkknight.jewelrycraft.network.PacketRequestLiquidData; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketRequestSetSlot; -import darkknight.jewelrycraft.network.PacketSendCurseStats; -import darkknight.jewelrycraft.network.PacketSendLiquidData; -import darkknight.jewelrycraft.network.PacketSendPlayerInfo; -import darkknight.jewelrycraft.proxy.CommonProxy; -import darkknight.jewelrycraft.recipes.CraftingRecipes; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.Variables; -import darkknight.jewelrycraft.worldGen.Generation; -import darkknight.jewelrycraft.worldGen.village.ComponentJewelry; -import darkknight.jewelrycraft.worldGen.village.JCTrades; -import darkknight.jewelrycraft.worldGen.village.VillageJewelryHandler; - -@Mod (modid = Variables.MODID, name = Variables.MODNAME, version = Variables.VERSION) -public class JewelrycraftMod -{ - @Instance (Variables.MODID) - public static JewelrycraftMod instance; - @SidedProxy (clientSide = "darkknight.jewelrycraft.proxy.ClientProxy", serverSide = "darkknight.jewelrycraft.proxy.CommonProxy") - public static CommonProxy proxy; - public static final Logger logger = Logger.getLogger("Jewelrycraft"); - public static File dir; - public static CreativeTabs jewelrycraft = new CreativeTabs(Variables.MODID){ - @Override - public Item getTabIconItem() - { - return Item.getItemFromBlock(BlockList.jewelCraftingTable); - } - }; - public static CreativeTabs liquids = new CreativeTabLiquids("Liquids"); - public static NBTTagCompound saveData = new NBTTagCompound(); - public static NBTTagCompound clientData = new NBTTagCompound(); - public static File liquidsConf; - public static SimpleNetworkWrapper netWrapper; - public static boolean fancyRender; - - /** - * Pre initialization of mod stuff. - * - * @param e FMLPreInitializationEvent - * @throws IOException Signals that an I/O exception has occurred. - */ - @EventHandler - public void preInit(FMLPreInitializationEvent e) throws IOException - { - ConfigHandler.preInit(e); - BlockList.preInit(e); - ItemList.preInit(e); - CraftingRecipes.preInit(e); - CurseList.preInit(e); - OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot)); - OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre)); - VillagerRegistry.instance().registerVillagerId(3000); - VillagerRegistry.instance().registerVillageTradeHandler(3000, new JCTrades()); - VillagerRegistry.instance().registerVillageCreationHandler(new VillageJewelryHandler()); - try{ - MapGenStructureIO.func_143031_a(ComponentJewelry.class, Variables.MODID + ":Jewelry"); - } - catch(Throwable e2){ - logger.severe("Error registering Jewelrycraft Structures with Vanilla Minecraft: this is expected in versions earlier than 1.7.10"); - } - MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); - MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE); - BucketHandler.INSTANCE.buckets.put(BlockList.moltenMetal, ItemList.bucket); - - ModMetadata metadata = e.getModMetadata(); - List authorList = new ArrayList(); - - authorList.add("OnyxDarkKnight"); - authorList.add("bspkrs"); - authorList.add("domi1819"); - - dir = e.getModConfigurationDirectory(); - proxy.preInit(); - netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Variables.MODID); - netWrapper.registerMessage(PacketRequestLiquidData.class, PacketRequestLiquidData.class, 0, Side.SERVER); - netWrapper.registerMessage(PacketSendLiquidData.class, PacketSendLiquidData.class, 1, Side.CLIENT); - netWrapper.registerMessage(PacketClearColorCache.class, PacketClearColorCache.class, 2, Side.CLIENT); - netWrapper.registerMessage(PacketKeyPressEvent.class, PacketKeyPressEvent.class, 3, Side.SERVER); - netWrapper.registerMessage(PacketRequestPlayerInfo.class, PacketRequestPlayerInfo.class, 4, Side.SERVER); - netWrapper.registerMessage(PacketSendPlayerInfo.class, PacketSendPlayerInfo.class, 5, Side.CLIENT); - netWrapper.registerMessage(PacketSendCurseStats.class, PacketSendCurseStats.class, 6, Side.CLIENT); - netWrapper.registerMessage(PacketRequestSetSlot.class, PacketRequestSetSlot.class, 7, Side.SERVER); - - metadata.autogenerated = false; - metadata.authorList = authorList; - metadata.url = "https://github.com/sor1n/Jewelrycraft"; - - createEntity(EntityHeart.class, Variables.MODID + ".Heart", 0x000000, 0xFF0000, false); - createEntity(EntityHalfHeart.class, Variables.MODID + ".Half-Heart", 0x000000, 0xFF0000, false); - -// EntityRegistry.addSpawn(EntityMob.class, 5, 2, 3, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.plains, BiomeGenBase.beach, BiomeGenBase.coldBeach, BiomeGenBase.frozenRiver); - } - - public void createEntity(Class entity, String entityName, int solidColor, int spotColor, boolean hasSpawnEgg) - { - int randomID = EntityRegistry.findGlobalUniqueEntityId(); - if(hasSpawnEgg) EntityRegistry.registerGlobalEntityID(entity, entityName, randomID, solidColor, spotColor); - else EntityRegistry.registerGlobalEntityID(entity, entityName, randomID); - EntityRegistry.registerModEntity(entity, entityName, randomID, this, 40, 3, true); - } - - /** - * Initializes the world generation and key bindings. - * - * @param e FMLInitializationEvent - */ - @EventHandler - public void init(FMLInitializationEvent e) - { - GameRegistry.registerWorldGenerator(new Generation(), 0); - if (FMLCommonHandler.instance().getSide() == Side.CLIENT) FMLCommonHandler.instance().bus().register(new KeyBindings()); - new GuiHandler(); - } - - /** - * Post initialization of metals, modifiers and others. - * - * @param e FMLPostInitializationEvent - */ - @EventHandler - public void postInit(FMLPostInitializationEvent e) - { - JewelrycraftUtil.addMetals(); - JewelrycraftUtil.jamcrafters(); - EffectsList.postInit(e); - DamageSourceList.postInit(e); - proxy.postInit(); - } - - @Mod.EventHandler - public void serverLoad(FMLServerStartingEvent event) - { - event.registerServerCommand(new JewelrycraftCommands()); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/201cfc0598e3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/201cfc0598e3001412c4c4819c88e86b new file mode 100644 index 0000000..62b87a0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/201cfc0598e3001412c4c4819c88e86b @@ -0,0 +1,75 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null){ + System.out.println(((TileEntityMidasTouch)tile).target.width); + this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width/2, 0F, 0.5f -((TileEntityMidasTouch)tile).target.width/2, 0.5f +((TileEntityMidasTouch)tile).target.width/2, ((TileEntityMidasTouch)tile).target.height, 0.5f +((TileEntityMidasTouch)tile).target.width/2); + } + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/40cc55896edd001412dce27813e7be4a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/40cc55896edd001412dce27813e7be4a deleted file mode 100644 index 5f9902b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/40cc55896edd001412dce27813e7be4a +++ /dev/null @@ -1,43 +0,0 @@ -package darkknight.jewelrycraft.network; - -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class PacketRequestPlayerInfo implements IMessage, IMessageHandler -{ - EntityPlayer player; - public PacketRequestPlayerInfo(EntityPlayer player) - { - this.player = player; - } - - /** - * @param message - * @param ctx - * @return - */ - @Override - public IMessage onMessage(PacketRequestPlayerInfo message, MessageContext ctx) - { - return new PacketSendPlayerInfo(PlayerUtils.getModPlayerPersistTag(player, Variables.MODID)); - } - - /** - * @param buf - */ - @Override - public void fromBytes(ByteBuf buf) - {} - - /** - * @param buf - */ - @Override - public void toBytes(ByteBuf buf) - {} -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/d0acf8ff27e500141c50bd6848c69dc6 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/d0acf8ff27e500141c50bd6848c69dc6 new file mode 100644 index 0000000..5a61768 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/d0acf8ff27e500141c50bd6848c69dc6 @@ -0,0 +1,57 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo) list.add(EnumChatFormatting.DARK_PURPLE + "Shiny, but useless :c"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/e0cd16ca92e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/e0cd16ca92e3001417b2e384bf7c3702 new file mode 100644 index 0000000..2072a65 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/e0cd16ca92e3001417b2e384bf7c3702 @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(midas.target, midas.target.posX - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, 0F, 1F); +// RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, midas.target.posX - RenderManager.instance.renderPosX, midas.target.posY - RenderManager.instance.renderPosY, midas.target.posZ - RenderManager.instance.renderPosZ, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/80bcb0aecfdf00141dc6c962aec96210 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/80bcb0aecfdf00141dc6c962aec96210 deleted file mode 100644 index 9013aef..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/80bcb0aecfdf00141dc6c962aec96210 +++ /dev/null @@ -1,102 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); -// if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(30, 18 + (size + 26) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); -// } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("BlackHeart") > 0){ - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), 15 + 35*count, resolution.getScaledHeight() - 16, 16777215); - } - count++; - mc.renderEngine.bindTexture(hearts); - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(5 + 35*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/a00c68532dde00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/a00c68532dde00141043c3025ec60dfc deleted file mode 100644 index c0e870a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/a00c68532dde00141043c3025ec60dfc +++ /dev/null @@ -1,106 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; -import org.lwjgl.opengl.GL11; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import darkknight.jewelrycraft.curses.Curse; -import darkknight.jewelrycraft.util.Variables; - -public class ScreenHandler extends Gui -{ - private Minecraft mc; - public static NBTTagCompound tagCache = null; - public static int cooldown; - static ResourceLocation texture; - static ResourceLocation hearts = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); - - public ScreenHandler(Minecraft mc, ResourceLocation tex) - { - super(); - this.mc = mc; - texture = tex; - } - - @SubscribeEvent - public void renderScreen(RenderGameOverlayEvent event) - { -// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); - if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return; - if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){ - int count = 0; - int size = 32; - ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){ - mc.renderEngine.bindTexture(hearts); - for(Curse curse: Curse.getCurseList()){ - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ -// Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000); -// Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064); - drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60); - count++; - } - } - mc.renderEngine.bindTexture(texture); - count = 0; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glScalef(0.45f, 0.45f, 0.0f); - drawTexturedModalRect(28, 18 + (size + 26) * count, tag % size * size, tag / size * size, size, size); - GL11.glPopMatrix(); - count++; - } - count = 0; - size = 16; - for(Curse curse: Curse.getCurseList()) - if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){ - int tag = curse.getID(); - mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215); - if (tagCache.getInteger(curse.getName()) == 2){ - mc.renderEngine.bindTexture(hearts); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size); - GL11.glPopMatrix(); - } - count++; - } - } - GL11.glPushMatrix(); - GL11.glColor4f(1f, 1f, 1f, 1.0f); - mc.renderEngine.bindTexture(hearts); - count = 0; - size = 16; - if (tagCache.getFloat("BlueHeart") > 0){ - for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++) - drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() - 50 + 16 * count, 0 * size, 0 * size, size, size); - if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("BlackHeart") > 0){ -// for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++) - drawTexturedModalRect(15, resolution.getScaledHeight() - 50 + 16 * count, 1 * size, 0 * size, size, size); - mc.fontRenderer.drawStringWithShadow("x" + tagCache.getFloat("BlackHeart"), 15, resolution.getScaledHeight() - 50 + 16 * count, 16777215); -// if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size); - } - count++; - if (tagCache.getFloat("WhiteHeart") > 0) - drawTexturedModalRect(2, resolution.getScaledHeight() - 50 + 16 * count, 2 * size, 1 * size, size, size); - GL11.glPopMatrix(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/005b783701e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/005b783701e50014174fe663e69b8422 new file mode 100644 index 0000000..c28968c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/005b783701e50014174fe663e69b8422 @@ -0,0 +1,55 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + if (JewelryNBT.item(stack) != null){ + ItemStack item = JewelryNBT.item(stack); + return item.getItem().getIconIndex(JewelryNBT.item(stack)); + } + else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/109511b201e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/109511b201e60014127dc373d78c1666 new file mode 100644 index 0000000..b42d356 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/109511b201e60014127dc373d78c1666 @@ -0,0 +1,41 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import darkknight.jewelrycraft.block.BlockMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +/** + * @author Sorin + */ +public class BlockEventHandler +{ + @SubscribeEvent + public void onBlockDestroyed(BlockEvent.BreakEvent event) + { + // System.out.println("Broken " + event.getResult()); + ItemStack item = event.getPlayer().inventory.getCurrentItem(); + if (event.block instanceof BlockMidasTouch && item != null && item.getItem().canHarvestBlock(event.block, item)){ + System.out.println(event.block.getHarvestLevel(event.blockMetadata) + " " + item.getItem().getHarvestLevel(item, "ItemPickaxe.class")); + TileEntityMidasTouch te = (TileEntityMidasTouch)event.world.getTileEntity(event.x, event.y, event.z); + if (te.target != null) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, new ItemStack(Items.gold_nugget, (int)(te.target.width * te.target.height * 100), 0)); + } + } + + public void dropItem(World world, double x, double y, double z, ItemStack stack) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + entityitem.motionX = 0; + entityitem.motionZ = 0; + entityitem.motionY = 0.11000000298023224D; + world.spawnEntityInWorld(entityitem); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/10e7546d07e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/10e7546d07e50014174fe663e69b8422 new file mode 100644 index 0000000..9ed257e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/10e7546d07e50014174fe663e69b8422 @@ -0,0 +1,61 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public boolean hasEffect(ItemStack item) + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getIconIndex(); + return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); +// if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/900f624402e50014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/900f624402e50014174fe663e69b8422 new file mode 100644 index 0000000..d61aba7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/900f624402e50014174fe663e69b8422 @@ -0,0 +1,54 @@ +/** + * + */ +package darkknight.jewelrycraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemGoldObj extends Item +{ + public ItemGoldObj() + {} + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + return 0xffff00; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + ItemStack item = JewelryNBT.item(stack); + if (item != null) return item.getItem().getIconIndex(JewelryNBT.item(stack)); + else return itemIcon; + } + + public String getItemStackDisplayName(ItemStack stack) + { + return "Golden " + JewelryNBT.item(stack).getDisplayName(); + } + + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean displayInfo) + { + if (displayInfo){ + ItemStack item = JewelryNBT.item(stack); + if (item != null) list.add("Item: " + EnumChatFormatting.BLUE + item.getDisplayName()); + list.add(EnumChatFormatting.DARK_PURPLE + "Well this is useless now"); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/30d8384237e100141e1cc3c3be242e56 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/30d8384237e100141e1cc3c3be242e56 new file mode 100644 index 0000000..8ecf8aa --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/30d8384237e100141e1cc3c3be242e56 @@ -0,0 +1,454 @@ +package darkknight.jewelrycraft.worldGen.village; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureVillagePieces; +import net.minecraft.world.gen.structure.StructureVillagePieces.Start; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.item.ItemMolds; +import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class ComponentJewelry extends StructureVillagePieces.House1 +{ + private int averageGroundLevel = -1; + + /** + * + */ + public ComponentJewelry() + {} + + /** + * @param par1ComponentVillageStartPiece + * @param par2 + * @param par3Random + * @param par4StructureBoundingBox + * @param par5 + */ + public ComponentJewelry(Start par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) + { + super(); + coordBaseMode = par5; + boundingBox = par4StructureBoundingBox; + } + + /** + * @param villagePiece + * @param pieces + * @param random + * @param p1 + * @param p2 + * @param p3 + * @param p4 + * @param p5 + * @return + */ + @SuppressWarnings ("rawtypes") + public static ComponentJewelry buildComponent(Start villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 11, 5, 12, p4); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentJewelry(villagePiece, p5, random, structureboundingbox, p4) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the end, it adds Fences... + * + * @param world + * @param random + * @param sbb + * @return + */ + @Override + public boolean addComponentParts(World world, Random random, StructureBoundingBox sbb) + { + if (averageGroundLevel < 0){ + averageGroundLevel = getAverageGroundLevel(world, sbb); + if (averageGroundLevel < 0) return true; + boundingBox.offset(0, averageGroundLevel - boundingBox.maxY + 3, 0); + } + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace) + */ + fillWithBlocks(world, sbb, 0, 0, 6, 10, 5, 11, Block.getBlockById(0), Block.getBlockById(0), false); + fillWithBlocks(world, sbb, 2, 0, 0, 8, 5, 5, Block.getBlockById(0), Block.getBlockById(0), false); + // Pillars + fillWithBlocks(world, sbb, 2, 0, 0, 2, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 2, 0, 3, 2, 3, 3, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 0, 8, 3, 0, Blocks.log, Blocks.log, false); + fillWithBlocks(world, sbb, 8, 0, 3, 8, 3, 3, Blocks.log, Blocks.log, false); + // Walls + fillWithBlocks(world, sbb, 2, 0, 1, 2, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 2, 0, 4, 2, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 1, 8, 3, 2, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 8, 0, 4, 8, 3, 5, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 3, 0, 0, 7, 3, 0, Blocks.planks, Blocks.planks, false); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 3, 6, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 11, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 0, 0, 6, 0, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + fillWithBlocks(world, sbb, 10, 0, 6, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false); + // Roof + for(int i = 3; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 2, i, 4, j, sbb); + for(int i = 3; i <= 7; i++) + for(int j = 6; j <= 6; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, i, 4, j, sbb); + for(int i = 1; i <= 9; i++) + for(int j = 7; j <= 10; j++) + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 3, i, 4, j, sbb); + for(int i = 2; i <= 8; i++) + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, i, 4, 0, sbb); + for(int i = 1; i <= 5; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 2, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 8, 4, i, sbb); + } + for(int i = 0; i <= 2; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 6, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i + 8, 4, 6, sbb); + } + for(int i = 7; i <= 11; i++){ + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 0, 4, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 10, 4, i, sbb); + } + for(int i = 0; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 11, sbb); + // Base + for(int i = 2; i <= 8; i++) + for(int j = 0; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.planks, 1, i, 0, j, sbb); + fillWithBlocks(world, sbb, 0, 0, 6, 10, 0, 11, Blocks.stonebrick, Blocks.stonebrick, false); + for(int i = 6; i <= 10; i++) + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 5, 0, i, sbb); + for(int i = 7; i <= 10; i++){ + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 1, 0, i, sbb); + placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 9, 0, i, sbb); + } + // Decorations + placeDoorAtCurrentPosition(world, sbb, random, 6, 1, 0, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeDoorAtCurrentPosition(world, sbb, random, 5, 1, 6, getMetadataWithOffset(Blocks.wooden_door, 1)); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 3, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 4, 2, 0, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 2, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 4, sbb); + placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 3, 1, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 3, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 7, 3, 3, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 5, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 7, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 10, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 9, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 8, sbb); + placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 9, sbb); + int bgCarpetColor = random.nextInt(16); + for(int i = 4; i <= 7; i++) + for(int j = 1; j <= 5; j++) + placeBlockAtCurrentPosition(world, Blocks.carpet, bgCarpetColor, i, 1, j, sbb); + generateChest(world, 3, 1, 1, 0, random, sbb, ConfigHandler.GEM_CHEST_MIN, ConfigHandler.GEM_CHEST_MAX); + generateDisplayer(world, 3, 1, 2, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + placeBlockAtCurrentPosition(world, BlockList.jewelCraftingTable, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, 3, 1, 3, sbb); + generateDisplayer(world, 3, 1, 4, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb); + generateChest(world, 3, 1, 5, 0, random, sbb, ConfigHandler.GEM_CHEST_MIN, ConfigHandler.GEM_CHEST_MAX); + generateFurnace(world, 1, 1, 7, 0, random, sbb, ConfigHandler.FURNACE_MIN_INGOT_STACK, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 7, 0, random, sbb, ConfigHandler.FURNACE_MIN_INGOT_STACK, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 7, 0, random, sbb, ConfigHandler.FURNACE_MIN_INGOT_STACK, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 1, 10, 0, random, sbb, ConfigHandler.FURNACE_MIN_INGOT_STACK, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 2, 10, 0, random, sbb, ConfigHandler.FURNACE_MIN_INGOT_STACK, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateFurnace(world, 1, 3, 10, 0, random, sbb, ConfigHandler.FURNACE_MIN_INGOT_STACK, ConfigHandler.furnacesIngotStackMax, ConfigHandler.CAN_FURNACE_GENERATE_INGOTS); + generateSmelter(world, 1, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateSmelter(world, 1, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean()); + generateMolder(world, 2, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + generateMolder(world, 2, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean()); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + if (random.nextBoolean()) generateIngotChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + else generateOresChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.INGOT_CHEST_MIN, ConfigHandler.INGOT_CHEST_MAX, Blocks.trapped_chest, ConfigHandler.INGOT_CHEST_MAX_STACK); + for(int l = 0; l < 6; ++l) + for(int i1 = 2; i1 < 9; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + for(int l = 6; l < 12; ++l) + for(int i1 = 0; i1 < 11; ++i1){ + clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb); + } + spawnVillagers(world, sbb, 3, 1, 3, 1); + return true; + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + */ + public void generateChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, Blocks.chest, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + ItemStack jewels = JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size())); + chest.func_145976_a("Jeweler's Chest"); + if (jewels.getItem() == Items.nether_star && ConfigHandler.GENERATE_VILLAGE_NETHERSTAR) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + else if (random.nextBoolean() && jewels.getItem() != Items.nether_star) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateIngotChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ingot Chest"); + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), metal); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param chestB + * @param randomAmount + */ + public void generateOresChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + int t = random.nextInt(max - min + 1) + min; + placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb); + TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1); + while (chest != null && t > 0){ + chest.func_145976_a("Ores Chest"); + int oreID = random.nextInt(JewelrycraftUtil.ores.size()); + ItemStack ores = JewelrycraftUtil.ores.get(oreID).copy(); + ores.stackSize = 2 + random.nextInt(randomAmount); + if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), ores); + t--; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + */ + public void generateDisplayer(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.displayer, metadata, i, j, k, sbb); + TileEntityDisplayer displayer = (TileEntityDisplayer)world.getTileEntity(i1, j1, k1); + if (displayer != null){ + Item[] jewels = {ItemList.ring, ItemList.necklace}; + ItemStack jewel = new ItemStack(jewels[random.nextInt(jewels.length)]); + JewelryNBT.addMetal(jewel, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()))); + JewelryNBT.addModifiers(jewel, JewelrycraftUtil.addRandomModifiers(random.nextInt(4))); + JewelryNBT.addGem(jewel, JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size()))); + displayer.object = jewel; + displayer.quantity = 1; + displayer.hasObject = true; + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param isEmpty + */ + public void generateSmelter(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean isEmpty) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.smelter, metadata, i, j, k, sbb); + TileEntitySmelter smelter = (TileEntitySmelter)world.getTileEntity(i1, j1, k1); + if (smelter != null && !isEmpty){ + int metal = random.nextInt(JewelrycraftUtil.metal.size()); + smelter.moltenMetal = JewelrycraftUtil.metal.get(metal).copy(); + smelter.hasMoltenMetal = true; + int quantity = random.nextInt(9); + switch(quantity) + { + case 0: + smelter.quantity = 0.1f; + case 1: + smelter.quantity = 0.2f; + case 2: + smelter.quantity = 0.3f; + case 3: + smelter.quantity = 0.4f; + case 4: + smelter.quantity = 0.5f; + case 5: + smelter.quantity = 0.6f; + case 6: + smelter.quantity = 0.7f; + case 7: + smelter.quantity = 0.8f; + case 8: + smelter.quantity = 0.9f; + default: + smelter.quantity = 0.1f; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param hasMold + * @param hasStuff + */ + public void generateMolder(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean hasMold, boolean hasStuff) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, BlockList.molder, metadata, i, j, k, sbb); + TileEntityMolder molder = (TileEntityMolder)world.getTileEntity(i1, j1, k1); + if (molder != null && !molder.hasMold) if (hasMold){ + int meta = random.nextInt(ItemMolds.moldsItemNames.length); + molder.mold = new ItemStack(ItemList.molds, 1, meta); + molder.hasMold = true; + if (hasStuff){ + ItemStack ring = new ItemStack(ItemList.ring); + JewelryNBT.addMetal(ring, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack necklace = new ItemStack(ItemList.necklace); + JewelryNBT.addMetal(necklace, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack bracelet = new ItemStack(ItemList.bracelet); + JewelryNBT.addMetal(bracelet, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + ItemStack earrings = new ItemStack(ItemList.earrings); + JewelryNBT.addMetal(earrings, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy()); + if (meta == 0) molder.jewelBase = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())); + else if (meta == 1) molder.jewelBase = ring; + else if (meta == 2) molder.jewelBase = necklace; + else if (meta == 3) molder.jewelBase = bracelet; + else if (meta == 4) molder.jewelBase = earrings; + molder.hasJewelBase = true; + } + } + } + + /** + * @param world + * @param i + * @param j + * @param k + * @param metadata + * @param random + * @param sbb + * @param min + * @param max + * @param hasMetal + */ + public void generateFurnace(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, boolean hasMetal) + { + int i1 = getXWithOffset(i, k); + int j1 = getYWithOffset(j); + int k1 = getZWithOffset(i, k); + placeBlockAtCurrentPosition(world, Blocks.furnace, metadata, i, j, k, sbb); + TileEntityFurnace furnace = (TileEntityFurnace)world.getTileEntity(i1, j1, k1); + if (furnace != null){ + if (random.nextBoolean()) furnace.setInventorySlotContents(1, new ItemStack(Items.coal, 1 + random.nextInt(16))); + if (hasMetal){ + int metalID = random.nextInt(JewelrycraftUtil.metal.size()); + ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy(); + metal.stackSize = random.nextInt(max - min + 1) + min; + furnace.setInventorySlotContents(2, metal); + } + } + } + + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + * + * @param par1 + * @return + */ + @Override + protected int getVillagerType(int par1) + { + return 3000; + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/603945450fe60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/603945450fe60014127dc373d78c1666 new file mode 100644 index 0000000..61a221a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/603945450fe60014127dc373d78c1666 @@ -0,0 +1,578 @@ +package darkknight.jewelrycraft.item.render; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class ItemRender implements IItemRenderer +{ + TileEntitySpecialRenderer render; + public TileEntity entity; + ModelBase model; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + private Minecraft mc = Minecraft.getMinecraft(); + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + /** + * @param render + * @param entity + * @param model + */ + public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model) + { + this.entity = entity; + this.render = render; + this.model = model; + } + + public ItemRender() + {} + + /** + * @param item + * @param type + * @return + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + /** + * @param type + * @param item + * @param helper + * @return + */ + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + /** + * @param type + * @param item + * @param data + */ + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object ... data) + { + if (render != null && entity != null && JewelryNBT.item(item) == null){ + if (type == IItemRenderer.ItemRenderType.ENTITY){ + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glTranslatef(-0.5f, -0.5f, -0.4f); + } + render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F); + }else if (JewelryNBT.item(item) != null){ + GL11.glColor3f(1F, 1F, 0F); + renderItem(Minecraft.getMinecraft().thePlayer, JewelryNBT.item(item), 0, type); + } + } + + public void renderItem(EntityLivingBase entity, ItemStack itemStack, int meta, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = itemStack.getItem(); + Block block = Block.getBlockFromItem(item); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, type); + if (customRenderer != null){ + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.7F, 0.55F, 0.55F); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, entity, itemStack); + }else if (itemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())){ + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + if (type.equals(type.EQUIPPED)) GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if (itemStack != null && block != null && block.getRenderBlockPass() != 0){ + GL11.glDepthMask(false); + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + }else{ + renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F); + } + }else{ + IIcon iicon = itemStack.getIconIndex(); + if (iicon == null){ + GL11.glPopMatrix(); + return; + } + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6 = 1.6F; + GL11.glScalef(f6, f6, f6); + if (!type.equals(type.EQUIPPED_FIRST_PERSON)){ + GL11.glRotatef(45f, 0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 1f, 0f); + GL11.glRotatef(30f, 1f, 0f, 0f); + if (type.equals(type.EQUIPPED)){ + GL11.glRotatef(35f, 1f, 0f, 0f); + GL11.glTranslatef(0F, -0.15F, -0.6F); + } + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + } + else{ + GL11.glTranslatef(0.3F, 0.3F, 0.3F); + GL11.glRotatef(60f, 0f, 1f, 0f); + } + if (itemStack.getItem().requiresMultipleRenderPasses()){ + for(int x = 0; x < itemStack.getItem().getRenderPasses(itemStack.getItemDamage()); x++){ + iicon = itemStack.getItem().getIcon(itemStack, x); + f = iicon.getMinU(); + f1 = iicon.getMaxU(); + f2 = iicon.getMinV(); + f3 = iicon.getMaxV(); + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + }else{ + ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + } + GL11.glDepthFunc(GL11.GL_EQUAL); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.325F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(17F, 0.0F, 0.0F); + GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); + GL11.glColor3f(1F, 1F, 0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 30000L) / 30000.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(itemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + GL11.glPopMatrix(); + } + + public void renderBlockAsItem(Block block, int damage, float luminacy) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = block == Blocks.grass; + if (block == Blocks.dispenser || block == Blocks.dropper || block == Blocks.furnace) damage = 3; + int j; + float f1; + float f2; + GL11.glColor4f(1F, 1F, 0F, 1.0F); + j = block.getRenderType(); + renderBlocksIr.setRenderBoundsFromBlock(block); + int k; + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26){ + GL11.glColor4f(1F, 1F, 0F, 1.0F); + if (j == 1){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage); + renderBlocksIr.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + }else if (j == 19){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + renderBlocksIr.renderBlockStemSmall(block, damage, renderBlocksIr.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 23){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + block.setBlockBoundsForItemRender(); + tessellator.draw(); + }else if (j == 13){ + block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 22){ + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(block, damage, luminacy); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + }else if (j == 6){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderBlockCropsImpl(block, damage, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + }else if (j == 2){ + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderTorchAtAngle(block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + }else if (j == 10){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 27){ + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int l = 0; l < 8; ++l){ + byte b0 = 0; + byte b1 = 1; + if (l == 0){ + b0 = 2; + } + if (l == 1){ + b0 = 3; + } + if (l == 2){ + b0 = 4; + } + if (l == 3){ + b0 = 5; + b1 = 2; + } + if (l == 4){ + b0 = 6; + b1 = 3; + } + if (l == 5){ + b0 = 7; + b1 = 5; + } + if (l == 6){ + b0 = 6; + b1 = 2; + } + if (l == 7){ + b0 = 3; + } + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + renderBlocksIr.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 11){ + for(k = 0; k < 4; ++k){ + f2 = 0.125F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + if (k == 3){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 21){ + for(k = 0; k < 3; ++k){ + f2 = 0.0625F; + if (k == 0){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + if (k == 1){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + f2 = 0.0625F; + if (k == 2){ + renderBlocksIr.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSide(block, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + }else if (j == 32){ + for(k = 0; k < 2; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + if (k == 1){ + renderBlocksIr.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + }else if (j == 35){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockAnvilOrient((BlockAnvil)block, 0, 0, 0, damage << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else if (j == 34){ + for(k = 0; k < 3; ++k){ + if (k == 0){ + renderBlocksIr.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.obsidian)); + }else if (k == 1){ + renderBlocksIr.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.beacon)); + }else if (k == 2){ + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.setOverrideBlockTexture(renderBlocksIr.getBlockIcon(Blocks.glass)); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + renderBlocksIr.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + renderBlocksIr.clearOverrideBlockTexture(); + }else if (j == 38){ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderBlocksIr.renderBlockHopperMetadata((BlockHopper)block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + }else{ + FMLRenderAccessLibrary.renderInventoryBlock(renderBlocksIr, block, damage, j); + } + }else{ + if (j == 16){ + damage = 1; + } + block.setBlockBoundsForItemRender(); + renderBlocksIr.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderBlocksIr.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 0, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderBlocksIr.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 1, damage)); + tessellator.draw(); + GL11.glColor4f(1F, 1F, 0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderBlocksIr.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 2, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderBlocksIr.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 3, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 4, damage)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderBlocksIr.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderBlocksIr.getBlockIconFromSideAndMetadata(block, 5, damage)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/603b13fe21e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/603b13fe21e60014127dc373d78c1666 new file mode 100644 index 0000000..a783ada --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/603b13fe21e60014127dc373d78c1666 @@ -0,0 +1,12 @@ +/** + * + */ +package darkknight.jewelrycraft.events; + +/** + * @author Sorin + * + */ +public class EventCommonHandler +{ +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/60f238f802de00141043c3025ec60dfc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/60f238f802de00141043c3025ec60dfc deleted file mode 100644 index 1b2d71b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/60f238f802de00141043c3025ec60dfc +++ /dev/null @@ -1,276 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.block.BlockHandPedestal; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.particles.EntityShadowsFX; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityShadowEye extends TileEntity -{ - public int opening, timer, t = 20; - public boolean active; - public ArrayList pedestalItems = new ArrayList(); - ResourceLocation particleTexture = new ResourceLocation(Variables.MODID, "textures/particle/shadows.png"); - public EntityPlayer target; - - public TileEntityShadowEye() - { - opening = 1; - timer = 20; - active = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("opening", opening); - nbt.setInteger("timer", timer); - nbt.setBoolean("active", active); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - opening = nbt.getInteger("opening"); - timer = nbt.getInteger("timer"); - active = nbt.getBoolean("active"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); - if (active) timer--; - if (target != null && worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D)).contains(target)){ - active = false; - timer = -1; - } - if (opening == 4 && timer <= 0) active = false; - if (!active && timer <= 0 && opening != 1){ - if (t > 0) t--; - if (t <= 0){ - opening--; - t = 20; - } - } - if (opening == 2 && timer <= 0 && t == 10){ - addData(worldObj, xCoord, yCoord, zCoord); - TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord); - if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems); - } - if (active && timer <= 0){ - if (opening < 4){ - opening++; - timer = 20; - } - if (valid && opening == 4) timer = 1000; - else if (!valid){ - active = false; - timer = -1; - } - } - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", false); - } - if (active && opening == 4){ - float din = 6F; - int i = Minecraft.getMinecraft().gameSettings.particleSetting; - for(float x = -din; x <= din; x += 0.2F) - for(float z = -din; z <= din; z += 0.2F) - if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture)); - for(int l = 0; l <= 2 - i; l++) - worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0); - for(Object player: worldObj.getEntitiesWithinAABB(EntityPlayer.class, getRenderBoundingBox().expand(8D, 8D, 8D))) - if (player != null){ - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag((EntityPlayer)player, Variables.MODID); - persistTag.setBoolean("nearStartedRitual", true); - } - } - } - - /** - * @param world - * @param x - * @param y - * @param z - * @param metadata - * @return - */ - public boolean isValidStructure(World world, int x, int y, int z, int metadata) - { - if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false; - if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false; - // 2nd Layer - if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false; - if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false; - if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false; - if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false; - // 3rd Layer - if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false; - if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false; - }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){ - // Layers from top to bottom - // 1st Layer - if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false; - if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false; - if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false; - // 2nd Layer - if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false; - if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false; - if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false; - if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false; - // 3rd Layer - if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false; - // 4th Layer - if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false; - // 5th Layer - if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false; - if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false; - } - // 3rd Layer - if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false; - if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false; - // 4th Layer - if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false; - // 5th Layer - // Pillars - if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false; - if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false; - // Pedestals - if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false; - if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false; - if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false; - if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false; - if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false; - if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false; - if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false; - if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false; - if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false; - if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false; - if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false; - if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false; - if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false; - return true; - } - - /** - * @param world - * @param x - * @param y - * @param z - */ - public void addData(World world, int x, int y, int z) - { - pedestalItems.clear(); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5)); - addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4)); - } - - /** - * @param pedestal - */ - public void addPedestalInfo(TileEntityHandPedestal pedestal) - { - ItemStack heldItemStack; - if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){ - if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy()); - else{ - boolean hasItem = false; - int index = 0; - for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++) - if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){ - index = ind; - hasItem = true; - if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false; - } - if (!hasItem) pedestalItems.add(heldItemStack.copy()); - else{ - ItemStack object = pedestalItems.get(index).copy(); - object.stackSize++; - pedestalItems.set(index, object); - } - } - pedestal.removeHeldItemStack(); - pedestal.openHand(); - } - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/c010f86d9ae3001412c4c4819c88e86b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/c010f86d9ae3001412c4c4819c88e86b new file mode 100644 index 0000000..e9b08aa --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/c010f86d9ae3001412c4c4819c88e86b @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 1; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + + TileEntity tile = world.getTileEntity(x, y, z); + if (tile != null && ((TileEntityMidasTouch)tile).target != null) + ret.add(new ItemStack(Items.gold_nugget, 23, 0)); + + return ret; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/c077e76102e60014127dc373d78c1666 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/c077e76102e60014127dc373d78c1666 new file mode 100644 index 0000000..5e26a8c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/c077e76102e60014127dc373d78c1666 @@ -0,0 +1,77 @@ +package darkknight.jewelrycraft.block; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.tileentity.TileEntityMolder; + +public class BlockMidasTouch extends BlockContainer +{ + protected BlockMidasTouch(Material mat) + { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityMidasTouch(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public int quantityDropped(Random rand) + { + return 0; + } + + public Item getItemDropped(int id, Random rand, int size) + { + return Items.gold_nugget; + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (((TileEntityMidasTouch)tile).target != null) this.setBlockBounds(0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0F, 0.5f - ((TileEntityMidasTouch)tile).target.width / 2, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2, ((TileEntityMidasTouch)tile).target.height, 0.5f + ((TileEntityMidasTouch)tile).target.width / 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("minecraft:gold_block"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/d0474cdb91e3001417b2e384bf7c3702 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/d0474cdb91e3001417b2e384bf7c3702 new file mode 100644 index 0000000..ce67e78 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/d0474cdb91e3001417b2e384bf7c3702 @@ -0,0 +1,26 @@ +package darkknight.jewelrycraft.tileentity.renders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + TileEntityMidasTouch midas = (TileEntityMidasTouch)te; + GL11.glTranslatef(1.0F, 0.0F, 1.0F); + if (midas.target != null){ + ((EntityLiving)midas.target).hurtTime = 0; + GL11.glColor3f(1.0F, 1.0F, 0.0F); + RenderManager.instance.getEntityRenderObject(midas.target).doRender(midas.target, te.xCoord - Minecraft.getMinecraft().thePlayer.posX, 0D, 0D, 0F, 1F); + } + GL11.glPopMatrix(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/b02f1331fce40014174fe663e69b8422 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/b02f1331fce40014174fe663e69b8422 new file mode 100644 index 0000000..c4fbc04 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/b02f1331fce40014174fe663e69b8422 @@ -0,0 +1,48 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; + +public class CurseMidasTouch extends Curse +{ + public CurseMidasTouch(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!world.isRemote && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null){ + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); + TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); + midasTouchVictim.setEntity(target); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), MathHelper.floor_double(target.posZ), midasTouchVictim); + target.setDead(); + } + } + + @Override + public void action(World world, EntityPlayer player) + { + if(player.inventory.getCurrentItem() != null){ + int index = player.inventory.currentItem; + ItemStack item = player.inventory.getCurrentItem(); + player.inventory.setInventorySlotContents(index, new ItemStack(ItemList.goldifiedObject,item.stackSize,item.getItemDamage())); + } + } + + public String getDescription() + { + return "Be careful what you wish for..."; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/29/b9/22/1d/35/7e/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/29/b9/22/1d/35/7e/history.index new file mode 100644 index 0000000..53004f7 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/29/b9/22/1d/35/7e/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/29/b9/22/1d/35/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/29/b9/22/1d/35/history.index new file mode 100644 index 0000000..a7c2fc0 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/29/b9/22/1d/35/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/13/6a/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/13/6a/history.index index 70e0975..9f5fdf0 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/13/6a/history.index and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/13/6a/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/13/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/13/history.index index 4668f99..11ecbef 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/13/history.index and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/13/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/2/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/2/history.index index ea8d870..f533f50 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/2/history.index and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/2/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/29/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/29/history.index deleted file mode 100644 index ff08604..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/29/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/2e/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/2e/history.index deleted file mode 100644 index 2a54b4b..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/2e/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/35/3b/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/35/3b/history.index new file mode 100644 index 0000000..855994c Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/35/3b/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/35/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/35/history.index new file mode 100644 index 0000000..708ee78 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/35/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/3f/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/3f/history.index deleted file mode 100644 index afe7d1c..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/3f/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/5e/ac/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/5e/ac/history.index new file mode 100644 index 0000000..d8318de Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/5e/ac/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/6e/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/6e/history.index new file mode 100644 index 0000000..9d4afeb Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/6e/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/78/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/78/history.index deleted file mode 100644 index 00e3ea2..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/78/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/8d/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/8d/history.index index 07a409c..ae7d2d3 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/8d/history.index and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/8d/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/be/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/be/history.index new file mode 100644 index 0000000..0d91224 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/be/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/df/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/df/history.index new file mode 100644 index 0000000..5fb7806 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/df/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/e7/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/e7/history.index index f13a8a8..7888105 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/e7/history.index and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/e7/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/ef/9d/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/ef/9d/history.index new file mode 100644 index 0000000..ad15fa4 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/ef/9d/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/ef/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/ef/history.index index 4f8d8ff..65a6207 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/ef/history.index and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/ef/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/fe/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/fe/history.index deleted file mode 100644 index 7e44e1e..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/fe/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/history.index index 09ebfcb..3e3fe94 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/history.index and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers index 9c36208..d817830 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/org.eclipse.jdt.core/state.dat b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/org.eclipse.jdt.core/state.dat index 5b1fde0..ae1f231 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/org.eclipse.jdt.core/state.dat and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/org.eclipse.jdt.core/state.dat differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/50.tree b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/50.tree deleted file mode 100644 index f10f868..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/50.tree and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/61.tree b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/61.tree new file mode 100644 index 0000000..11c91fb Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/61.tree differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources index bb98ea4..e6a3868 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs index 466d7f9..a469f5d 100644 --- a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,3 @@ -#Sun Jun 05 18:58:07 CEST 2011 -version=1 eclipse.preferences.version=1 refresh.enabled=true +version=1 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs index 6b6819c..a471080 100644 --- a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs @@ -1,6 +1,6 @@ command=C\:\\Program Files\\Java\\jdk1.7.0_71\\bin\\javadoc.exe content_assist_disabled_computers=org.eclipse.jdt.ui.textProposalCategory\u0000org.eclipse.recommenders.calls.rcp.proposalCategory.templates\u0000org.eclipse.mylyn.java.ui.javaAllProposalCategory\u0000org.eclipse.jdt.ui.javaAllProposalCategory\u0000org.eclipse.jdt.ui.javaNoTypeProposalCategory\u0000org.eclipse.jdt.ui.javaTypeProposalCategory\u0000org.eclipse.recommenders.chain.rcp.proposalCategory.chain\u0000 -content_assist_lru_history= +content_assist_lru_history= content_assist_number_of_computers=19 content_assist_proposals_background=255,255,255 content_assist_proposals_foreground=0,0,0 diff --git a/eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml index 7e44cfa..d42b481 100644 --- a/eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml +++ b/eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml @@ -7,14 +7,14 @@
- +
- - + + - +
diff --git a/eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi index 6ac0320..65fdafa 100644 --- a/eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi +++ b/eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -1,6 +1,6 @@ - + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration ModelMigrationProcessor.001 @@ -209,9 +209,9 @@ - - - + + + newtablook org.eclipse.e4.secondaryDataStack @@ -263,33 +263,75 @@ categoryTag:Help - + newtablook org.eclipse.e4.primaryDataStack EditorStack active - - + + + Editor + org.eclipse.jdt.ui.CompilationUnitEditor + removeOnHide + + + Editor org.eclipse.jdt.ui.CompilationUnitEditor removeOnHide active activeOnClose - - + + + Editor + org.eclipse.jdt.ui.ClassFileEditor + removeOnHide + + + + Editor + org.eclipse.jdt.ui.CompilationUnitEditor + removeOnHide + + + + Editor + org.eclipse.jdt.ui.CompilationUnitEditor + removeOnHide + + + + Editor + org.eclipse.jdt.ui.CompilationUnitEditor + removeOnHide + + + + Editor + org.eclipse.jdt.ui.CompilationUnitEditor + removeOnHide + + + + Editor + org.eclipse.jdt.ui.CompilationUnitEditor + removeOnHide + + + Editor org.eclipse.jdt.ui.CompilationUnitEditor removeOnHide - - + + Editor org.eclipse.jdt.ui.CompilationUnitEditor removeOnHide - - + + Editor org.eclipse.jdt.ui.CompilationUnitEditor removeOnHide @@ -357,7 +399,7 @@ categoryTag:General - + View categoryTag:General @@ -877,7 +919,7 @@ Draggable - + toolbarSeparator @@ -916,7 +958,7 @@ Draggable - + toolbarSeparator diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/286606776.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/286606776.index index 185f2ca..22a9e0f 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/286606776.index and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/286606776.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps index 09db74d..bdab874 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml index fa8a606..c11066e 100644 --- a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml @@ -1,17 +1,5 @@ - - - - - - - - - - - - @@ -24,18 +12,12 @@ - - - - - - @@ -43,21 +25,39 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/4/16/refactorings.history b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/4/16/refactorings.history new file mode 100644 index 0000000..65224c1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/4/16/refactorings.history @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/4/16/refactorings.index b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/4/16/refactorings.index new file mode 100644 index 0000000..3b12e6a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/4/16/refactorings.index @@ -0,0 +1,33 @@ +1428858322752 Rename field 'ingotCoolingTime' +1428858378499 Rename field 'jewelryCraftingTime' +1428858453102 Rename field 'generateVillageNetherstar' +1428858545077 Rename field 'canFurnacesGenerateIngots' +1428858580546 Rename field 'maxVillageJewelers' +1428858610139 Rename field 'jewelerWeight' +1428858631202 Rename field 'ingotChestMin' +1428858644003 Rename field 'ingotChestMax' +1428858659900 Rename field 'ingotChestMaxStack' +1428858754945 Rename field 'jewelsChestMin' +1428858765633 Rename field 'jewelsChestMax' +1428858789095 Rename field 'furnacesIngotStackMin' +1428858817906 Rename field 'furnacesIngotStackMax' +1429274022464 Delete element +1429274043126 Rename field 'goldifiedObject' +1429278619252 Rename local variable 'p_78443_1_' +1429278665911 Rename local variable 'p_78443_2_' +1429278677023 Rename local variable 'p_78443_3_' +1429279708564 Rename local variable 'p_77015_1_' +1429279719138 Rename local variable 'p_77015_2_' +1429279745850 Rename local variable 'p_77015_3_' +1429279752445 Rename local variable 'p_77015_4_' +1429279759998 Rename local variable 'p_77015_5_' +1429293090556 Rename local variable 'p_147800_1_' +1429293103588 Rename local variable 'p_147800_2_' +1429293117457 Rename local variable 'p_147800_3_' +1429400571353 Move compilation units +1429401049332 Move compilation units +1429401055519 Delete element +1429401307313 Move compilation units +1429401403715 Move compilation unit +1429401444358 Move compilation unit +1429401452334 Move compilation unit diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log b/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log index 4b3cbf0..b6e7e7c 100644 --- a/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log +++ b/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log @@ -95,3 +95,5 @@ Caused by: java.net.SocketTimeoutException: Read timed out 2015-01-30 23:44:30,268 [Start Help Server] INFO org.eclipse.jetty.server.Server - jetty-8.1.14.v20131031 2015-01-30 23:44:30,648 [Start Help Server] INFO o.e.jetty.server.AbstractConnector - Started SelectChannelConnector@127.0.0.1:64856 2015-01-31 02:48:51,887 [Stop Help Server] INFO o.e.j.server.handler.ContextHandler - stopped o.e.j.s.ServletContextHandler{/help,null} +2015-04-19 01:38:49,576 [main] WARN o.e.r.i.c.rcp.TypeBindingAnalyzer - Can't handle class org.eclipse.jdt.internal.compiler.ast.OR_OR_Expression as parent of completion location. +2015-04-19 01:38:51,921 [main] WARN o.e.r.i.c.rcp.TypeBindingAnalyzer - Can't handle class org.eclipse.jdt.internal.compiler.ast.UnaryExpression as parent of completion location. diff --git a/eclipse/.metadata/.plugins/org.eclipse.ui.workbench.texteditor/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.ui.workbench.texteditor/dialog_settings.xml index 1b6289a..0086a4c 100644 --- a/eclipse/.metadata/.plugins/org.eclipse.ui.workbench.texteditor/dialog_settings.xml +++ b/eclipse/.metadata/.plugins/org.eclipse.ui.workbench.texteditor/dialog_settings.xml @@ -2,37 +2,37 @@
- + - - - - - - - - + + + + + + + + + + + + - - - -
- + - - + +
diff --git a/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml index 4d4ff6a..434b773 100644 --- a/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml +++ b/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml @@ -5,8 +5,8 @@
- - + + -- cgit v1.2.3