From 6312636fd9a4d0f56dc7c9ff474a99d879bcb4e9 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Mon, 23 Mar 2015 14:51:06 +0000 Subject: Reworked the whole repo. --- eclipse/.metadata/.bak_0.log | 13382 +++++++++++++++++++ eclipse/.metadata/.lock | 0 eclipse/.metadata/.log | 3678 +++++ .../.metadata/.mylyn/.taskListIndex/segments.gen | Bin 0 -> 20 bytes eclipse/.metadata/.mylyn/.taskListIndex/segments_1 | Bin 0 -> 32 bytes eclipse/.metadata/.mylyn/.tasks.xml.zip | Bin 0 -> 250 bytes eclipse/.metadata/.mylyn/repositories.xml.zip | Bin 0 -> 437 bytes eclipse/.metadata/.mylyn/tasks.xml.zip | Bin 0 -> 250 bytes .../.plugins/net.sf.jautodoc/dialog_settings.xml | 25 + .../.history/0/00f44bf8f2cf0014170de422db399e8d | 65 + .../.history/0/60ca70f3b9d000141b65e2fc7f94332d | 232 + .../.history/0/90d037febbd000141b65e2fc7f94332d | 236 + .../.history/0/c03acc5982d000141a1fb02abca5ff55 | 67 + .../.history/12/50aa0d289bd000141b65e2fc7f94332d | 0 .../.history/13/70a57e40e75300141786a2891bfc8d75 | 85 + .../.history/13/908f5c3bb4d000141b65e2fc7f94332d | 195 + .../.history/15/70a157f022cf00141c41f52413db5e31 | 459 + .../.history/15/a058ee18bcd000141b65e2fc7f94332d | 114 + .../.history/15/b0d74dd670cf00141de78e4a85bb2469 | 41 + .../.history/17/3014ba2224cf00141c41f52413db5e31 | 25 + .../.history/18/70793b297ecf00141de78e4a85bb2469 | 81 + .../.history/18/f0b8342df3cf0014170de422db399e8d | 64 + .../.history/19/40b7127a9cd000141b65e2fc7f94332d | 52 + .../.history/1a/70a655ecbdd000141b65e2fc7f94332d | 237 + .../.history/1b/208e063bf5cf0014170de422db399e8d | 69 + .../.history/1b/807d1568bed000141b65e2fc7f94332d | 239 + .../.history/1b/f07260f599d000141b65e2fc7f94332d | 78 + .../.history/1d/10a8250bf2cf0014170de422db399e8d | 64 + .../.history/1d/304ae31aa0ce00141801ff0972626827 | 71 + .../.history/1e/00b1e982a0ce00141801ff0972626827 | 25 + .../.history/1e/e0daccca6fcf00141de78e4a85bb2469 | 43 + .../.history/1f/20cffe1816cf00141c41f52413db5e31 | 30 + .../.history/2/804b704ea7ce00141801ff0972626827 | 113 + .../.history/2/e064279b24cf00141c41f52413db5e31 | 36 + .../.history/20/709a7da620cf00141c41f52413db5e31 | 459 + .../.history/20/80c96a3f6fcf00141de78e4a85bb2469 | 39 + .../.history/20/906f9d59f3cf0014170de422db399e8d | 64 + .../.history/21/90210400bbd000141b65e2fc7f94332d | 112 + .../.history/22/400e338dbcd000141b65e2fc7f94332d | 238 + .../.history/22/50c220fcb9d000141b65e2fc7f94332d | 232 + .../.history/23/408dbb6524cf00141c41f52413db5e31 | 36 + .../.history/24/e06abfb6f6cf0014170de422db399e8d | 66 + .../.history/25/10ad6571bed000141b65e2fc7f94332d | 240 + .../.history/25/6035720f6fcf00141de78e4a85bb2469 | 36 + .../.history/25/60b18a49bdd000141b65e2fc7f94332d | 125 + .../.history/25/60f0dd6d12cf00141c41f52413db5e31 | 453 + .../.history/25/f08a3fedf1cf0014170de422db399e8d | 63 + .../.history/26/40b2f4a3b8d000141b65e2fc7f94332d | 197 + .../.history/26/801b0ce922cf00141c41f52413db5e31 | 460 + .../.history/26/905604776fcf00141de78e4a85bb2469 | 39 + .../.history/27/10f40556bbd000141b65e2fc7f94332d | 112 + .../.history/27/60dda1c0bcd000141b65e2fc7f94332d | 245 + .../.history/27/a01e32b5bbd000141b65e2fc7f94332d | 114 + .../.history/28/5054a9ea70cf00141de78e4a85bb2469 | 41 + .../.history/28/90616b3e85d000141a1fb02abca5ff55 | 79 + .../.history/29/b02c9da3a5ce00141801ff0972626827 | 104 + .../.history/2a/30dc218d2f9300141384bdd0ca2744d8 | 659 + .../.history/2b/2069bbfabdd000141b65e2fc7f94332d | 237 + .../.history/2b/a09c5791f6cf0014170de422db399e8d | 65 + .../.history/2c/0057e48384c600141066cb38d875561a | 86 + .../.history/2c/0075f9bc9fd000141b65e2fc7f94332d | 78 + .../.history/2c/702e06909bd000141b65e2fc7f94332d | 44 + .../.history/2c/b0fd61c916cf00141c41f52413db5e31 | 115 + .../.history/2d/90ac8e2b9fce00141801ff0972626827 | 68 + .../.history/2f/3016ca8fa3d000141b65e2fc7f94332d | 68 + .../.history/2f/90f98826b0d000141b65e2fc7f94332d | 247 + .../.history/3/902846c39fd000141b65e2fc7f94332d | 74 + .../.history/31/4099cacb16cf00141c41f52413db5e31 | 459 + .../.history/31/7026f2daf4cf0014170de422db399e8d | 62 + .../.history/31/90e1eeeff3cf0014170de422db399e8d | 62 + .../.history/32/009ecb1ebbd000141b65e2fc7f94332d | 112 + .../.history/33/10854bde6e5f00141b03e33c57c1f917 | 79 + .../.history/34/10340d2ef2cf0014170de422db399e8d | 64 + .../.history/34/e00a4c70e75300141786a2891bfc8d75 | 85 + .../.history/35/00ec9292a7ce00141801ff0972626827 | 116 + .../.history/35/50cdc566f48a00141c1cba3f7039360c | 617 + .../.history/35/c0e606a470cf00141de78e4a85bb2469 | 41 + .../.history/36/9026020ff48a00141c1cba3f7039360c | 618 + .../.history/36/9032f899b7d000141b65e2fc7f94332d | 197 + .../.history/36/a0809e1223cf00141c41f52413db5e31 | 460 + .../.history/37/10568ea1b7d000141b65e2fc7f94332d | 197 + .../.history/38/a0c4fa6984d000141a1fb02abca5ff55 | 69 + .../.history/3a/002a7b0fb7d000141b65e2fc7f94332d | 197 + .../.history/3a/10dc7459bbd000141b65e2fc7f94332d | 114 + .../.history/3a/606c08157ecf00141de78e4a85bb2469 | 81 + .../.history/3a/7064faac7dcf00141de78e4a85bb2469 | 186 + .../.history/3b/10890341bbd000141b65e2fc7f94332d | 112 + .../.history/3b/3024e21485d000141a1fb02abca5ff55 | 79 + .../.history/3b/503ff62fb6d000141b65e2fc7f94332d | 197 + .../.history/3c/60160ac99ad000141b65e2fc7f94332d | 74 + .../.history/3c/90a539afbbd000141b65e2fc7f94332d | 114 + .../.history/3d/0091dffeb5d000141b65e2fc7f94332d | 197 + .../.history/3d/30f66b0413cf00141c41f52413db5e31 | 57 + .../.history/3e/5019b6d220cf00141c41f52413db5e31 | 32 + .../.history/3e/7005297f22cf00141c41f52413db5e31 | 460 + .../.history/3e/808884ea13cf00141c41f52413db5e31 | 28 + .../.history/3f/30afb93df48a00141c1cba3f7039360c | 617 + .../.history/3f/50b62efab9d000141b65e2fc7f94332d | 232 + .../.history/3f/6048b993bcd000141b65e2fc7f94332d | 243 + .../.history/3f/c022d38cf2cf0014170de422db399e8d | 64 + .../.history/3f/e0ed63d312cf00141c41f52413db5e31 | 261 + .../.history/4/003ee58eafd000141b65e2fc7f94332d | 247 + .../.history/4/c02871fbb6d000141b65e2fc7f94332d | 197 + .../.history/40/b0889c1bbcd000141b65e2fc7f94332d | 115 + .../.history/41/c080ae01bcd000141b65e2fc7f94332d | 236 + .../.history/42/20200c94b8d000141b65e2fc7f94332d | 197 + .../.history/43/70f7cff5b6d000141b65e2fc7f94332d | 197 + .../.history/44/50241a6d84c600141066cb38d875561a | 86 + .../.history/44/d0a17b8f13cf00141c41f52413db5e31 | 24 + .../.history/45/90a975eca4ce00141801ff0972626827 | 103 + .../.history/46/104eb856f48a00141c1cba3f7039360c | 617 + .../.history/46/7051d7cf22cf00141c41f52413db5e31 | 460 + .../.history/48/20293dcd23cf00141c41f52413db5e31 | 99 + .../.history/48/f0362027f4cf0014170de422db399e8d | 62 + .../.history/49/2066f1c9bbd000141b65e2fc7f94332d | 115 + .../.history/49/707c7127bed000141b65e2fc7f94332d | 178 + .../.history/4a/4009975e82d000141a1fb02abca5ff55 | 67 + .../.history/4a/6016724bbad000141b65e2fc7f94332d | 78 + .../.history/4a/9089738c21cf00141c41f52413db5e31 | 36 + .../.history/4b/20a0a61c84d000141a1fb02abca5ff55 | 13 + .../.history/4b/20bea20c21cf00141c41f52413db5e31 | 36 + .../.history/4b/405c7f377ecf00141de78e4a85bb2469 | 13 + .../.history/4b/90de45a1bbd000141b65e2fc7f94332d | 114 + .../.history/4b/a055ddd2bbd000141b65e2fc7f94332d | 115 + .../.history/4b/d0c27ea5f6cf0014170de422db399e8d | 66 + .../.history/4c/1031dd2dbbd000141b65e2fc7f94332d | 112 + .../.history/4c/70c9f176f2cf0014170de422db399e8d | 64 + .../.history/4d/f08f115612cf00141c41f52413db5e31 | 24 + .../.history/4e/50025dc484c600141066cb38d875561a | 86 + .../.history/4e/b0576841f2cf0014170de422db399e8d | 64 + .../.history/4f/007bc83ab6d000141b65e2fc7f94332d | 197 + .../.history/4f/402d4daebcd000141b65e2fc7f94332d | 246 + .../.history/4f/e0d9514683d000141a1fb02abca5ff55 | 79 + .../.history/5/f00c439cb7d000141b65e2fc7f94332d | 197 + .../.history/50/10b548dabad000141b65e2fc7f94332d | 112 + .../.history/50/70986997b7d000141b65e2fc7f94332d | 197 + .../.history/52/c0326ecba5ce00141801ff0972626827 | 448 + .../.history/52/e06a0851bdd000141b65e2fc7f94332d | 125 + .../.history/53/90cafa5d14cf00141c41f52413db5e31 | 35 + .../.history/54/8048f9edb6d000141b65e2fc7f94332d | 197 + .../.history/54/a09b425fbbd000141b65e2fc7f94332d | 114 + .../.history/56/90504c0bbbd000141b65e2fc7f94332d | 112 + .../.history/56/a0087dd116cf00141c41f52413db5e31 | 116 + .../.history/57/20ddfa7621cf00141c41f52413db5e31 | 36 + .../.history/57/a04f0c50a4ce00141801ff0972626827 | 435 + .../.history/57/c08394fe40cf001411138789b9e67617 | 459 + .../.history/57/e0aa469384d000141a1fb02abca5ff55 | 79 + .../.history/59/1044992a23cf00141c41f52413db5e31 | 459 + .../.history/59/1048515cbbd000141b65e2fc7f94332d | 114 + .../.history/59/b085ddbd9ad000141b65e2fc7f94332d | 74 + .../.history/59/c07baaa5bcd000141b65e2fc7f94332d | 245 + .../.history/59/e0e84e2dbdd000141b65e2fc7f94332d | 115 + .../.history/5b/80f31216bbd000141b65e2fc7f94332d | 112 + .../.history/5b/b0474f9184d000141a1fb02abca5ff55 | 79 + .../.history/5b/b0a71b6116cf00141c41f52413db5e31 | 30 + .../.history/5c/10e245fff3cf0014170de422db399e8d | 62 + .../.history/5c/d08f32069cd000141b65e2fc7f94332d | 44 + .../.history/5c/f0e98566a7ce00141801ff0972626827 | 116 + .../.history/5d/00fa2de0a6ce00141801ff0972626827 | 106 + .../.history/5e/50723f9b2f9300141384bdd0ca2744d8 | 660 + .../.history/5e/f0abea277dcf00141de78e4a85bb2469 | 187 + .../.history/5f/30d8062da0ce00141801ff0972626827 | 71 + .../.history/5f/30e8b2dea5ce00141801ff0972626827 | 102 + .../.history/5f/50b15c9812cf00141c41f52413db5e31 | 102 + .../.history/5f/60bc25dabdd000141b65e2fc7f94332d | 236 + .../.history/6/d0a52e0212cf00141c41f52413db5e31 | 446 + .../.history/60/601a6034bcd000141b65e2fc7f94332d | 197 + .../.history/60/c0d85da8b8d000141b65e2fc7f94332d | 197 + .../.history/60/d052a15084c600141066cb38d875561a | 86 + .../.history/61/50774f8f84c600141066cb38d875561a | 86 + .../.history/62/2069867dbbd000141b65e2fc7f94332d | 114 + .../.history/62/30a210a5bbd000141b65e2fc7f94332d | 114 + .../.history/62/f0beebb39ad000141b65e2fc7f94332d | 74 + .../.history/63/60d2e4cf84c600141066cb38d875561a | 86 + .../.history/63/60dd45d1a5ce00141801ff0972626827 | 448 + .../.history/63/e00f48f3bdd000141b65e2fc7f94332d | 237 + .../.history/63/e0b3878d7dcf00141de78e4a85bb2469 | 223 + .../.history/64/30a5d74a2f9300141384bdd0ca2744d8 | 659 + .../.history/64/50a406e982d000141a1fb02abca5ff55 | 67 + .../.history/64/905e928db7d000141b65e2fc7f94332d | 197 + .../.history/65/603844c615cf00141c41f52413db5e31 | 460 + .../.history/65/60ae11e56e5f00141b03e33c57c1f917 | 80 + .../.history/65/80ef4046bbd000141b65e2fc7f94332d | 112 + .../.history/65/9039e7ea21cf00141c41f52413db5e31 | 459 + .../.history/66/b0813d41f3cf0014170de422db399e8d | 64 + .../.history/67/f0427c9d2f9300141384bdd0ca2744d8 | 660 + .../.history/68/00b782eca6ce00141801ff0972626827 | 112 + .../.history/68/f05ddeeb99d000141b65e2fc7f94332d | 79 + .../.history/69/30a1d335b4d000141b65e2fc7f94332d | 195 + .../.history/69/4034bfb970cf00141de78e4a85bb2469 | 462 + .../.history/6a/50b952462f9300141384bdd0ca2744d8 | 659 + .../.history/6b/c0058039a3ce00141801ff0972626827 | 438 + .../.history/6d/102be67fbbd000141b65e2fc7f94332d | 114 + .../.history/6d/20760f8dbbd000141b65e2fc7f94332d | 114 + .../.history/6e/d012947f9fce00141801ff0972626827 | 187 + .../.history/6f/b08cd803bcd000141b65e2fc7f94332d | 236 + .../.history/6f/f0b063e3a3ce00141801ff0972626827 | 435 + .../.history/7/105eef10f4cf0014170de422db399e8d | 62 + .../.history/7/90e15befbdd000141b65e2fc7f94332d | 237 + .../.history/7/d09c58ed23cf00141c41f52413db5e31 | 99 + .../.history/70/408fefd316cf00141c41f52413db5e31 | 116 + .../.history/70/5022fbd5b9d000141b65e2fc7f94332d | 232 + .../.history/70/e09f38179cd000141b65e2fc7f94332d | 48 + .../.history/71/60317a00bad000141b65e2fc7f94332d | 232 + .../.history/72/00e8ece9b6d000141b65e2fc7f94332d | 197 + .../.history/72/a00659a981d000141a1fb02abca5ff55 | 66 + .../.history/72/b01f1983b4d000141b65e2fc7f94332d | 195 + .../.history/72/c0b3c7e9e65300141786a2891bfc8d75 | 84 + .../.history/73/f07bc4852f9300141384bdd0ca2744d8 | 659 + .../.history/74/10c2166623cf00141c41f52413db5e31 | 461 + .../.history/75/20c0a81e70cf00141de78e4a85bb2469 | 43 + .../.history/76/b0ea8d2c7ccf00141de78e4a85bb2469 | 78 + .../.history/78/9098c35323cf00141c41f52413db5e31 | 461 + .../.history/79/f099510ebed000141b65e2fc7f94332d | 125 + .../.history/7a/f0dc16e6bad000141b65e2fc7f94332d | 112 + .../.history/7b/d08754d5a5ce00141801ff0972626827 | 448 + .../.history/7c/a02cf81bf48a00141c1cba3f7039360c | 618 + .../.history/7d/408bce2c7ecf00141de78e4a85bb2469 | 13 + .../.history/7d/80a2ccf2b6d000141b65e2fc7f94332d | 197 + .../.history/7d/c00b3a4e14cf00141c41f52413db5e31 | 113 + .../.history/7e/0063cb09a4ce00141801ff0972626827 | 435 + .../.history/7e/50b82d4b23cf00141c41f52413db5e31 | 461 + .../.history/7e/90811e76bbd000141b65e2fc7f94332d | 114 + .../.history/7e/d016443bbad000141b65e2fc7f94332d | 232 + .../.history/7e/e0cadf43f3cf0014170de422db399e8d | 64 + .../.history/7f/00b736a77dcf00141de78e4a85bb2469 | 82 + .../.history/7f/c0c31c6bf2cf0014170de422db399e8d | 64 + .../.history/7f/e05bccf47ecf00141de78e4a85bb2469 | 78 + .../.history/8/60685a7322cf00141c41f52413db5e31 | 463 + .../.history/8/b04fbcf8bbd000141b65e2fc7f94332d | 236 + .../.history/80/406867c2a5ce00141801ff0972626827 | 448 + .../.history/80/e0c8a1d614cf00141c41f52413db5e31 | 460 + .../.history/82/a027f35412cf00141c41f52413db5e31 | 447 + .../.history/83/a05c8663b7d000141b65e2fc7f94332d | 197 + .../.history/84/c023ecaca5ce00141801ff0972626827 | 448 + .../.history/85/20a25d63bbd000141b65e2fc7f94332d | 114 + .../.history/85/20ce4e77a0ce00141801ff0972626827 | 0 .../.history/85/8013b6e1bdd000141b65e2fc7f94332d | 237 + .../.history/85/902f5c8116cf00141c41f52413db5e31 | 32 + .../.history/86/407ff7ab81d000141a1fb02abca5ff55 | 67 + .../.history/87/0090d02f23cf00141c41f52413db5e31 | 460 + .../.history/87/108b25f9b6d000141b65e2fc7f94332d | 197 + .../.history/88/902740e1bad000141b65e2fc7f94332d | 112 + .../.history/88/d084e8b4f2cf0014170de422db399e8d | 64 + .../.history/89/1058a217f5cf0014170de422db399e8d | 69 + .../.history/8a/708b72abbbd000141b65e2fc7f94332d | 114 + .../.history/8c/109be73121cf00141c41f52413db5e31 | 36 + .../.history/8d/20884d44b4d000141b65e2fc7f94332d | 195 + .../.history/8f/602f81f1b9d000141b65e2fc7f94332d | 232 + .../.history/9/704de242b6d000141b65e2fc7f94332d | 197 + .../.history/90/902c91fbf5cf0014170de422db399e8d | 69 + .../.history/90/90e4273eb4d000141b65e2fc7f94332d | 195 + .../.history/90/b0804ec7bbd000141b65e2fc7f94332d | 114 + .../.history/91/00916edebad000141b65e2fc7f94332d | 112 + .../.history/91/40989e4e2f9300141384bdd0ca2744d8 | 659 + .../.history/91/7094473ba5ce00141801ff0972626827 | 436 + .../.history/92/0012daebb6d000141b65e2fc7f94332d | 197 + .../.history/92/5027d4627dcf00141de78e4a85bb2469 | 221 + .../.history/93/309bb5e59bd000141b65e2fc7f94332d | 44 + .../.history/93/5050fcc811cf00141c41f52413db5e31 | 30 + .../.history/94/101de9f4bad000141b65e2fc7f94332d | 112 + .../.history/94/808d7bfff2cf0014170de422db399e8d | 64 + .../.history/96/20fefcf5f6cf0014170de422db399e8d | 66 + .../.history/97/30e2d9ce70cf00141de78e4a85bb2469 | 41 + .../.history/97/50e131a6a5ce00141801ff0972626827 | 447 + .../.history/9a/e0a4fd13b7d000141b65e2fc7f94332d | 197 + .../.history/9b/b08e70da15cf00141c41f52413db5e31 | 460 + .../.history/9c/40075a7e83d000141a1fb02abca5ff55 | 76 + .../.history/9c/a07e323e82d000141a1fb02abca5ff55 | 67 + .../.history/9d/e0dd554e24cf00141c41f52413db5e31 | 460 + .../.history/9e/009246eabcd000141b65e2fc7f94332d | 244 + .../.history/9f/106b3f3e7ecf00141de78e4a85bb2469 | 81 + .../.history/9f/20478b38b4d000141b65e2fc7f94332d | 195 + .../.history/9f/20c9f6e114cf00141c41f52413db5e31 | 459 + .../.history/9f/20d9a4a46eae0014128c87a7399fc341 | 269 + .../.history/a0/00a993b822cf00141c41f52413db5e31 | 460 + .../.history/a1/10a3c349bad000141b65e2fc7f94332d | 78 + .../.history/a1/50356899bcd000141b65e2fc7f94332d | 244 + .../.history/a1/90065c70f48a00141c1cba3f7039360c | 617 + .../.history/a1/c0592c612f9300141384bdd0ca2744d8 | 659 + .../.history/a2/90d73160f48a00141c1cba3f7039360c | 617 + .../.history/a2/f0aba030bdd000141b65e2fc7f94332d | 125 + .../.history/a3/70560814bbd000141b65e2fc7f94332d | 112 + .../.history/a3/900b847d70cf00141de78e4a85bb2469 | 23 + .../.history/a3/b0489a1082d000141a1fb02abca5ff55 | 67 + .../.history/a4/80a5a26aa4ce00141801ff0972626827 | 435 + .../.history/a4/b0b5ffe4bcd000141b65e2fc7f94332d | 246 + .../.history/a4/c0b377522f9300141384bdd0ca2744d8 | 659 + .../.history/a5/609c1e85a3d000141b65e2fc7f94332d | 68 + .../.history/a6/908c46b1bbd000141b65e2fc7f94332d | 114 + .../.history/a8/104e81bcbbd000141b65e2fc7f94332d | 114 + .../.history/a8/5091d7a47dcf00141de78e4a85bb2469 | 223 + .../.history/a8/b0e9a94b82d000141a1fb02abca5ff55 | 67 + .../.history/a9/702aada322cf00141c41f52413db5e31 | 460 + .../.history/a9/d0cb2f4b7ecf00141de78e4a85bb2469 | 87 + .../.history/aa/00c84d88bed000141b65e2fc7f94332d | 241 + .../.history/aa/30b09a9679cf00141de78e4a85bb2469 | 99 + .../.history/ab/6017c8e9b5d000141b65e2fc7f94332d | 197 + .../.history/ac/50048858e65300141786a2891bfc8d75 | 89 + .../.history/ac/50346c7da0ce00141801ff0972626827 | 12 + .../.history/ac/70b9cd197acf00141de78e4a85bb2469 | 104 + .../.history/ad/400a697183d000141a1fb02abca5ff55 | 76 + .../.history/af/901e9340bcd000141b65e2fc7f94332d | 197 + .../.history/af/d0ba0cecf2cf0014170de422db399e8d | 64 + .../.history/af/d0ca0d9da5ce00141801ff0972626827 | 102 + .../.history/b/b04e0c6083d000141a1fb02abca5ff55 | 80 + .../.history/b/f079b2e06fcf00141de78e4a85bb2469 | 43 + .../.history/b2/805eed72bed000141b65e2fc7f94332d | 240 + .../.history/b5/00a0532bbbd000141b65e2fc7f94332d | 112 + .../.history/b5/60e65c7684c600141066cb38d875561a | 86 + .../.history/b6/106fae7312cf00141c41f52413db5e31 | 94 + .../.history/b6/306a41c76fcf00141de78e4a85bb2469 | 43 + .../.history/b6/606b4ad414cf00141c41f52413db5e31 | 458 + .../.history/b6/60a49035e75300141786a2891bfc8d75 | 85 + .../.history/b7/506e1ce570cf00141de78e4a85bb2469 | 463 + .../.history/b7/b04a00579cd000141b65e2fc7f94332d | 48 + .../.history/b7/b0804930bcd000141b65e2fc7f94332d | 197 + .../.history/b7/f0e12b0e9cd000141b65e2fc7f94332d | 48 + .../.history/b8/10f70a8cbed000141b65e2fc7f94332d | 241 + .../.history/b8/e03e7349a6ce00141801ff0972626827 | 104 + .../.history/b8/e0b1d7d7b6d000141b65e2fc7f94332d | 197 + .../.history/b9/309ab103b0d000141b65e2fc7f94332d | 246 + .../.history/b9/c0efc084a5ce00141801ff0972626827 | 103 + .../.history/b9/d024d91417cf00141c41f52413db5e31 | 32 + .../.history/ba/20f3e540b4d000141b65e2fc7f94332d | 195 + .../.history/ba/601f11c4f38a00141c1cba3f7039360c | 616 + .../.history/bb/8033e6be23cf00141c41f52413db5e31 | 99 + .../.history/bc/60c1a1249fce00141801ff0972626827 | 71 + .../.history/bc/d05049b984c600141066cb38d875561a | 86 + .../.history/bc/f0b55b69bad000141b65e2fc7f94332d | 197 + .../.history/c/70917207bed000141b65e2fc7f94332d | 125 + .../.history/c0/10212e1abbd000141b65e2fc7f94332d | 112 + .../.history/c0/4032699bb8d000141b65e2fc7f94332d | 197 + .../.history/c1/f01d11859ad000141b65e2fc7f94332d | 74 + .../.history/c2/f0af8c117acf00141de78e4a85bb2469 | 101 + .../.history/c4/40367889a5ce00141801ff0972626827 | 446 + .../.history/c4/b048e39fb8d000141b65e2fc7f94332d | 197 + .../.history/c6/7013ae1e85d000141a1fb02abca5ff55 | 79 + .../.history/c6/e0433f2d7dcf00141de78e4a85bb2469 | 221 + .../.history/c7/10dc615fbed000141b65e2fc7f94332d | 240 + .../.history/c7/70f09d1c7acf00141de78e4a85bb2469 | 102 + .../.history/c7/802694e3b6d000141b65e2fc7f94332d | 197 + .../.history/c7/d0ba6178bbd000141b65e2fc7f94332d | 114 + .../.history/c8/0088d4467ecf00141de78e4a85bb2469 | 187 + .../.history/c9/10b07e76a4ce00141801ff0972626827 | 436 + .../.history/c9/f0711f27a7ce00141801ff0972626827 | 111 + .../.history/ca/509abef6f38a00141c1cba3f7039360c | 617 + .../.history/ca/f037376012cf00141c41f52413db5e31 | 88 + .../.history/cb/c0eb4d77b9d000141b65e2fc7f94332d | 233 + .../.history/cc/10c08f90b7d000141b65e2fc7f94332d | 197 + .../.history/cc/600bf435bdd000141b65e2fc7f94332d | 125 + .../.history/cc/80d5ff84bed000141b65e2fc7f94332d | 241 + .../.history/cd/b0a79825a3ce00141801ff0972626827 | 435 + .../.history/ce/70b3113c6fcf00141de78e4a85bb2469 | 39 + .../.history/ce/802d6c7d12cf00141c41f52413db5e31 | 97 + .../.history/ce/e02d96277ecf00141de78e4a85bb2469 | 187 + .../.history/d/20ce60e681d000141a1fb02abca5ff55 | 66 + .../.history/d/406be580bed000141b65e2fc7f94332d | 240 + .../.history/d0/306fef1113cf00141c41f52413db5e31 | 235 + .../.history/d2/c001ded384d000141a1fb02abca5ff55 | 79 + .../.history/d3/40e36e70b9d000141b65e2fc7f94332d | 233 + .../.history/d3/80bf6f449bd000141b65e2fc7f94332d | 12 + .../.history/d3/c054e7fab5d000141b65e2fc7f94332d | 197 + .../.history/d4/60ad6fa0bcd000141b65e2fc7f94332d | 245 + .../.history/d4/d07706722f9300141384bdd0ca2744d8 | 659 + .../.history/d4/d0b060aabcd000141b65e2fc7f94332d | 246 + .../.history/d5/303797fd70cf00141de78e4a85bb2469 | 41 + .../.history/d5/a098cba6bbd000141b65e2fc7f94332d | 114 + .../.history/d6/8057ba46b6d000141b65e2fc7f94332d | 197 + .../.history/d6/f0ef569c3fcf001411138789b9e67617 | 74 + .../.history/d7/40e71d74a5ce00141801ff0972626827 | 446 + .../.history/d9/10f9057570cf00141de78e4a85bb2469 | 23 + .../.history/d9/20879a0e7ccf00141de78e4a85bb2469 | 78 + .../.history/da/30ea349dbbd000141b65e2fc7f94332d | 114 + .../.history/db/80e1e997f2cf0014170de422db399e8d | 64 + .../.history/dc/80c6ef06b6d000141b65e2fc7f94332d | 197 + .../.history/dd/7040acbf14cf00141c41f52413db5e31 | 453 + .../.history/de/007d82c399d000141b65e2fc7f94332d | 74 + .../.history/e0/307fa52624cf00141c41f52413db5e31 | 99 + .../.history/e0/4010cd0b71cf00141de78e4a85bb2469 | 41 + .../.history/e3/d0e62fdca5ce00141801ff0972626827 | 448 + .../.history/e4/a0630cfe22cf00141c41f52413db5e31 | 459 + .../.history/e5/c04fd795a3d000141b65e2fc7f94332d | 68 + .../.history/e7/50b3265a70cf00141de78e4a85bb2469 | 463 + .../.history/e7/600fcefeb6d000141b65e2fc7f94332d | 197 + .../.history/e8/3080ffd383c600141066cb38d875561a | 86 + .../.history/e8/7006558fa4ce00141801ff0972626827 | 436 + .../.history/ea/d02f62a6b8d000141b65e2fc7f94332d | 197 + .../.history/eb/104b1fe0b6d000141b65e2fc7f94332d | 197 + .../.history/eb/20010f43a5ce00141801ff0972626827 | 102 + .../.history/ec/103c252f6a8700141aabd4ca4d39309b | 248 + .../.history/ec/20d3910bbdd000141b65e2fc7f94332d | 242 + .../.history/ec/e0847d256fcf00141de78e4a85bb2469 | 37 + .../.history/ed/508104ffb9d000141b65e2fc7f94332d | 232 + .../.history/ed/90284a44bbd000141b65e2fc7f94332d | 112 + .../.history/ee/d0e63671bcd000141b65e2fc7f94332d | 238 + .../.history/ef/90de6b157dcf00141de78e4a85bb2469 | 221 + .../.history/ef/d0c544f1bdd000141b65e2fc7f94332d | 237 + .../.history/f/208abec412cf00141c41f52413db5e31 | 57 + .../.history/f0/10a6e789b7d000141b65e2fc7f94332d | 197 + .../.history/f0/f08cc33785c600141066cb38d875561a | 86 + .../.history/f0/f0d537e7bdd000141b65e2fc7f94332d | 237 + .../.history/f1/70f21455bdd000141b65e2fc7f94332d | 125 + .../.history/f2/f043f225a4ce00141801ff0972626827 | 435 + .../.history/f3/00fc7df4b6d000141b65e2fc7f94332d | 197 + .../.history/f3/1004bc969bd000141b65e2fc7f94332d | 44 + .../.history/f3/20259783bbd000141b65e2fc7f94332d | 114 + .../.history/f3/e09bcee7b6d000141b65e2fc7f94332d | 197 + .../.history/f5/9037e8d8f2cf0014170de422db399e8d | 64 + .../.history/f5/c04a3dbcbcd000141b65e2fc7f94332d | 246 + .../.history/f6/7014dc552f9300141384bdd0ca2744d8 | 658 + .../.history/f7/80d09401b7d000141b65e2fc7f94332d | 197 + .../.history/f8/10660ab09ad000141b65e2fc7f94332d | 74 + .../.history/f8/106b4a6bf48a00141c1cba3f7039360c | 617 + .../.history/f8/9082ae46b4d000141b65e2fc7f94332d | 195 + .../.history/f8/f00bc4107ecf00141de78e4a85bb2469 | 81 + .../.history/f9/10304e6cbcd000141b65e2fc7f94332d | 236 + .../.history/f9/30327f097dcf00141de78e4a85bb2469 | 222 + .../.history/f9/80f0e254bed000141b65e2fc7f94332d | 237 + .../.history/fa/602b84f79bd000141b65e2fc7f94332d | 44 + .../.history/fb/9020325670cf00141de78e4a85bb2469 | 459 + .../.history/fb/906294ac70cf00141de78e4a85bb2469 | 42 + .../.history/fd/00facaebbad000141b65e2fc7f94332d | 112 + .../.history/fd/a0e56af6bbd000141b65e2fc7f94332d | 235 + .../.history/ff/40a89923f4cf0014170de422db399e8d | 62 + .../.history/ff/a0f1a1f6afd000141b65e2fc7f94332d | 244 + .../.location | Bin 0 -> 168 bytes .../.markers.snap | Bin 0 -> 16 bytes .../.syncinfo.snap | Bin 0 -> 16 bytes .../.indexes/e4/b9/22/7d/96/13/history.index | Bin 0 -> 121 bytes .../.indexes/e4/b9/22/7d/96/2/history.index | Bin 0 -> 218 bytes .../.indexes/e4/b9/22/7d/96/2e/history.index | Bin 0 -> 153 bytes .../.indexes/e4/b9/22/7d/96/35/history.index | Bin 0 -> 1478 bytes .../.indexes/e4/b9/22/7d/96/7f/history.index | Bin 0 -> 3481 bytes .../.indexes/e4/b9/22/7d/96/8d/history.index | Bin 0 -> 93 bytes .../.indexes/e4/b9/22/7d/96/df/history.index | Bin 0 -> 1411 bytes .../.indexes/e4/b9/22/7d/96/e7/history.index | Bin 0 -> 1708 bytes .../.indexes/e4/b9/22/7d/96/fe/history.index | Bin 0 -> 1896 bytes .../.indexes/e4/b9/22/7d/96/history.index | Bin 0 -> 295 bytes .../.projects/Minecraft/.location | Bin 0 -> 82 bytes .../.projects/Minecraft/.markers | Bin 0 -> 1034 bytes .../.projects/Minecraft/.markers.snap | Bin 0 -> 16 bytes .../.projects/Minecraft/.syncinfo.snap | Bin 0 -> 16 bytes .../Minecraft/org.eclipse.jdt.core/state.dat | Bin 0 -> 102544 bytes .../.root/.indexes/history.version | 1 + .../.root/.indexes/properties.index | Bin 0 -> 151 bytes .../.root/.indexes/properties.version | 1 + .../org.eclipse.core.resources/.root/.markers.snap | Bin 0 -> 16 bytes .../org.eclipse.core.resources/.root/36.tree | Bin 0 -> 653413 bytes .../.safetable/org.eclipse.core.resources | Bin 0 -> 1552 bytes .../.plugins/org.eclipse.core.resources/36.snap | Bin 0 -> 19083 bytes .../.settings/net.sf.jautodoc.prefs | 8 + .../.settings/org.eclipse.core.net.prefs | 2 + .../.settings/org.eclipse.core.resources.prefs | 4 + .../.settings/org.eclipse.debug.core.prefs | 2 + .../.settings/org.eclipse.debug.ui.prefs | 12 + .../org.eclipse.epp.usagedata.gathering.prefs | 3 + .../.settings/org.eclipse.jdt.core.prefs | 311 + .../.settings/org.eclipse.jdt.launching.prefs | 2 + .../.settings/org.eclipse.jdt.ui.prefs | 34 + .../org.eclipse.jst.j2ee.webservice.ui.prefs | 2 + .../.settings/org.eclipse.m2e.discovery.prefs | 2 + .../.settings/org.eclipse.mylyn.context.core.prefs | 2 + .../.settings/org.eclipse.mylyn.java.ui.prefs | 3 + .../.settings/org.eclipse.mylyn.monitor.ui.prefs | 2 + .../.settings/org.eclipse.mylyn.tasks.ui.prefs | 4 + .../.settings/org.eclipse.pde.api.tools.prefs | 2 + .../org.eclipse.recommenders.completion.rcp.prefs | 3 + .../.settings/org.eclipse.search.prefs | 2 + .../.settings/org.eclipse.team.cvs.ui.prefs | 2 + .../.settings/org.eclipse.team.ui.prefs | 2 + .../.settings/org.eclipse.ui.browser.prefs | 2 + .../.settings/org.eclipse.ui.editors.prefs | 17 + .../.settings/org.eclipse.ui.ide.prefs | 8 + .../.settings/org.eclipse.ui.prefs | 2 + .../.settings/org.eclipse.ui.workbench.prefs | 4 + .../.settings/org.eclipse.wst.sse.core.prefs | 2 + .../org.eclipse.wst.ws.service.policy.prefs | 3 + .../org.eclipse.debug.core/.launches/Client.launch | 14 + .../.launches/ClientNoLogin.launch | 14 + .../org.eclipse.debug.core/.launches/Server.launch | 13 + .../org.eclipse.debug.ui/dialog_settings.xml | 21 + .../launchConfigurationHistory.xml | 27 + .../org.eclipse.e4.workbench/workbench.xmi | 3230 +++++ .../org.eclipse.egit.ui/dialog_settings.xml | 6 + .../org.eclipse.equinox.p2.ui/dialog_settings.xml | 10 + .../.project | 18 + .../.plugins/org.eclipse.jdt.core/1007111076.index | Bin 0 -> 22799 bytes .../.plugins/org.eclipse.jdt.core/1112183641.index | Bin 0 -> 25 bytes .../.plugins/org.eclipse.jdt.core/1140841982.index | Bin 0 -> 118894 bytes .../.plugins/org.eclipse.jdt.core/122877426.index | Bin 0 -> 1721583 bytes .../.plugins/org.eclipse.jdt.core/1349318312.index | Bin 0 -> 28682 bytes .../.plugins/org.eclipse.jdt.core/1396595163.index | Bin 0 -> 25 bytes .../.plugins/org.eclipse.jdt.core/1405940092.index | Bin 0 -> 10670982 bytes .../.plugins/org.eclipse.jdt.core/1421139610.index | Bin 0 -> 706170 bytes .../.plugins/org.eclipse.jdt.core/1501172594.index | Bin 0 -> 4249 bytes .../.plugins/org.eclipse.jdt.core/1532915402.index | Bin 0 -> 111110 bytes .../.plugins/org.eclipse.jdt.core/1560443425.index | Bin 0 -> 83830 bytes .../.plugins/org.eclipse.jdt.core/1701803245.index | Bin 0 -> 26751 bytes .../.plugins/org.eclipse.jdt.core/1819133815.index | Bin 0 -> 170881 bytes .../.plugins/org.eclipse.jdt.core/1830251659.index | Bin 0 -> 20957 bytes .../.plugins/org.eclipse.jdt.core/1846500785.index | Bin 0 -> 21822 bytes .../.plugins/org.eclipse.jdt.core/1921212175.index | Bin 0 -> 157978 bytes .../.plugins/org.eclipse.jdt.core/1964534855.index | Bin 0 -> 541333 bytes .../.plugins/org.eclipse.jdt.core/1977427294.index | Bin 0 -> 104628 bytes .../.plugins/org.eclipse.jdt.core/20746801.index | Bin 0 -> 2152 bytes .../.plugins/org.eclipse.jdt.core/2084239533.index | Bin 0 -> 44572 bytes .../.plugins/org.eclipse.jdt.core/2084554879.index | Bin 0 -> 681636 bytes .../.plugins/org.eclipse.jdt.core/2208772637.index | Bin 0 -> 66947 bytes .../.plugins/org.eclipse.jdt.core/2258076031.index | Bin 0 -> 31079 bytes .../.plugins/org.eclipse.jdt.core/2306963099.index | Bin 0 -> 25 bytes .../.plugins/org.eclipse.jdt.core/2373544449.index | Bin 0 -> 25 bytes .../.plugins/org.eclipse.jdt.core/2485927450.index | Bin 0 -> 90066 bytes .../.plugins/org.eclipse.jdt.core/2531317059.index | Bin 0 -> 80711 bytes .../.plugins/org.eclipse.jdt.core/2540715342.index | Bin 0 -> 3409 bytes .../.plugins/org.eclipse.jdt.core/2619072759.index | Bin 0 -> 54393 bytes .../.plugins/org.eclipse.jdt.core/2651294000.index | Bin 0 -> 9521 bytes .../.plugins/org.eclipse.jdt.core/2722331477.index | Bin 0 -> 6344 bytes .../.plugins/org.eclipse.jdt.core/2864048921.index | Bin 0 -> 25 bytes .../.plugins/org.eclipse.jdt.core/286606776.index | Bin 0 -> 98109 bytes .../.plugins/org.eclipse.jdt.core/2881167831.index | Bin 0 -> 14280 bytes .../.plugins/org.eclipse.jdt.core/2884189329.index | Bin 0 -> 116859 bytes .../.plugins/org.eclipse.jdt.core/292378129.index | Bin 0 -> 25 bytes .../.plugins/org.eclipse.jdt.core/3113700871.index | Bin 0 -> 3616292 bytes .../.plugins/org.eclipse.jdt.core/3128574298.index | Bin 0 -> 104842 bytes .../.plugins/org.eclipse.jdt.core/3136311497.index | Bin 0 -> 3010 bytes .../.plugins/org.eclipse.jdt.core/3140820942.index | Bin 0 -> 29837 bytes .../.plugins/org.eclipse.jdt.core/3156511736.index | Bin 0 -> 6526 bytes .../.plugins/org.eclipse.jdt.core/3299643186.index | Bin 0 -> 146305 bytes .../.plugins/org.eclipse.jdt.core/3305494902.index | Bin 0 -> 760195 bytes .../.plugins/org.eclipse.jdt.core/3318142213.index | Bin 0 -> 273324 bytes .../.plugins/org.eclipse.jdt.core/3340730395.index | Bin 0 -> 104842 bytes .../.plugins/org.eclipse.jdt.core/3498421256.index | Bin 0 -> 25 bytes .../.plugins/org.eclipse.jdt.core/3565748907.index | Bin 0 -> 137726 bytes .../.plugins/org.eclipse.jdt.core/3567615882.index | Bin 0 -> 67362 bytes .../.plugins/org.eclipse.jdt.core/3574260035.index | Bin 0 -> 219176 bytes .../.plugins/org.eclipse.jdt.core/3589703992.index | Bin 0 -> 25 bytes .../.plugins/org.eclipse.jdt.core/3604851502.index | Bin 0 -> 1434316 bytes .../.plugins/org.eclipse.jdt.core/3631395337.index | Bin 0 -> 25 bytes .../.plugins/org.eclipse.jdt.core/3640198305.index | Bin 0 -> 272191 bytes .../.plugins/org.eclipse.jdt.core/3843255497.index | Bin 0 -> 1416120 bytes .../.plugins/org.eclipse.jdt.core/3906489835.index | Bin 0 -> 39925 bytes .../.plugins/org.eclipse.jdt.core/3926268792.index | Bin 0 -> 28468 bytes .../.plugins/org.eclipse.jdt.core/3950275383.index | Bin 0 -> 170881 bytes .../.plugins/org.eclipse.jdt.core/4106476167.index | Bin 0 -> 7352 bytes .../.plugins/org.eclipse.jdt.core/4137555767.index | Bin 0 -> 12452 bytes .../.plugins/org.eclipse.jdt.core/4217051397.index | Bin 0 -> 753677 bytes .../.plugins/org.eclipse.jdt.core/4219528247.index | Bin 0 -> 47119 bytes .../.plugins/org.eclipse.jdt.core/4224004643.index | Bin 0 -> 587835 bytes .../.plugins/org.eclipse.jdt.core/4257325822.index | Bin 0 -> 6784 bytes .../.plugins/org.eclipse.jdt.core/4263599826.index | Bin 0 -> 81014 bytes .../.plugins/org.eclipse.jdt.core/4288041202.index | Bin 0 -> 134833 bytes .../.plugins/org.eclipse.jdt.core/473306299.index | Bin 0 -> 57664 bytes .../.plugins/org.eclipse.jdt.core/512031428.index | Bin 0 -> 159109 bytes .../.plugins/org.eclipse.jdt.core/542699870.index | Bin 0 -> 27409 bytes .../.plugins/org.eclipse.jdt.core/573497671.index | Bin 0 -> 31974 bytes .../.plugins/org.eclipse.jdt.core/702867120.index | Bin 0 -> 45826 bytes .../.plugins/org.eclipse.jdt.core/752465932.index | Bin 0 -> 25 bytes .../.plugins/org.eclipse.jdt.core/785918974.index | Bin 0 -> 25 bytes .../.plugins/org.eclipse.jdt.core/904948993.index | Bin 0 -> 25 bytes .../org.eclipse.jdt.core/assumedExternalFilesCache | Bin 0 -> 4 bytes .../org.eclipse.jdt.core/externalFilesCache | Bin 0 -> 15976 bytes .../org.eclipse.jdt.core/externalLibsTimeStamps | Bin 0 -> 10225 bytes .../org.eclipse.jdt.core/indexNamesMap.txt | 1 + .../org.eclipse.jdt.core/invalidArchivesCache | Bin 0 -> 4 bytes .../org.eclipse.jdt.core/javaLikeNames.txt | 1 + .../org.eclipse.jdt.core/nonChainingJarsCache | Bin 0 -> 8944 bytes .../org.eclipse.jdt.core/savedIndexNames.txt | 74 + .../variablesAndContainers.dat | Bin 0 -> 1692 bytes .../org.eclipse.jdt.debug.ui/dialog_settings.xml | 24 + .../org.eclipse.jdt.launching/.install.xml | 5 + .../org.eclipse.jdt.launching/libraryInfos.xml | 41 + .../org.eclipse.jdt.ui/OpenTypeHistory.xml | 2 + .../QualifiedTypeNameHistory.xml | 63 + .../org.eclipse.jdt.ui/dialog_settings.xml | 201 + .../.workspace/2015/3/10/refactorings.history | 4 + .../.workspace/2015/3/10/refactorings.index | 1 + .../Minecraft/2014/12/1/refactorings.history | 3 + .../Minecraft/2014/12/1/refactorings.index | 3 + .../Minecraft/2014/12/51/refactorings.history | 4 + .../Minecraft/2014/12/51/refactorings.index | 1 + .../Minecraft/2014/12/52/refactorings.history | 3 + .../Minecraft/2014/12/52/refactorings.index | 4 + .../Minecraft/2015/1/1/refactorings.history | 4 + .../Minecraft/2015/1/1/refactorings.index | 1 + .../Minecraft/2015/1/4/refactorings.history | 3 + .../Minecraft/2015/1/4/refactorings.index | 4 + .../Minecraft/2015/1/5/refactorings.history | 3 + .../Minecraft/2015/1/5/refactorings.index | 21 + .../Minecraft/2015/2/6/refactorings.history | 3 + .../Minecraft/2015/2/6/refactorings.index | 10 + .../Minecraft/2015/2/7/refactorings.history | 3 + .../Minecraft/2015/2/7/refactorings.index | 10 + .../Minecraft/2015/2/8/refactorings.history | 4 + .../Minecraft/2015/2/8/refactorings.index | 1 + .../Minecraft/2015/3/10/refactorings.history | 4 + .../Minecraft/2015/3/10/refactorings.index | 1 + .../Minecraft/2015/3/12/refactorings.history | 3 + .../Minecraft/2015/3/12/refactorings.index | 2 + .../dialog_settings.xml | 25 + .../nexus/26522e0d83a422eed93329ece7565cfc/_0.cfs | Bin 0 -> 297 bytes .../26522e0d83a422eed93329ece7565cfc/_0_1.del | Bin 0 -> 9 bytes .../nexus/26522e0d83a422eed93329ece7565cfc/_1.cfs | Bin 0 -> 297 bytes .../26522e0d83a422eed93329ece7565cfc/segments.gen | Bin 0 -> 20 bytes .../26522e0d83a422eed93329ece7565cfc/segments_3 | Bin 0 -> 88 bytes .../26522e0d83a422eed93329ece7565cfc/write.lock | 0 .../nexus/830bc118332e77292949ed1e6d2fabe0/_0.cfs | Bin 0 -> 274 bytes .../830bc118332e77292949ed1e6d2fabe0/_0_1.del | Bin 0 -> 9 bytes .../nexus/830bc118332e77292949ed1e6d2fabe0/_1.cfs | Bin 0 -> 274 bytes .../830bc118332e77292949ed1e6d2fabe0/segments.gen | Bin 0 -> 20 bytes .../830bc118332e77292949ed1e6d2fabe0/segments_3 | Bin 0 -> 88 bytes .../830bc118332e77292949ed1e6d2fabe0/write.lock | 0 .../nexus/c0b74ee5743f12e1740af8eef8e8bda1/_0.cfs | Bin 0 -> 297 bytes .../c0b74ee5743f12e1740af8eef8e8bda1/_0_1.del | Bin 0 -> 9 bytes .../nexus/c0b74ee5743f12e1740af8eef8e8bda1/_1.cfs | Bin 0 -> 297 bytes .../c0b74ee5743f12e1740af8eef8e8bda1/segments.gen | Bin 0 -> 20 bytes .../c0b74ee5743f12e1740af8eef8e8bda1/segments_3 | Bin 0 -> 88 bytes .../c0b74ee5743f12e1740af8eef8e8bda1/write.lock | 0 .../org.eclipse.m2e.core/workspaceState.ser | Bin 0 -> 545 bytes .../org.eclipse.m2e.logback.configuration/0.log | 97 + .../logback.1.5.0.20140606-0033.xml | 43 + .../repositoryConfigurations | Bin 0 -> 303650 bytes .../dialog_settings.xml | 5 + .../org.eclipse.mylyn.tasks.ui/dialog_settings.xml | 5 + .../.cache/clean-cache.properties | 2 + .../org.eclipse.search/dialog_settings.xml | 169 + .../org.eclipse.ui.editors/dialog_settings.xml | 5 + .../org.eclipse.ui.ide/dialog_settings.xml | 11 + .../dialog_settings.xml | 38 + .../org.eclipse.ui.workbench/dialog_settings.xml | 19 + .../org.eclipse.ui.workbench/workingsets.xml | 4 + .../variablesAndContainers.dat | Bin 0 -> 12 bytes .../org.eclipse.wst.sse.core/task-tags.properties | 3 + .../org.eclipse.wst.xml.ui/dialog_settings.xml | 5 + eclipse/.metadata/version.ini | 3 + 635 files changed, 101208 insertions(+) create mode 100644 eclipse/.metadata/.bak_0.log create mode 100644 eclipse/.metadata/.lock create mode 100644 eclipse/.metadata/.log create mode 100644 eclipse/.metadata/.mylyn/.taskListIndex/segments.gen create mode 100644 eclipse/.metadata/.mylyn/.taskListIndex/segments_1 create mode 100644 eclipse/.metadata/.mylyn/.tasks.xml.zip create mode 100644 eclipse/.metadata/.mylyn/repositories.xml.zip create mode 100644 eclipse/.metadata/.mylyn/tasks.xml.zip create mode 100644 eclipse/.metadata/.plugins/net.sf.jautodoc/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/00f44bf8f2cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/60ca70f3b9d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/90d037febbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/c03acc5982d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/50aa0d289bd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/70a57e40e75300141786a2891bfc8d75 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/908f5c3bb4d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/70a157f022cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/a058ee18bcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/b0d74dd670cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/3014ba2224cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/70793b297ecf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/f0b8342df3cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/40b7127a9cd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/70a655ecbdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/208e063bf5cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/807d1568bed000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/f07260f599d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/10a8250bf2cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/304ae31aa0ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/00b1e982a0ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/e0daccca6fcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/20cffe1816cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/804b704ea7ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/e064279b24cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/709a7da620cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/80c96a3f6fcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/906f9d59f3cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/90210400bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/400e338dbcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/50c220fcb9d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/408dbb6524cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/e06abfb6f6cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/10ad6571bed000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/6035720f6fcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/60b18a49bdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/60f0dd6d12cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/f08a3fedf1cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/40b2f4a3b8d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/801b0ce922cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/905604776fcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/10f40556bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/60dda1c0bcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/a01e32b5bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/5054a9ea70cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/90616b3e85d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/b02c9da3a5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/30dc218d2f9300141384bdd0ca2744d8 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/2069bbfabdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/a09c5791f6cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/0057e48384c600141066cb38d875561a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/0075f9bc9fd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/702e06909bd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/b0fd61c916cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/90ac8e2b9fce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/3016ca8fa3d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/90f98826b0d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/902846c39fd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/4099cacb16cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/7026f2daf4cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/90e1eeeff3cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/009ecb1ebbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/10854bde6e5f00141b03e33c57c1f917 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/10340d2ef2cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/e00a4c70e75300141786a2891bfc8d75 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/00ec9292a7ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/50cdc566f48a00141c1cba3f7039360c create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/c0e606a470cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/9026020ff48a00141c1cba3f7039360c create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/9032f899b7d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/a0809e1223cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/10568ea1b7d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/a0c4fa6984d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/002a7b0fb7d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/10dc7459bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/606c08157ecf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/7064faac7dcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/10890341bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/3024e21485d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/503ff62fb6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/60160ac99ad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/90a539afbbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/0091dffeb5d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/30f66b0413cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/5019b6d220cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/7005297f22cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/808884ea13cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/30afb93df48a00141c1cba3f7039360c create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/50b62efab9d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/6048b993bcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/c022d38cf2cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/e0ed63d312cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/003ee58eafd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/c02871fbb6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/b0889c1bbcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/c080ae01bcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/20200c94b8d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/70f7cff5b6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/50241a6d84c600141066cb38d875561a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/d0a17b8f13cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/90a975eca4ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/104eb856f48a00141c1cba3f7039360c create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/7051d7cf22cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/20293dcd23cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/f0362027f4cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/2066f1c9bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/707c7127bed000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/4009975e82d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/6016724bbad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/9089738c21cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/20a0a61c84d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/20bea20c21cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/405c7f377ecf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/90de45a1bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/a055ddd2bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/d0c27ea5f6cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/1031dd2dbbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/70c9f176f2cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/f08f115612cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/50025dc484c600141066cb38d875561a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/b0576841f2cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/007bc83ab6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/402d4daebcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/e0d9514683d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/f00c439cb7d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/10b548dabad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/70986997b7d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/c0326ecba5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/e06a0851bdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/90cafa5d14cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/8048f9edb6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/a09b425fbbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/90504c0bbbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/a0087dd116cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/20ddfa7621cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/a04f0c50a4ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/c08394fe40cf001411138789b9e67617 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/e0aa469384d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/1044992a23cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/1048515cbbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/b085ddbd9ad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c07baaa5bcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/e0e84e2dbdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/80f31216bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b0474f9184d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b0a71b6116cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10e245fff3cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/d08f32069cd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/f0e98566a7ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/00fa2de0a6ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/50723f9b2f9300141384bdd0ca2744d8 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/f0abea277dcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30d8062da0ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30e8b2dea5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/50b15c9812cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/60bc25dabdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/d0a52e0212cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/601a6034bcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/c0d85da8b8d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/d052a15084c600141066cb38d875561a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/50774f8f84c600141066cb38d875561a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/2069867dbbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/30a210a5bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/f0beebb39ad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/60d2e4cf84c600141066cb38d875561a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/60dd45d1a5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/e00f48f3bdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/e0b3878d7dcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/30a5d74a2f9300141384bdd0ca2744d8 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/50a406e982d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/905e928db7d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/603844c615cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/60ae11e56e5f00141b03e33c57c1f917 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/80ef4046bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/9039e7ea21cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/b0813d41f3cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/f0427c9d2f9300141384bdd0ca2744d8 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/00b782eca6ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/f05ddeeb99d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/30a1d335b4d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/4034bfb970cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/50b952462f9300141384bdd0ca2744d8 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/c0058039a3ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/102be67fbbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/20760f8dbbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/d012947f9fce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/b08cd803bcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/f0b063e3a3ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/105eef10f4cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/90e15befbdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/d09c58ed23cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/408fefd316cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/5022fbd5b9d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/e09f38179cd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/60317a00bad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/00e8ece9b6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/a00659a981d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/b01f1983b4d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/c0b3c7e9e65300141786a2891bfc8d75 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/f07bc4852f9300141384bdd0ca2744d8 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/10c2166623cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/20c0a81e70cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/b0ea8d2c7ccf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/9098c35323cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/f099510ebed000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/f0dc16e6bad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/d08754d5a5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/a02cf81bf48a00141c1cba3f7039360c create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/408bce2c7ecf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/80a2ccf2b6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/c00b3a4e14cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/0063cb09a4ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/50b82d4b23cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/90811e76bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/d016443bbad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e0cadf43f3cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/00b736a77dcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/c0c31c6bf2cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/e05bccf47ecf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/60685a7322cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/b04fbcf8bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/406867c2a5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e0c8a1d614cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/a027f35412cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/a05c8663b7d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/c023ecaca5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/20a25d63bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/20ce4e77a0ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/8013b6e1bdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/902f5c8116cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/407ff7ab81d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/0090d02f23cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/108b25f9b6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/902740e1bad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/d084e8b4f2cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/1058a217f5cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/708b72abbbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/109be73121cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/20884d44b4d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/602f81f1b9d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/704de242b6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/902c91fbf5cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/90e4273eb4d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/b0804ec7bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/00916edebad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/40989e4e2f9300141384bdd0ca2744d8 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/7094473ba5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/0012daebb6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/5027d4627dcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/309bb5e59bd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/5050fcc811cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/101de9f4bad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/808d7bfff2cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/20fefcf5f6cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/30e2d9ce70cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/50e131a6a5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/e0a4fd13b7d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/b08e70da15cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/40075a7e83d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/a07e323e82d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/e0dd554e24cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/009246eabcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/106b3f3e7ecf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/20478b38b4d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/20c9f6e114cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/20d9a4a46eae0014128c87a7399fc341 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/00a993b822cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/10a3c349bad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/50356899bcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/90065c70f48a00141c1cba3f7039360c create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/c0592c612f9300141384bdd0ca2744d8 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/90d73160f48a00141c1cba3f7039360c create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/f0aba030bdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/70560814bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/900b847d70cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/b0489a1082d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/80a5a26aa4ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/b0b5ffe4bcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/c0b377522f9300141384bdd0ca2744d8 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/609c1e85a3d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/908c46b1bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/104e81bcbbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/5091d7a47dcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/b0e9a94b82d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/702aada322cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/d0cb2f4b7ecf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/00c84d88bed000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/30b09a9679cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/6017c8e9b5d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/50048858e65300141786a2891bfc8d75 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/50346c7da0ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/70b9cd197acf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/400a697183d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/901e9340bcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0ba0cecf2cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0ca0d9da5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/b04e0c6083d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/f079b2e06fcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/805eed72bed000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/00a0532bbbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/60e65c7684c600141066cb38d875561a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/106fae7312cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/306a41c76fcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/606b4ad414cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/60a49035e75300141786a2891bfc8d75 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/506e1ce570cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/b04a00579cd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/b0804930bcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/f0e12b0e9cd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/10f70a8cbed000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e03e7349a6ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e0b1d7d7b6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/309ab103b0d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/c0efc084a5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/d024d91417cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/20f3e540b4d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/601f11c4f38a00141c1cba3f7039360c create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/8033e6be23cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/60c1a1249fce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/d05049b984c600141066cb38d875561a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/f0b55b69bad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/70917207bed000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/10212e1abbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/4032699bb8d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/f01d11859ad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/f0af8c117acf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40367889a5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/b048e39fb8d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/7013ae1e85d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/e0433f2d7dcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/10dc615fbed000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/70f09d1c7acf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/802694e3b6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/d0ba6178bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/0088d4467ecf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/10b07e76a4ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/f0711f27a7ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/509abef6f38a00141c1cba3f7039360c create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/f037376012cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/c0eb4d77b9d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/10c08f90b7d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/600bf435bdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/80d5ff84bed000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/b0a79825a3ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/70b3113c6fcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/802d6c7d12cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/e02d96277ecf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/20ce60e681d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/406be580bed000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/306fef1113cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/c001ded384d000141a1fb02abca5ff55 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/40e36e70b9d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/80bf6f449bd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/c054e7fab5d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/60ad6fa0bcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/d07706722f9300141384bdd0ca2744d8 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/d0b060aabcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/303797fd70cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/a098cba6bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/8057ba46b6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f0ef569c3fcf001411138789b9e67617 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/40e71d74a5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/10f9057570cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/20879a0e7ccf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/30ea349dbbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/80e1e997f2cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/80c6ef06b6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/7040acbf14cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/007d82c399d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/307fa52624cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/4010cd0b71cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/d0e62fdca5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/a0630cfe22cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/c04fd795a3d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/50b3265a70cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/600fcefeb6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/3080ffd383c600141066cb38d875561a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/7006558fa4ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/d02f62a6b8d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/104b1fe0b6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/20010f43a5ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/103c252f6a8700141aabd4ca4d39309b create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/20d3910bbdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/e0847d256fcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/508104ffb9d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/90284a44bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/d0e63671bcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/90de6b157dcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/d0c544f1bdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/208abec412cf00141c41f52413db5e31 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/10a6e789b7d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f08cc33785c600141066cb38d875561a create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f0d537e7bdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/70f21455bdd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/f043f225a4ce00141801ff0972626827 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/00fc7df4b6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/1004bc969bd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/20259783bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/e09bcee7b6d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/9037e8d8f2cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/c04a3dbcbcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/7014dc552f9300141384bdd0ca2744d8 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/80d09401b7d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/10660ab09ad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/106b4a6bf48a00141c1cba3f7039360c create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/9082ae46b4d000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/f00bc4107ecf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/10304e6cbcd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/30327f097dcf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/80f0e254bed000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/602b84f79bd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/9020325670cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/906294ac70cf00141de78e4a85bb2469 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/00facaebbad000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/a0e56af6bbd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/40a89923f4cf0014170de422db399e8d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/a0f1a1f6afd000141b65e2fc7f94332d create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.location create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.markers.snap create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.syncinfo.snap create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/13/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/2/history.index create 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/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/7f/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/8d/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/e7/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/fe/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/history.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.location create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers.snap create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.syncinfo.snap create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/org.eclipse.jdt.core/state.dat create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/36.tree create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.resources/36.snap create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/net.sf.jautodoc.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.net.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.core.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.epp.usagedata.gathering.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jst.j2ee.webservice.ui.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.java.ui.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.recommenders.completion.rcp.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.search.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.browser.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.sse.core.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.ws.service.policy.prefs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Client.launch create mode 100644 eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/ClientNoLogin.launch create mode 100644 eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Server.launch create mode 100644 eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi create mode 100644 eclipse/.metadata/.plugins/org.eclipse.egit.ui/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.equinox.p2.ui/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/.org.eclipse.jdt.core.external.folders/.project create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1007111076.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1112183641.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1140841982.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/122877426.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1349318312.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1396595163.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1405940092.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1421139610.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1501172594.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1532915402.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1560443425.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1701803245.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1819133815.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1830251659.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1846500785.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1921212175.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1964534855.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/1977427294.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/20746801.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2084239533.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2084554879.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2208772637.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2258076031.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2306963099.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2373544449.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2485927450.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2531317059.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2540715342.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2619072759.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2651294000.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2722331477.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2864048921.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/286606776.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2881167831.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/2884189329.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/292378129.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3113700871.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3128574298.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3136311497.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3140820942.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3156511736.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3299643186.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3305494902.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3318142213.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3340730395.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3498421256.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3565748907.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3567615882.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3574260035.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3589703992.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3604851502.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3631395337.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3640198305.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3843255497.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3906489835.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3926268792.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/3950275383.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/4106476167.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/4137555767.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/4217051397.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/4219528247.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/4224004643.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/4257325822.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/4263599826.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/4288041202.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/473306299.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/512031428.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/542699870.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/573497671.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/702867120.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/752465932.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/785918974.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/904948993.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/invalidArchivesCache create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.debug.ui/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2015/3/10/refactorings.history create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2015/3/10/refactorings.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/1/refactorings.history create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/1/refactorings.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/51/refactorings.history create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/51/refactorings.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/52/refactorings.history create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/52/refactorings.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/1/refactorings.history create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/1/refactorings.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/4/refactorings.history create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/4/refactorings.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/5/refactorings.history create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/5/refactorings.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/6/refactorings.history create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/6/refactorings.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/7/refactorings.history create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/7/refactorings.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/8/refactorings.history create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/8/refactorings.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/10/refactorings.history create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/10/refactorings.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/12/refactorings.history create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/12/refactorings.index create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ltk.ui.refactoring/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/_0.cfs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/_0_1.del create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/_1.cfs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/segments.gen create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/segments_3 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/write.lock create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_0.cfs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_0_1.del create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_1.cfs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments.gen create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments_3 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/write.lock create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/_0.cfs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/_0_1.del create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/_1.cfs create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/segments.gen create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/segments_3 create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/write.lock create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.core/workspaceState.ser create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log create mode 100644 eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.5.0.20140606-0033.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.mylyn.bugzilla.core/repositoryConfigurations create mode 100644 eclipse/.metadata/.plugins/org.eclipse.mylyn.bugzilla.ui/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.mylyn.tasks.ui/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties create mode 100644 eclipse/.metadata/.plugins/org.eclipse.search/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ui.editors/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ui.workbench.texteditor/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml create mode 100644 eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/variablesAndContainers.dat create mode 100644 eclipse/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties create mode 100644 eclipse/.metadata/.plugins/org.eclipse.wst.xml.ui/dialog_settings.xml create mode 100644 eclipse/.metadata/version.ini (limited to 'eclipse/.metadata') diff --git a/eclipse/.metadata/.bak_0.log b/eclipse/.metadata/.bak_0.log new file mode 100644 index 0000000..e5952ad --- /dev/null +++ b/eclipse/.metadata/.bak_0.log @@ -0,0 +1,13382 @@ +!SESSION 2014-07-29 12:52:28.128 ----------------------------------------------- +eclipse.buildId=M20120914-1800 +java.version=1.7.0_51 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.jee.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-07-29 12:52:34.750 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. +!SESSION 2014-08-05 14:57:38.340 ----------------------------------------------- +eclipse.buildId=M20120914-1800 +java.version=1.7.0_65 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.jee.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-08-05 14:57:45.623 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. +!SESSION 2014-10-14 23:34:58.119 ----------------------------------------------- +eclipse.buildId=M20120914-1800 +java.version=1.7.0_65 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.jee.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-10-14 23:35:01.539 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. +!SESSION 2014-10-22 03:18:42.002 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-10-22 03:22:34.986 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-10-22 03:22:38.294 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.jface 4 0 2014-10-22 03:22:57.617 +!MESSAGE Unable to resolve plug-in "platform:/plugin/org.eclipse.wst.server.ui/icons/cview16/servers_view.gif". +!STACK 0 +java.io.IOException: Unable to resolve plug-in "platform:/plugin/org.eclipse.wst.server.ui/icons/cview16/servers_view.gif". + at org.eclipse.core.internal.runtime.PlatformURLPluginConnection.parse(PlatformURLPluginConnection.java:64) + at org.eclipse.core.internal.runtime.PlatformURLPluginConnection.resolve(PlatformURLPluginConnection.java:75) + at org.eclipse.core.internal.boot.PlatformURLHandler.openConnection(PlatformURLHandler.java:67) + at org.eclipse.osgi.internal.url.URLStreamHandlerProxy.openConnection(URLStreamHandlerProxy.java:114) + at java.net.URL.openConnection(Unknown Source) + at org.eclipse.core.internal.runtime.PlatformURLConverter.toFileURL(PlatformURLConverter.java:33) + at org.eclipse.core.runtime.FileLocator.toFileURL(FileLocator.java:206) + at org.eclipse.jface.resource.URLImageDescriptor.getFilePath(URLImageDescriptor.java:141) + at org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:162) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:230) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:208) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.getImageFromURI(SWTPartRenderer.java:221) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.getImage(SWTPartRenderer.java:233) + at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.createTab(StackRenderer.java:828) + at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.processContents(LazyStackRenderer.java:136) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:68) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:185) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:68) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:185) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:68) + at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(PerspectiveRenderer.java:49) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:103) + at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:100) + at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:77) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:678) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:68) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:185) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:68) + at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:664) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1078) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.jface 4 0 2014-10-22 03:22:57.849 +!MESSAGE Unable to resolve plug-in "platform:/plugin/org.eclipse.datatools.connectivity.ui.dse/icons/full/cview16/enterprise_explorer.gif". +!STACK 0 +java.io.IOException: Unable to resolve plug-in "platform:/plugin/org.eclipse.datatools.connectivity.ui.dse/icons/full/cview16/enterprise_explorer.gif". + at org.eclipse.core.internal.runtime.PlatformURLPluginConnection.parse(PlatformURLPluginConnection.java:64) + at org.eclipse.core.internal.runtime.PlatformURLPluginConnection.resolve(PlatformURLPluginConnection.java:75) + at org.eclipse.core.internal.boot.PlatformURLHandler.openConnection(PlatformURLHandler.java:67) + at org.eclipse.osgi.internal.url.URLStreamHandlerProxy.openConnection(URLStreamHandlerProxy.java:114) + at java.net.URL.openConnection(Unknown Source) + at org.eclipse.core.internal.runtime.PlatformURLConverter.toFileURL(PlatformURLConverter.java:33) + at org.eclipse.core.runtime.FileLocator.toFileURL(FileLocator.java:206) + at org.eclipse.jface.resource.URLImageDescriptor.getFilePath(URLImageDescriptor.java:141) + at org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:162) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:230) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:208) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.getImageFromURI(SWTPartRenderer.java:221) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.getImage(SWTPartRenderer.java:233) + at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.createTab(StackRenderer.java:828) + at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.processContents(LazyStackRenderer.java:136) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:68) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:185) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:68) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:185) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:68) + at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(PerspectiveRenderer.java:49) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:103) + at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:100) + at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:77) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:678) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:68) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:185) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:68) + at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:664) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1078) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.egit.ui 2 0 2014-10-22 03:23:00.319 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2014-10-22 03:23:00.429 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.jface 2 0 2014-10-22 03:23:05.616 +!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. +!SUBENTRY 1 org.eclipse.jface 2 0 2014-10-22 03:23:05.616 +!MESSAGE A conflict occurred for ALT+SHIFT+ARROW_DOWN: +Binding(ALT+SHIFT+ARROW_DOWN, + ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.select.last,Restore Last Selection, + Restore last selection, + Category(org.eclipse.ui.category.edit,Edit,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@444720b7, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.jdt.ui.javaEditorScope,,,system) +Binding(ALT+SHIFT+ARROW_DOWN, + ParameterizedCommand(Command(org.eclipse.mylyn.tasks.ui.command.markTaskReadGoToNextUnread,Mark Task Read and Go To Next Unread Task, + , + Category(org.eclipse.mylyn.tasks.ui.commands,Task Repositories,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@529fda9f, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.mylyn.tasks.ui.views.tasks,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2014-10-22 03:23:05.617 +!MESSAGE A conflict occurred for ALT+ARROW_DOWN: +Binding(ALT+ARROW_DOWN, + ParameterizedCommand(Command(org.eclipse.mylyn.tasks.ui.command.goToNextUnread,Go To Next Unread Task, + , + Category(org.eclipse.ui.category.navigate,Navigate,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@1c8e2850, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.mylyn.tasks.ui.views.tasks,,,system) +Binding(ALT+ARROW_DOWN, + ParameterizedCommand(Command(org.eclipse.ui.edit.text.moveLineDown,Move Lines Down, + Moves the selected lines down, + Category(org.eclipse.ui.category.textEditor,Text Editing,Text Editing Commands,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@2b8f5aa4, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.textEditorScope,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2014-10-22 03:23:05.617 +!MESSAGE A conflict occurred for ALT+SHIFT+ARROW_UP: +Binding(ALT+SHIFT+ARROW_UP, + ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.select.enclosing,Select Enclosing Element, + Expand selection to include enclosing element, + Category(org.eclipse.ui.category.edit,Edit,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@7d0e46dd, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.jdt.ui.javaEditorScope,,,system) +Binding(ALT+SHIFT+ARROW_UP, + ParameterizedCommand(Command(org.eclipse.mylyn.tasks.ui.command.markTaskReadGoToPreviousUnread,Mark Task Read and Go To Previous Unread Task, + , + Category(org.eclipse.mylyn.tasks.ui.commands,Task Repositories,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@318353, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.mylyn.tasks.ui.views.tasks,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2014-10-22 03:23:05.617 +!MESSAGE A conflict occurred for INSERT: +Binding(INSERT, + ParameterizedCommand(Command(org.eclipse.mylyn.tasks.ui.command.new.local.task,New Local Task, + , + Category(org.eclipse.mylyn.tasks.ui.commands,Task Repositories,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@2cd6fae8, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.mylyn.tasks.ui.views.tasks,,,system) +Binding(INSERT, + ParameterizedCommand(Command(org.eclipse.ui.edit.text.toggleOverwrite,Toggle Overwrite, + Toggle overwrite mode, + Category(org.eclipse.ui.category.textEditor,Text Editing,Text Editing Commands,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@7d5ddfac, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.textEditorScope,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2014-10-22 03:23:05.617 +!MESSAGE A conflict occurred for ALT+SHIFT+U: +Binding(ALT+SHIFT+U, + ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.remove.occurrence.annotations,Remove Occurrence Annotations, + Removes the occurrence annotations from the current editor, + Category(org.eclipse.jdt.ui.category.source,Source,Java Source Actions,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@72ea5674, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.jdt.ui.javaEditorScope,,,system) +Binding(ALT+SHIFT+U, + ParameterizedCommand(Command(org.eclipse.mylyn.tasks.ui.command.markTaskUnread,Mark Task Unread, + , + Category(org.eclipse.mylyn.tasks.ui.commands,Task Repositories,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@7ecd6861, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.mylyn.tasks.ui.views.tasks,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2014-10-22 03:23:05.617 +!MESSAGE A conflict occurred for ALT+ARROW_UP: +Binding(ALT+ARROW_UP, + ParameterizedCommand(Command(org.eclipse.mylyn.tasks.ui.command.goToPreviousUnread,Go To Previous Unread Task, + , + Category(org.eclipse.ui.category.navigate,Navigate,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5f82209e, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.mylyn.tasks.ui.views.tasks,,,system) +Binding(ALT+ARROW_UP, + ParameterizedCommand(Command(org.eclipse.ui.edit.text.moveLineUp,Move Lines Up, + Moves the selected lines up, + Category(org.eclipse.ui.category.textEditor,Text Editing,Text Editing Commands,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6557dcea, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.textEditorScope,,,system) + +!ENTRY org.eclipse.core.jobs 2 2 2014-10-22 03:28:32.294 +!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.core.internal.refresh.RefreshJob +!SESSION 2014-10-29 11:24:02.114 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-10-29 11:25:49.290 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-10-29 11:25:51.247 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-10-29 11:26:14.592 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2014-10-29 11:26:14.712 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2014-10-29 12:50:03.707 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-10-29 12:50:23.357 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-10-29 12:50:25.625 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-10-29 12:51:33.555 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2014-10-29 12:51:33.608 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2014-10-29 13:33:24.427 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-10-29 13:35:09.620 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-10-29 13:35:11.809 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-10-29 13:35:36.458 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2014-10-29 13:35:36.531 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.search 4 0 2014-10-29 13:49:18.675 +!MESSAGE Problems encountered during text search. +!SUBENTRY 1 org.eclipse.search 4 4 2014-10-29 13:49:18.675 +!MESSAGE File 'Minecraft/eclipse/.recommenders/index/http___download_eclipse_org_recommenders_models_luna_/write.lock' has been skipped, problem while reading: ('The process cannot access the file because another process has locked a portion of the file'). +!STACK 0 +java.io.IOException: The process cannot access the file because another process has locked a portion of the file + at java.io.FileInputStream.readBytes(Native Method) + at java.io.FileInputStream.read(Unknown Source) + at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) + at sun.nio.cs.StreamDecoder.implRead(Unknown Source) + at sun.nio.cs.StreamDecoder.read(Unknown Source) + at java.io.InputStreamReader.read(Unknown Source) + at java.io.Reader.read(Unknown Source) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$Buffer.fill(FileCharSequenceProvider.java:172) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.fillBuffer(FileCharSequenceProvider.java:385) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.getBuffer(FileCharSequenceProvider.java:358) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.charAt(FileCharSequenceProvider.java:414) + at org.eclipse.search.internal.core.text.TextSearchVisitor.hasBinaryContent(TextSearchVisitor.java:320) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFile(TextSearchVisitor.java:261) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFiles(TextSearchVisitor.java:196) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:172) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:184) + at org.eclipse.search.core.text.TextSearchEngine$1.search(TextSearchEngine.java:56) + at org.eclipse.search.internal.ui.text.FileSearchQuery.run(FileSearchQuery.java:190) + at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 1 org.eclipse.search 4 4 2014-10-29 13:49:18.675 +!MESSAGE File 'Minecraft/eclipse/.metadata/.lock' has been skipped, problem while reading: ('The process cannot access the file because another process has locked a portion of the file'). +!STACK 0 +java.io.IOException: The process cannot access the file because another process has locked a portion of the file + at java.io.FileInputStream.readBytes(Native Method) + at java.io.FileInputStream.read(Unknown Source) + at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) + at sun.nio.cs.StreamDecoder.implRead(Unknown Source) + at sun.nio.cs.StreamDecoder.read(Unknown Source) + at java.io.InputStreamReader.read(Unknown Source) + at java.io.Reader.read(Unknown Source) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$Buffer.fill(FileCharSequenceProvider.java:172) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.fillBuffer(FileCharSequenceProvider.java:385) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.getBuffer(FileCharSequenceProvider.java:358) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.charAt(FileCharSequenceProvider.java:414) + at org.eclipse.search.internal.core.text.TextSearchVisitor.hasBinaryContent(TextSearchVisitor.java:320) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFile(TextSearchVisitor.java:261) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFiles(TextSearchVisitor.java:196) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:172) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:184) + at org.eclipse.search.core.text.TextSearchEngine$1.search(TextSearchEngine.java:56) + at org.eclipse.search.internal.ui.text.FileSearchQuery.run(FileSearchQuery.java:190) + at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.core.resources 4 566 2014-10-29 15:53:27.757 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2014-10-29 15:53:27.796 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/tmp/recompSrc/net/minecraft]) +!SESSION 2014-10-31 01:06:37.569 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-10-31 01:06:51.709 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-10-31 01:06:53.521 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-10-31 01:07:14.825 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2014-10-31 01:07:14.860 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.jobs 2 2 2014-10-31 01:31:37.431 +!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.core.internal.refresh.RefreshJob +!SESSION 2014-11-01 19:53:52.048 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-11-01 19:56:42.541 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-11-01 19:56:45.019 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-11-01 19:57:10.215 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2014-11-01 19:57:10.394 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2014-12-12 15:52:49.427 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-12-12 20:25:25.662 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-12-12 20:25:28.556 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-12-12 20:26:01.403 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2014-12-12 21:51:44.847 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2014-12-12 21:51:44.873 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/tmp/recompSrc/net/minecraft]) +!SESSION 2014-12-15 16:33:24.363 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-12-15 16:39:10.194 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-12-15 16:39:12.550 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-12-15 16:39:40.837 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2014-12-19 02:49:03.284 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-12-19 02:49:33.997 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-12-19 02:50:08.930 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-19 05:19:11.617 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-19 05:21:05.133 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2014-12-19 07:22:37.177 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.util.List;, sign:()[Ljava.util.List;, declKey:, key:, name:clone, replace:[1341,1341], token:[1341,1341], relevance:35}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-19 07:24:48.010 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2014-12-19 07:27:11.756 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.util.List;, sign:()[Ljava.util.List;, declKey:, key:, name:clone, replace:[10618,10618], token:[10618,10618], relevance:35}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) +!SESSION 2014-12-19 16:41:37.270 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-12-19 16:41:43.557 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-12-19 16:41:47.272 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-12-19 16:42:12.076 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2014-12-19 17:14:05.541 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-12-19 17:14:10.001 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-12-19 17:14:10.928 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-12-19 17:14:23.819 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2014-12-19 21:20:33.694 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-12-19 21:21:30.533 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-12-19 21:21:31.612 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-12-19 21:21:55.487 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2014-12-21 14:22:01.914 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-12-21 14:22:07.345 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-12-21 14:22:09.436 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-12-21 14:22:37.166 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-21 14:40:56.909 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-21 14:57:26.450 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-21 15:07:13.269 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.m2e.logback.appender 2 0 2014-12-21 15:52:58.455 +!MESSAGE Can't handle class org.eclipse.jdt.internal.compiler.ast.IfStatement as parent of completion location. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-21 16:11:46.766 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.core.resources 4 566 2014-12-21 18:59:33.558 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2014-12-21 18:59:33.599 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/tmp/expandedArchives/forgepatches.zip_37duqs0kpgsuok04j3co6c6lk9/net/minecraft/client]) +!SESSION 2014-12-22 04:11:03.160 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-12-22 04:12:12.597 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-12-22 04:12:13.915 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-12-22 04:12:40.947 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2014-12-22 17:08:31.170 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-12-22 17:08:36.901 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-12-22 17:08:38.163 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) +!SESSION 2014-12-22 23:10:59.317 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-12-22 23:11:15.242 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-12-22 23:11:16.548 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-12-22 23:11:44.723 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-23 13:19:47.694 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-23 13:19:47.694 +!MESSAGE Problem finding next change, code: 21 + +!ENTRY org.eclipse.core.resources 4 1 2014-12-23 13:19:50.956 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-23 13:19:50.956 +!MESSAGE Problem finding next change, code: 21 + +!ENTRY org.eclipse.core.resources 4 1 2014-12-23 13:19:54.248 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-23 13:19:54.249 +!MESSAGE Problem finding next change, code: 21 + +!ENTRY org.eclipse.core.resources 4 1 2014-12-23 17:26:55.088 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-23 17:26:55.088 +!MESSAGE Problem finding next change, code: 21 + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2014-12-23 22:31:26.627 +!MESSAGE Error setting focus to : org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl BlockList.java +!STACK 0 +org.eclipse.swt.SWTException: Widget is disposed + at org.eclipse.swt.SWT.error(SWT.java:4441) + at org.eclipse.swt.SWT.error(SWT.java:4356) + at org.eclipse.swt.SWT.error(SWT.java:4327) + at org.eclipse.swt.widgets.Widget.error(Widget.java:476) + at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:348) + at org.eclipse.swt.widgets.Control.setFocus(Control.java:3320) + at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1039) + at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1039) + at org.eclipse.ui.texteditor.StatusTextEditor.setFocus(StatusTextEditor.java:120) + at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.setFocus(JavaEditor.java:2389) + at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:191) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:253) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:225) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:107) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.focusGui(PartRenderingEngine.java:795) + at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$2.setFocus(ContributedPartRenderer.java:100) + at org.eclipse.swt.custom.CTabItem.setFocus(CTabItem.java:332) + at org.eclipse.swt.custom.CTabFolder.setFocus(CTabFolder.java:2555) + at org.eclipse.swt.widgets.Control.fixFocus(Control.java:1052) + at org.eclipse.swt.widgets.Control.setVisible(Control.java:3818) + at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3098) + at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3106) + at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1794) + at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:283) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-23 22:33:28.741 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) +!SESSION 2014-12-25 23:57:26.811 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-12-25 23:57:47.306 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-12-25 23:57:49.539 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-12-25 23:58:13.908 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-26 01:25:17.211 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-26 01:38:49.080 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) +!SESSION 2014-12-27 02:17:26.566 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-12-27 02:18:15.092 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-12-27 02:18:16.873 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-12-27 02:18:44.943 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-27 03:55:06.250 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-27 03:55:46.968 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-27 03:56:23.949 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.core.jobs 2 2 2014-12-27 04:05:00.088 +!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.core.internal.refresh.RefreshJob +!SESSION 2014-12-28 18:37:12.029 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2014-12-28 18:43:26.329 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2014-12-28 18:43:31.179 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2014-12-28 18:43:57.267 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2014-12-28 22:26:03.127 +!MESSAGE Exception when querying Solr Server + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2014-12-28 22:26:06.428 +!MESSAGE Exception when querying Solr Server + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-28 23:10:56.306 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-28 23:55:18.665 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-28 23:55:34.641 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-29 01:47:38.533 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.core.resources 4 1 2014-12-29 16:52:16.394 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-29 16:52:16.394 +!MESSAGE Problem finding next change, code: 21 + +!ENTRY org.eclipse.core.resources 4 1 2014-12-29 16:53:56.313 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-29 16:53:56.313 +!MESSAGE Problem finding next change, code: 21 + +!ENTRY org.eclipse.core.resources 4 1 2014-12-29 17:12:38.914 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-29 17:12:38.914 +!MESSAGE Problem finding next change, code: 21 + +!ENTRY org.eclipse.core.resources 4 1 2014-12-29 17:32:50.733 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-29 17:32:50.733 +!MESSAGE Problem finding next change, code: 21 + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-29 23:31:42.932 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-29 23:31:45.608 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-29 23:37:02.465 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-29 23:42:44.661 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-29 23:50:56.234 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 00:35:01.447 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 00:35:01.447 +!MESSAGE Problem finding next change, code: 21 + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 00:35:04.744 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 00:35:04.744 +!MESSAGE Problem finding next change, code: 21 + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:23:59.705 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:23:59.705 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-30 01:26:29.313 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2014-12-30 01:26:32.190 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:47:28.075 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:47:28.075 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:47:31.148 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:47:31.148 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:47:34.232 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:47:34.232 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:47:37.265 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:47:37.265 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:47:40.350 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:47:40.350 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:47:43.374 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:47:43.374 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:47:46.393 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:47:46.393 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:47:49.418 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:47:49.418 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:47:52.452 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:47:52.452 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:47:55.470 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:47:55.470 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:47:58.546 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:47:58.546 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:48:01.619 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:48:01.619 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:48:04.695 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:48:04.695 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:48:07.762 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:48:07.762 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 01:48:10.795 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 01:48:10.795 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 04:33:44.651 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 04:33:44.651 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 04:33:47.768 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 04:33:47.768 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 04:33:50.794 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 04:33:50.794 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 04:33:53.877 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 04:33:53.877 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 04:33:56.928 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 04:33:56.928 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:01:46.728 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:01:46.728 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:01:49.807 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:01:49.807 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:01:52.888 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:01:52.888 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:01:55.972 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:01:55.972 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:01:59.047 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:01:59.047 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:02.082 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:02.082 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:05.138 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:05.138 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:08.175 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:08.175 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:11.200 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:11.200 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:14.275 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:14.275 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:17.351 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:17.351 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:20.425 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:20.425 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:23.453 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:23.453 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:26.486 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:26.486 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:29.521 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:29.521 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:32.595 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:32.595 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:35.689 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:35.689 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:38.715 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:38.715 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:41.740 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:41.740 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:44.781 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:44.781 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:47.859 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:47.859 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:50.899 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:50.899 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:53.976 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:53.976 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:02:57.003 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:02:57.003 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:00.052 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:00.052 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:03.128 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:03.128 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:06.153 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:06.153 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:09.230 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:09.230 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:12.265 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:12.265 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:15.297 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:15.297 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:18.324 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:18.324 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:21.367 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:21.367 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:24.409 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:24.409 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:27.481 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:27.481 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:30.557 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:30.557 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:33.600 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:33.600 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:36.683 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:36.683 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:39.710 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:39.710 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:42.735 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:42.735 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:45.827 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:45.827 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:48.863 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:48.863 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:51.962 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:51.962 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:55.038 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:55.038 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:03:58.075 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:03:58.075 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:01.106 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:01.106 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:04.140 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:04.140 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:07.229 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:07.229 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:10.266 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:10.266 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:13.292 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:13.292 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:16.368 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:16.368 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:19.460 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:19.460 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:22.513 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:22.513 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:25.585 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:25.585 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:28.670 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:28.670 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:31.696 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:31.696 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:34.723 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:34.723 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:37.797 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:37.797 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:40.889 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:40.889 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:43.941 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:43.941 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:46.975 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:46.975 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:50.025 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:50.025 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:53.051 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:53.051 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:56.094 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:56.094 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:04:59.168 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:04:59.168 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:02.203 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:02.203 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:05.277 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:05.277 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:08.304 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:08.304 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:11.346 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:11.346 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:14.415 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:14.415 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:17.505 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:17.505 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:20.574 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:20.574 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:23.665 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:23.665 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:26.699 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:26.699 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:29.726 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:29.726 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:32.795 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:32.795 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:35.835 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:35.835 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:38.937 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:38.937 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:41.961 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:41.961 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2014-12-30 05:05:45.042 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-12-30 05:05:45.042 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 566 2014-12-30 06:17:25.774 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2014-12-30 06:17:25.838 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/tmp/recompSrc/net/minecraftforge]) +!SESSION 2015-01-02 05:01:27.302 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-02 05:05:26.819 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-02 05:05:29.520 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-02 05:06:04.280 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-01-02 05:27:34.567 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-01-02 05:27:34.612 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/tmp/recompSrc/net/minecraft]) + +!ENTRY org.eclipse.core.jobs 2 2 2015-01-02 05:27:34.950 +!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.core.internal.events.NotificationManager$NotifyJob +!SESSION 2015-01-02 05:39:56.585 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-02 05:40:12.741 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-02 05:40:32.893 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.rcp 4 6 2015-01-02 16:12:37.684 +!MESSAGE Exception while checking editor offset +!STACK 1 +Java Model Exception: Java Model Status [src.main.java.darkknight.jewelrycraft.tileentity [in [in Minecraft]] does not exist] + at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:544) + at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:247) + at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:505) + at org.eclipse.jdt.internal.core.CompilationUnit.openAncestors(CompilationUnit.java:1173) + at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:241) + at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:557) + at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:294) + at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:280) + at org.eclipse.jdt.internal.core.CompilationUnit.getSourceRange(CompilationUnit.java:908) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.isInvalidSelection(JavaElementSelections.java:176) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromTypeRootInEditor(JavaElementSelections.java:130) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromEditor(JavaElementSelections.java:117) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromEditor(JavaElementSelections.java:100) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService.handleSelectionInEditor(JavaElementSelectionService.java:108) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService.access$1(JavaElementSelectionService.java:105) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService$1.run(JavaElementSelectionService.java:82) + at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) + at java.util.concurrent.FutureTask.run(Unknown Source) + at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) + at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) + at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) + at java.lang.Thread.run(Unknown Source) +!SUBENTRY 1 org.eclipse.jdt.core 4 969 2015-01-02 16:12:37.684 +!MESSAGE src.main.java.darkknight.jewelrycraft.tileentity [in [in Minecraft]] does not exist + +!ENTRY org.eclipse.recommenders.rcp 4 6 2015-01-02 16:12:37.753 +!MESSAGE Exception while checking editor offset +!STACK 1 +Java Model Exception: Java Model Status [src.main.java.darkknight.jewelrycraft.tileentity [in [in Minecraft]] does not exist] + at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:544) + at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:247) + at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:505) + at org.eclipse.jdt.internal.core.CompilationUnit.openAncestors(CompilationUnit.java:1173) + at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:241) + at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:557) + at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:294) + at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:280) + at org.eclipse.jdt.internal.core.CompilationUnit.getSourceRange(CompilationUnit.java:908) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.isInvalidSelection(JavaElementSelections.java:176) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromTypeRootInEditor(JavaElementSelections.java:160) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromEditor(JavaElementSelections.java:117) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromEditor(JavaElementSelections.java:100) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService.handleSelectionInEditor(JavaElementSelectionService.java:108) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService.access$1(JavaElementSelectionService.java:105) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService$1.run(JavaElementSelectionService.java:82) + at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) + at java.util.concurrent.FutureTask.run(Unknown Source) + at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) + at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) + at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) + at java.lang.Thread.run(Unknown Source) +!SUBENTRY 1 org.eclipse.jdt.core 4 969 2015-01-02 16:12:37.753 +!MESSAGE src.main.java.darkknight.jewelrycraft.tileentity [in [in Minecraft]] does not exist + +!ENTRY org.eclipse.recommenders.rcp 4 5 2015-01-02 16:12:37.787 +!MESSAGE Failed to resolve selection in ‘=Minecraft/ Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-02 22:28:30.876 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-02 22:44:00.093 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-02 22:59:24.130 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-02 23:51:06.968 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-03 00:34:48.216 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-03 00:41:57.687 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-03 00:42:10.926 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-03 00:45:59.847 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) +!SESSION 2015-01-03 07:37:10.366 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-03 07:37:22.726 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-03 07:37:25.006 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-03 07:37:55.629 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-03 08:39:09.576 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-03 08:39:12.392 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-03 08:53:14.560 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-03 08:53:17.537 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-03 09:13:31.280 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) +!SESSION 2015-01-03 19:59:32.778 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-03 19:59:44.644 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-03 19:59:46.823 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-03 20:00:07.626 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-01-03 20:32:01.959 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-01-03 20:32:02.016 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/resources/main/assets/jewelrycraft]) +!SESSION 2015-01-03 21:57:39.375 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-03 21:57:50.129 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-03 21:57:51.529 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-03 21:58:07.599 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-01-10 10:25:56.489 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-10 10:26:09.053 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-10 10:26:11.299 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-10 10:26:35.428 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-10 11:22:44.468 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-10 11:22:57.991 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-10 11:23:00.576 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2015-01-10 11:45:23.697 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.lang.String;, sign:()[Ljava.lang.String;, declKey:, key:, name:clone, replace:[4500,4500], token:[4500,4500], relevance:35}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2015-01-10 11:54:04.701 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.lang.String;, sign:()[Ljava.lang.String;, declKey:, key:, name:clone, replace:[5567,5567], token:[5567,5567], relevance:35}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2015-01-10 12:01:15.532 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.lang.String;, sign:()[Ljava.lang.String;, declKey:, key:, name:clone, replace:[6015,6015], token:[6015,6015], relevance:35}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2015-01-10 12:15:13.290 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.lang.String;, sign:()[Ljava.lang.String;, declKey:, key:, name:clone, replace:[5892,5892], token:[5892,5892], relevance:35}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2015-01-10 12:16:30.024 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.lang.String;, sign:()[Ljava.lang.String;, declKey:, key:, name:clone, replace:[6805,6810], token:[6805,6810], relevance:35}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2015-01-10 12:17:19.768 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.lang.String;, sign:()[Ljava.lang.String;, declKey:, key:, name:clone, replace:[7467,7467], token:[7467,7467], relevance:35}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + +!ENTRY org.eclipse.core.resources 4 1 2015-01-11 10:04:28.105 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-11 10:04:28.105 +!MESSAGE Problem finding next change, code: 21 +!SESSION 2015-01-12 12:44:55.686 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-12 12:45:09.771 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-12 12:45:32.602 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-01-15 20:43:17.462 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-15 20:43:30.747 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-15 20:43:51.750 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-01-17 18:29:03.628 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-17 18:29:17.193 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-17 18:29:41.548 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-01-24 14:57:26.438 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-24 14:57:30.499 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-24 14:57:32.725 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-24 14:57:54.773 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-24 14:57:54.920 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.rcp 4 5 2015-01-24 16:49:44.299 +!MESSAGE Failed to resolve selection in ‘=Minecraft/src\/main\/java(Unknown Source) + at org.eclipse.core.internal.resources.SaveManager.validateMasterTableBeforeSave(SaveManager.java:1595) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1263) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1255) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1232) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1144) + at org.eclipse.core.internal.resources.DelayedSnapshotJob.run(DelayedSnapshotJob.java:51) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:06.758 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:06.758 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:09.901 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:09.901 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:12.979 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:12.980 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:16.095 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:16.095 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:19.122 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:19.122 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:22.145 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:22.145 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:25.162 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:25.162 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:28.232 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:28.233 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:31.257 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:31.258 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:34.319 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:34.319 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:37.399 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:37.399 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:40.424 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:40.424 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:43.452 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:43.453 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:46.487 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:46.487 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:49.509 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:49.509 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:52.578 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:52.579 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:55.604 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:55.605 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:54:58.686 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:54:58.686 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:01.747 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:01.747 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:04.824 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:04.824 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:07.857 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:07.857 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:10.883 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:10.883 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:13.925 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:13.925 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:16.948 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:16.948 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:19.968 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:19.968 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:23.049 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:23.049 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:26.083 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:26.083 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:29.159 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:29.159 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:32.185 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:32.185 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:35.212 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:35.212 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:38.925 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:38.925 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:41.994 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:41.995 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:45.022 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:45.023 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:48.069 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:48.070 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:51.091 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:51.091 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:54.125 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:54.125 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:55:57.148 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:55:57.149 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:00.176 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:00.176 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:03.202 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:03.203 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:06.284 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:06.285 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:09.309 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:09.309 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:12.383 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:12.383 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:15.454 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:15.454 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:18.477 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:18.478 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:21.506 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:21.506 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:24.529 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:24.529 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:27.557 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:27.558 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:30.598 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:30.598 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:33.625 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:33.625 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:36.714 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:36.714 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:39.734 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:39.734 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:42.813 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:42.813 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:45.834 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:45.834 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:48.900 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:48.900 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:51.970 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:51.970 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:54.996 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:54.996 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:56:58.028 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:56:58.028 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:01.054 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:01.054 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:04.071 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:04.072 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:07.098 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:07.099 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:10.123 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:10.123 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:13.167 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:13.167 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:16.267 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:16.267 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:19.300 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:19.300 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:22.327 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:22.327 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:25.359 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:25.359 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:28.427 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:28.427 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:31.460 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:31.460 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:34.545 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:34.545 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:37.597 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:37.597 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:40.630 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:40.630 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:43.705 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:43.706 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:46.740 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:46.740 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:49.814 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:49.814 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:52.900 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:52.900 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:55.975 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:55.975 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:57:59.059 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:57:59.059 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:02.135 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:02.135 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:05.168 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:05.168 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:08.253 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:08.253 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:11.286 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:11.286 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.jobs 4 2 2015-01-25 15:58:13.932 +!MESSAGE An internal error occurred during: "Periodic workspace save.". +!STACK 0 +java.lang.NumberFormatException: null + at java.lang.Integer.parseInt(Unknown Source) + at java.lang.Integer.(Unknown Source) + at org.eclipse.core.internal.resources.SaveManager.validateMasterTableBeforeSave(SaveManager.java:1595) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1263) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1255) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1232) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1144) + at org.eclipse.core.internal.resources.DelayedSnapshotJob.run(DelayedSnapshotJob.java:51) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:14.361 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:14.361 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:17.446 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:17.446 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:20.530 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:20.530 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:23.573 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:23.574 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:26.646 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:26.646 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:29.730 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:29.730 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:32.758 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:32.758 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:35.791 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:35.791 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:38.826 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:38.826 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:41.910 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:41.910 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 15:58:44.985 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 15:58:44.985 +!MESSAGE Problem occurred in auto-refresh native code: 5. +!SESSION 2015-01-25 15:58:59.505 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-25 15:59:03.958 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-25 15:59:26.245 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-25 15:59:26.305 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-25 16:39:23.306 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) +!SESSION 2015-01-25 20:29:44.052 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_25 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-25 20:29:46.643 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-25 20:29:47.436 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-25 20:30:00.470 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-25 20:30:00.573 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 22:21:12.586 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 22:21:12.586 +!MESSAGE Problem finding next change, code: 21 + +!ENTRY org.eclipse.core.resources 4 1 2015-01-25 23:48:39.313 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-01-25 23:48:39.313 +!MESSAGE Problem finding next change, code: 21 +!SESSION 2015-01-26 23:25:14.536 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-26 23:25:19.598 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-26 23:25:49.596 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-26 23:25:49.750 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-01-27 01:54:00.636 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-01-27 01:54:00.676 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/tmp/recompSrc/net/minecraft]) +!SESSION 2015-01-27 02:01:29.915 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-27 02:01:53.774 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-27 02:01:55.164 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-27 02:02:21.530 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-27 02:02:21.656 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-27 03:15:35.338 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.core.resources 4 566 2015-01-27 03:17:51.371 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-01-27 03:17:51.457 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[P/Minecraft]) +!SESSION 2015-01-27 21:57:22.593 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-27 21:57:27.021 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-27 21:57:28.853 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-27 21:57:57.608 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-27 21:57:57.815 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-01-28 21:35:49.994 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-28 21:36:02.961 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-28 21:36:04.224 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-28 21:36:22.422 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-28 21:36:22.717 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-28 23:39:33.904 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-28 23:41:05.956 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.text 4 2 2015-01-29 00:27:41.356 +!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.text". +!STACK 0 +java.lang.IllegalArgumentException: Index out of bounds + at org.eclipse.swt.SWT.error(SWT.java:4422) + at org.eclipse.swt.SWT.error(SWT.java:4356) + at org.eclipse.swt.SWT.error(SWT.java:4327) + at org.eclipse.swt.graphics.TextLayout._getOffset(TextLayout.java:2095) + at org.eclipse.swt.graphics.TextLayout.getPreviousOffset(TextLayout.java:2354) + at org.eclipse.swt.custom.StyledText.getPointAtOffset(StyledText.java:5450) + at org.eclipse.swt.custom.StyledText.setCaretLocation(StyledText.java:8499) + at org.eclipse.swt.custom.StyledText.updateSelection(StyledText.java:10364) + at org.eclipse.swt.custom.StyledText.handleTextChanged(StyledText.java:6253) + at org.eclipse.swt.custom.StyledText$6.textChanged(StyledText.java:5643) + at org.eclipse.ui.internal.console.ConsoleDocumentAdapter.documentChanged(ConsoleDocumentAdapter.java:389) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) + at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.ui.internal.console.ConsoleDocument.replace(ConsoleDocument.java:92) + at org.eclipse.ui.internal.console.IOConsolePartitioner$TrimJob.runInUIThread(IOConsolePartitioner.java:663) + at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:97) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-29 00:51:18.922 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-29 00:51:21.796 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-01-29 18:26:24.215 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-29 18:26:29.611 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-29 18:26:31.113 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-29 18:26:54.574 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-29 18:26:54.697 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-01-30 17:57:06.741 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-30 17:57:22.025 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-30 17:57:23.960 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-30 17:57:47.693 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-30 17:57:47.848 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.ui 4 0 2015-01-30 18:58:19.226 +!MESSAGE Unhandled event loop exception +!STACK 0 +java.lang.StringIndexOutOfBoundsException: String index out of range: 34 + at java.lang.String.charAt(Unknown Source) + at org.eclipse.swt.custom.StyledText.getOffsetAtPoint(StyledText.java:4442) + at org.eclipse.swt.custom.StyledText.getOffsetAtPoint(StyledText.java:4423) + at org.eclipse.swt.custom.StyledText.doMouseLocationChange(StyledText.java:2815) + at org.eclipse.swt.custom.StyledText.handleMouseDown(StyledText.java:6059) + at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5666) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-30 22:40:26.114 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2015-01-30 22:40:30.480 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.lang.String;, sign:()[Ljava.lang.String;, declKey:, key:, name:clone, replace:[9612,9612], token:[9612,9612], relevance:35}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2015-01-30 22:41:22.434 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.lang.String;, sign:()[Ljava.lang.String;, declKey:, key:, name:clone, replace:[9504,9504], token:[9504,9504], relevance:35}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-01-31 11:25:59.907 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-31 11:26:03.317 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-31 11:26:05.144 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-31 11:26:34.218 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-31 11:26:34.335 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-01-31 12:12:26.391 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-01-31 12:12:26.486 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[P/Minecraft]) +!SESSION 2015-01-31 21:31:37.741 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-01-31 21:31:54.887 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-01-31 21:31:57.224 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-31 21:32:29.088 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-01-31 21:32:29.218 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-31 23:52:44.745 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-01-31 23:57:16.212 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.jdt.debug 4 125 2015-02-01 01:00:34.362 +!MESSAGE Internal error logged from JDI Debug: +!STACK 0 +org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3209. + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186) + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226) + at org.eclipse.jdi.internal.VirtualMachineImpl.classesBySignature(VirtualMachineImpl.java:638) + at org.eclipse.jdi.internal.VirtualMachineImpl.classesByName(VirtualMachineImpl.java:667) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.jdiClassesByName(JDIDebugTarget.java:1602) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.filterUnloadedTypes(JavaHotCodeReplaceManager.java:349) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.doHotCodeReplace(JavaHotCodeReplaceManager.java:460) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.access$0(JavaHotCodeReplaceManager.java:443) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager$1.run(JavaHotCodeReplaceManager.java:315) + at org.eclipse.debug.core.DebugPlugin$AsynchRunner.run(DebugPlugin.java:1106) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.debug.core.DebugPlugin$AsynchRunner.async(DebugPlugin.java:1087) + at org.eclipse.debug.core.DebugPlugin$EventDispatchJob.run(DebugPlugin.java:429) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.jdt.debug 4 125 2015-02-01 01:01:46.573 +!MESSAGE Internal error logged from JDI Debug: +!STACK 0 +org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3212. + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186) + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226) + at org.eclipse.jdi.internal.VirtualMachineImpl.classesBySignature(VirtualMachineImpl.java:638) + at org.eclipse.jdi.internal.VirtualMachineImpl.classesByName(VirtualMachineImpl.java:667) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.jdiClassesByName(JDIDebugTarget.java:1602) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.getTypesToBytes(JavaHotCodeReplaceManager.java:719) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.redefineTypesJDK(JavaHotCodeReplaceManager.java:611) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.doHotCodeReplace(JavaHotCodeReplaceManager.java:489) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.access$0(JavaHotCodeReplaceManager.java:443) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager$1.run(JavaHotCodeReplaceManager.java:315) + at org.eclipse.debug.core.DebugPlugin$AsynchRunner.run(DebugPlugin.java:1106) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.debug.core.DebugPlugin$AsynchRunner.async(DebugPlugin.java:1087) + at org.eclipse.debug.core.DebugPlugin$EventDispatchJob.run(DebugPlugin.java:429) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.jdt.debug 4 5010 2015-02-01 01:01:49.612 +!MESSAGE At least one target failed to drop to frame after successful hot code replace. +!SUBENTRY 1 org.eclipse.jdt.debug 4 5010 2015-02-01 01:01:49.612 +!MESSAGE org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3211. occurred retrieving stack frames. +!STACK 0 +org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3211. + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186) + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226) + at org.eclipse.jdi.internal.ThreadReferenceImpl.frames(ThreadReferenceImpl.java:257) + at org.eclipse.jdi.internal.ThreadReferenceImpl.frames(ThreadReferenceImpl.java:240) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.getUnderlyingFrames(JDIThread.java:664) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.computeStackFrames(JDIThread.java:563) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.computeStackFrames(JDIThread.java:635) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.getAffectedFrame(JavaHotCodeReplaceManager.java:922) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.getAffectedFrames(JavaHotCodeReplaceManager.java:885) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.attemptPopFrames(JavaHotCodeReplaceManager.java:831) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.doHotCodeReplace(JavaHotCodeReplaceManager.java:478) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.access$0(JavaHotCodeReplaceManager.java:443) + at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager$1.run(JavaHotCodeReplaceManager.java:315) + at org.eclipse.debug.core.DebugPlugin$AsynchRunner.run(DebugPlugin.java:1106) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.debug.core.DebugPlugin$AsynchRunner.async(DebugPlugin.java:1087) + at org.eclipse.debug.core.DebugPlugin$EventDispatchJob.run(DebugPlugin.java:429) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-01 01:30:00.803 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.jdt.debug 4 125 2015-02-01 01:34:22.469 +!MESSAGE Internal error logged from JDI Debug: +!STACK 0 +org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3618. + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186) + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:242) + at org.eclipse.jdi.internal.ThreadReferenceImpl.threadGroup(ThreadReferenceImpl.java:594) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.getUnderlyingThreadGroup(JDIThread.java:2096) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.determineIfSystemThread(JDIThread.java:480) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.initialize(JDIThread.java:284) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.(JDIThread.java:264) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.newThread(JDIDebugTarget.java:566) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.createThread(JDIDebugTarget.java:542) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget$ThreadStartHandler.handleEvent(JDIDebugTarget.java:1967) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100) + at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:249) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.jdt.debug 4 125 2015-02-01 01:34:22.498 +!MESSAGE Internal error logged from JDI Debug: +!STACK 0 +org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3622. + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186) + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:242) + at org.eclipse.jdi.internal.ThreadReferenceImpl.threadGroup(ThreadReferenceImpl.java:594) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.getUnderlyingThreadGroup(JDIThread.java:2096) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.determineIfSystemThread(JDIThread.java:480) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.initialize(JDIThread.java:284) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.(JDIThread.java:264) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.newThread(JDIDebugTarget.java:566) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.createThread(JDIDebugTarget.java:542) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget$ThreadStartHandler.handleEvent(JDIDebugTarget.java:1967) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100) + at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:249) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.jdt.debug 4 125 2015-02-01 01:34:22.514 +!MESSAGE Internal error logged from JDI Debug: +!STACK 0 +org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3621. + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186) + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:242) + at org.eclipse.jdi.internal.ThreadReferenceImpl.threadGroup(ThreadReferenceImpl.java:594) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.getUnderlyingThreadGroup(JDIThread.java:2096) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.determineIfSystemThread(JDIThread.java:480) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.initialize(JDIThread.java:284) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.(JDIThread.java:264) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.newThread(JDIDebugTarget.java:566) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.createThread(JDIDebugTarget.java:542) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget$ThreadStartHandler.handleEvent(JDIDebugTarget.java:1967) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100) + at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:249) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.jdt.debug 4 125 2015-02-01 01:34:22.548 +!MESSAGE Internal error logged from JDI Debug: +!STACK 0 +org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3620. + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186) + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:242) + at org.eclipse.jdi.internal.ThreadReferenceImpl.threadGroup(ThreadReferenceImpl.java:594) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.getUnderlyingThreadGroup(JDIThread.java:2096) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.determineIfSystemThread(JDIThread.java:480) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.initialize(JDIThread.java:284) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.(JDIThread.java:264) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.newThread(JDIDebugTarget.java:566) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.createThread(JDIDebugTarget.java:542) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget$ThreadStartHandler.handleEvent(JDIDebugTarget.java:1967) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100) + at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:249) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.jdt.debug 4 125 2015-02-01 01:34:22.581 +!MESSAGE Internal error logged from JDI Debug: +!STACK 0 +org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3619. + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186) + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:242) + at org.eclipse.jdi.internal.ThreadReferenceImpl.threadGroup(ThreadReferenceImpl.java:594) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.getUnderlyingThreadGroup(JDIThread.java:2096) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.determineIfSystemThread(JDIThread.java:480) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.initialize(JDIThread.java:284) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.(JDIThread.java:264) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.newThread(JDIDebugTarget.java:566) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.createThread(JDIDebugTarget.java:542) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget$ThreadStartHandler.handleEvent(JDIDebugTarget.java:1967) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100) + at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:249) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.jdt.debug 4 125 2015-02-01 01:34:25.498 +!MESSAGE Internal error logged from JDI Debug: +!STACK 0 +org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3626. + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186) + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:242) + at org.eclipse.jdi.internal.ObjectReferenceImpl.referenceType(ObjectReferenceImpl.java:515) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.determineIfDaemonThread(JDIThread.java:515) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.initialize(JDIThread.java:301) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.(JDIThread.java:264) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.newThread(JDIDebugTarget.java:566) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.createThread(JDIDebugTarget.java:542) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget$ThreadStartHandler.handleEvent(JDIDebugTarget.java:1967) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100) + at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:249) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.jdt.debug 4 125 2015-02-01 01:34:25.531 +!MESSAGE Internal error logged from JDI Debug: +!STACK 0 +org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3627. + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186) + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:242) + at org.eclipse.jdi.internal.ObjectReferenceImpl.referenceType(ObjectReferenceImpl.java:515) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.determineIfDaemonThread(JDIThread.java:515) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.initialize(JDIThread.java:301) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.(JDIThread.java:264) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.newThread(JDIDebugTarget.java:566) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.createThread(JDIDebugTarget.java:542) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget$ThreadStartHandler.handleEvent(JDIDebugTarget.java:1967) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100) + at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:249) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.jdt.debug 4 125 2015-02-01 01:34:25.554 +!MESSAGE Internal error logged from JDI Debug: +!STACK 0 +org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3628. + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186) + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:242) + at org.eclipse.jdi.internal.ObjectReferenceImpl.referenceType(ObjectReferenceImpl.java:515) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.determineIfDaemonThread(JDIThread.java:515) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.initialize(JDIThread.java:301) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.(JDIThread.java:264) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.newThread(JDIDebugTarget.java:566) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.createThread(JDIDebugTarget.java:542) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget$ThreadStartHandler.handleEvent(JDIDebugTarget.java:1967) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100) + at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:249) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.jdt.debug 4 125 2015-02-01 01:34:25.585 +!MESSAGE Internal error logged from JDI Debug: +!STACK 0 +org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3629. + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186) + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:242) + at org.eclipse.jdi.internal.ObjectReferenceImpl.referenceType(ObjectReferenceImpl.java:515) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.determineIfDaemonThread(JDIThread.java:515) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.initialize(JDIThread.java:301) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.(JDIThread.java:264) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.newThread(JDIDebugTarget.java:566) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.createThread(JDIDebugTarget.java:542) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget$ThreadStartHandler.handleEvent(JDIDebugTarget.java:1967) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100) + at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:249) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.jdt.debug 4 125 2015-02-01 01:34:25.610 +!MESSAGE Internal error logged from JDI Debug: +!STACK 0 +org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 3630. + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186) + at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226) + at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:242) + at org.eclipse.jdi.internal.ObjectReferenceImpl.referenceType(ObjectReferenceImpl.java:515) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.determineIfDaemonThread(JDIThread.java:515) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.initialize(JDIThread.java:301) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.(JDIThread.java:264) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.newThread(JDIDebugTarget.java:566) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.createThread(JDIDebugTarget.java:542) + at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget$ThreadStartHandler.handleEvent(JDIDebugTarget.java:1967) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100) + at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:249) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.core.jobs 2 2 2015-02-01 01:57:05.859 +!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.core.internal.refresh.RefreshJob +!SESSION 2015-02-01 02:10:12.544 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-01 02:10:15.748 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-01 02:10:17.011 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-01 02:10:31.373 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-01 02:10:31.454 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-02-01 02:16:11.024 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-01 02:16:14.374 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-01 02:16:27.778 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-01 02:16:27.863 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-02-01 02:21:17.864 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-01 02:21:17.932 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/tmp/recompCls/cpw/mods/fml/common]) + +!ENTRY org.eclipse.core.jobs 2 2 2015-02-01 02:21:18.205 +!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.core.internal.events.NotificationManager$NotifyJob +!SESSION 2015-02-01 03:06:25.026 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-01 03:06:28.700 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-01 03:06:30.248 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) +!SESSION 2015-02-01 03:06:58.861 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-01 03:07:01.156 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-01 03:07:01.815 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-01 03:07:43.381 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-01 03:07:43.410 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-02-02 19:29:57.325 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-02 19:29:59.944 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-02 19:30:00.757 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-02 19:30:16.047 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-02 19:30:16.139 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-02-02 21:01:57.129 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-02 21:01:57.545 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/tmp/recompSrc/net/minecraft/client/renderer]) + +!ENTRY org.eclipse.core.resources 4 566 2015-02-02 21:01:57.832 +!MESSAGE Workspace was not properly initialized or has already shutdown. +!SESSION 2015-02-05 10:06:00.377 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-05 10:06:07.723 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-05 10:06:10.033 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 10:06:39.268 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 10:06:39.471 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-05 10:36:01.251 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 15:57:15.098 +!MESSAGE Problems occurred while refreshing local changes +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 15:57:15.098 +!MESSAGE Problems occurred while refreshing local changes +!STACK 1 +org.eclipse.core.internal.resources.ResourceException: Errors occurred while refreshing resources with the local file system. + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:923) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: The project description file (.project) for 'Minecraft' is missing. This file contains important information about the project. The project will not function properly until this file is restored. +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 2 org.eclipse.core.resources 4 271 2015-02-05 15:57:15.169 +!MESSAGE Errors occurred while refreshing resources with the local file system. +!SUBENTRY 3 org.eclipse.core.resources 4 567 2015-02-05 15:57:15.169 +!MESSAGE The project description file (.project) for 'Minecraft' is missing. This file contains important information about the project. The project will not function properly until this file is restored. +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.169 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.169 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.169 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.180 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.180 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.180 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.180 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.180 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.181 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.181 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.181 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.181 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.181 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.182 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.182 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.182 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.183 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.183 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.183 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.187 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.187 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.187 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.189 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.189 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.189 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.189 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 3 org.eclipse.core.resources 4 568 2015-02-05 15:57:15.189 +!MESSAGE Could not write metadata for 'H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index'. +!STACK 0 +java.io.FileNotFoundException: H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes\properties.index (The system cannot find the path specified) + at java.io.FileOutputStream.open(Native Method) + at java.io.FileOutputStream.(Unknown Source) + at java.io.FileOutputStream.(Unknown Source) + at org.eclipse.core.internal.localstore.Bucket.save(Bucket.java:346) + at org.eclipse.core.internal.properties.PropertyBucket.save(PropertyBucket.java:291) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:290) + at org.eclipse.core.internal.properties.PropertyBucket.load(PropertyBucket.java:258) + at org.eclipse.core.internal.localstore.Bucket.load(Bucket.java:274) + at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:98) + at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:76) + at org.eclipse.core.internal.properties.PropertyManager2.deleteProperties(PropertyManager2.java:101) + at org.eclipse.core.internal.properties.PropertyManager2.deleteResource(PropertyManager2.java:110) + at org.eclipse.core.internal.resources.Resource.deleteResource(Resource.java:918) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.deleteResource(RefreshLocalVisitor.java:99) + at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.deleteResource(RefreshLocalAliasVisitor.java:43) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:187) + at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) + at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) + at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) + at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705) + at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2015-02-05 15:57:18.276 +!MESSAGE Error setting focus to : org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl GuiHandler.java +!STACK 0 +org.eclipse.swt.SWTException: Widget is disposed + at org.eclipse.swt.SWT.error(SWT.java:4441) + at org.eclipse.swt.SWT.error(SWT.java:4356) + at org.eclipse.swt.SWT.error(SWT.java:4327) + at org.eclipse.swt.widgets.Widget.error(Widget.java:476) + at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:348) + at org.eclipse.swt.widgets.Control.setFocus(Control.java:3320) + at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1039) + at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1039) + at org.eclipse.ui.texteditor.StatusTextEditor.setFocus(StatusTextEditor.java:120) + at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.setFocus(JavaEditor.java:2389) + at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:191) + at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:253) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:225) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:107) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.focusGui(PartRenderingEngine.java:795) + at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$2.setFocus(ContributedPartRenderer.java:100) + at org.eclipse.swt.custom.CTabItem.setFocus(CTabItem.java:332) + at org.eclipse.swt.custom.CTabFolder.setFocus(CTabFolder.java:2555) + at org.eclipse.swt.widgets.Control.fixFocus(Control.java:1052) + at org.eclipse.swt.widgets.Control.setVisible(Control.java:3818) + at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3098) + at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3055) + at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1260) + at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:68) + at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40) + at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187) + at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156) + at org.eclipse.swt.widgets.Display.syncExec(Display.java:4734) + at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:218) + at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36) + at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197) + at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197) + at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1) + at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) + at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) + at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135) + at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78) + at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39) + at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81) + at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:59) + at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374) + at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171) + at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.hidePart(PartServiceImpl.java:1251) + at org.eclipse.ui.internal.WorkbenchPage.hidePart(WorkbenchPage.java:1599) + at org.eclipse.ui.internal.WorkbenchPage.hidePart(WorkbenchPage.java:1550) + at org.eclipse.ui.internal.WorkbenchPage.closeEditors(WorkbenchPage.java:1520) + at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java:1645) + at org.eclipse.ui.texteditor.AbstractTextEditor$23.run(AbstractTextEditor.java:4333) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.rcp 4 6 2015-02-05 15:57:18.364 +!MESSAGE Exception while checking editor offset +!STACK 1 +Java Model Exception: Java Model Status [src.main.java.darkknight.jewelrycraft.container [in [in Minecraft]] does not exist] + at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:544) + at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:247) + at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:505) + at org.eclipse.jdt.internal.core.CompilationUnit.openAncestors(CompilationUnit.java:1173) + at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:241) + at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:557) + at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:294) + at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:280) + at org.eclipse.jdt.internal.core.CompilationUnit.getSourceRange(CompilationUnit.java:908) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.isInvalidSelection(JavaElementSelections.java:176) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromTypeRootInEditor(JavaElementSelections.java:130) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromEditor(JavaElementSelections.java:117) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromEditor(JavaElementSelections.java:100) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService.handleSelectionInEditor(JavaElementSelectionService.java:108) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService.access$1(JavaElementSelectionService.java:105) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService$1.run(JavaElementSelectionService.java:82) + at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) + at java.util.concurrent.FutureTask.run(Unknown Source) + at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) + at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) + at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) + at java.lang.Thread.run(Unknown Source) +!SUBENTRY 1 org.eclipse.jdt.core 4 969 2015-02-05 15:57:18.364 +!MESSAGE src.main.java.darkknight.jewelrycraft.container [in [in Minecraft]] does not exist + +!ENTRY org.eclipse.recommenders.rcp 4 6 2015-02-05 15:57:18.446 +!MESSAGE Exception while checking editor offset +!STACK 1 +Java Model Exception: Java Model Status [src.main.java.darkknight.jewelrycraft.container [in [in Minecraft]] does not exist] + at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:544) + at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:247) + at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:505) + at org.eclipse.jdt.internal.core.CompilationUnit.openAncestors(CompilationUnit.java:1173) + at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:241) + at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:557) + at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:294) + at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:280) + at org.eclipse.jdt.internal.core.CompilationUnit.getSourceRange(CompilationUnit.java:908) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.isInvalidSelection(JavaElementSelections.java:176) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromTypeRootInEditor(JavaElementSelections.java:160) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromEditor(JavaElementSelections.java:117) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromEditor(JavaElementSelections.java:100) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService.handleSelectionInEditor(JavaElementSelectionService.java:108) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService.access$1(JavaElementSelectionService.java:105) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService$1.run(JavaElementSelectionService.java:82) + at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) + at java.util.concurrent.FutureTask.run(Unknown Source) + at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) + at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) + at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) + at java.lang.Thread.run(Unknown Source) +!SUBENTRY 1 org.eclipse.jdt.core 4 969 2015-02-05 15:57:18.447 +!MESSAGE src.main.java.darkknight.jewelrycraft.container [in [in Minecraft]] does not exist + +!ENTRY org.eclipse.recommenders.rcp 4 5 2015-02-05 15:57:18.533 +!MESSAGE Failed to resolve selection in ‘=Minecraft/(Unknown Source) + at org.eclipse.core.internal.resources.SaveManager.validateMasterTableBeforeSave(SaveManager.java:1595) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1263) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1255) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1232) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1144) + at org.eclipse.core.internal.resources.DelayedSnapshotJob.run(DelayedSnapshotJob.java:51) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.core.jobs 4 2 2015-02-05 16:07:22.521 +!MESSAGE An internal error occurred during: "Periodic workspace save.". +!STACK 0 +java.lang.NumberFormatException: null + at java.lang.Integer.parseInt(Unknown Source) + at java.lang.Integer.(Unknown Source) + at org.eclipse.core.internal.resources.SaveManager.validateMasterTableBeforeSave(SaveManager.java:1595) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1263) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1255) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1232) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1144) + at org.eclipse.core.internal.resources.DelayedSnapshotJob.run(DelayedSnapshotJob.java:51) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.core.jobs 4 2 2015-02-05 16:32:59.308 +!MESSAGE An internal error occurred during: "Periodic workspace save.". +!STACK 0 +java.lang.NumberFormatException: null + at java.lang.Integer.parseInt(Unknown Source) + at java.lang.Integer.(Unknown Source) + at org.eclipse.core.internal.resources.SaveManager.validateMasterTableBeforeSave(SaveManager.java:1595) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1263) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1255) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1232) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1144) + at org.eclipse.core.internal.resources.DelayedSnapshotJob.run(DelayedSnapshotJob.java:51) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:02.014 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:02.014 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:05.085 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:05.086 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:08.146 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:08.146 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:11.186 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:11.186 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:14.272 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:14.272 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:17.320 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:17.320 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:20.354 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:20.354 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:23.404 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:23.405 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:26.447 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:26.448 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:29.501 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:29.502 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:32.598 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:32.598 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:35.641 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:35.641 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:38.683 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:38.683 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:41.717 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:41.718 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:44.821 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:44.822 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:47.860 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:47.860 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:50.914 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:50.914 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:53.948 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:53.948 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:18:57.044 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:18:57.044 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:00.099 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:00.099 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:03.138 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:03.138 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:06.181 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:06.182 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:09.284 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:09.284 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:12.344 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:12.344 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:15.384 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:15.384 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:18.444 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:18.445 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:21.541 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:21.541 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:24.592 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:24.592 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:27.696 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:27.696 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:30.727 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:30.727 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:33.773 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:33.773 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:36.862 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:36.862 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:39.923 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:39.923 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:43.012 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:43.013 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:46.066 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:46.066 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:49.114 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:49.114 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:52.173 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:52.174 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:55.210 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:55.211 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:19:58.261 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:19:58.262 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:01.325 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:01.326 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:04.362 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:04.362 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:07.467 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:07.467 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:10.505 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:10.505 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:13.619 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:13.619 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:16.666 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:16.666 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:19.754 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:19.754 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:22.845 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:22.846 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:26.102 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:26.102 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:29.191 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:29.191 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:32.224 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:32.224 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:35.277 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:35.277 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:38.366 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:38.367 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:41.466 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:41.466 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:44.504 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:44.504 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:47.600 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:47.601 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:50.647 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:50.648 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:53.686 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:53.686 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:56.720 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:56.721 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:20:59.765 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:20:59.765 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:02.804 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:02.805 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:05.904 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:05.904 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:08.992 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:08.992 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:12.037 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:12.037 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:15.119 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:15.119 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:18.172 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:18.172 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:21.205 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:21.205 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:24.307 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:24.307 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:27.349 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:27.349 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:30.446 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:30.446 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:33.532 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:33.532 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:36.625 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:36.625 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:39.707 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:39.708 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:42.801 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:42.801 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:45.825 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:45.825 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:48.918 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:48.918 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:51.954 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:51.954 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:55.043 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:55.043 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:21:58.095 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:21:58.095 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:01.128 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:01.128 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:04.171 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:04.171 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:07.255 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:07.255 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:10.337 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:10.337 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:13.381 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:13.381 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:16.473 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:16.473 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:19.517 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:19.518 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:22.554 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:22.554 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:25.642 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:25.642 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:28.677 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:28.678 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:31.718 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:31.718 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:34.802 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:34.802 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:37.844 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:37.844 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:40.879 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:40.879 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:43.922 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:43.922 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:46.955 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:46.955 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:49.997 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:49.997 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:53.088 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:53.088 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:56.126 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:56.126 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:22:59.214 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:22:59.214 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:02.246 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:02.247 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:05.300 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:05.300 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:08.330 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:08.330 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:11.376 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:11.376 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.jobs 4 2 2015-02-05 17:23:11.579 +!MESSAGE An internal error occurred during: "Periodic workspace save.". +!STACK 0 +java.lang.NumberFormatException: null + at java.lang.Integer.parseInt(Unknown Source) + at java.lang.Integer.(Unknown Source) + at org.eclipse.core.internal.resources.SaveManager.validateMasterTableBeforeSave(SaveManager.java:1595) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1263) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1255) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1232) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1144) + at org.eclipse.core.internal.resources.DelayedSnapshotJob.run(DelayedSnapshotJob.java:51) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:14.423 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:14.424 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:17.519 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:17.519 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:20.557 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:20.557 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:23.596 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:23.596 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:26.642 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:26.642 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:29.730 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:29.731 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:37.626 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:37.626 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:40.669 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:40.669 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:43.799 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:43.799 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:46.853 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:46.853 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:49.884 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:49.884 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:52.930 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:52.930 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:55.964 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:55.964 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:23:59.011 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:23:59.011 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:02.098 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:02.098 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:05.186 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:05.186 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:08.248 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:08.248 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:11.283 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:11.283 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:14.376 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:14.376 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:17.459 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:17.459 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:20.507 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:20.507 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:23.594 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:23.594 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:26.655 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:26.655 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:29.745 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:29.746 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:32.825 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:32.825 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:36.133 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:36.133 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:39.211 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:39.211 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:42.297 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:42.297 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:45.387 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:45.387 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:48.424 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:48.424 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:51.447 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:51.447 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:54.532 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:54.532 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:24:57.607 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:24:57.608 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:00.651 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:00.651 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:03.733 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:03.733 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:06.818 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:06.818 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:09.852 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:09.852 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:12.887 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:12.887 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:15.920 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:15.920 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:19.005 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:19.005 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:22.046 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:22.046 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:25.127 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:25.127 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:28.214 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:28.214 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:31.294 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:31.294 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:34.329 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:34.329 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:37.366 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:37.366 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:40.447 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:40.447 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:43.492 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:43.492 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:46.551 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:46.551 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:49.642 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:49.642 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:52.674 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:52.674 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:55.718 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:55.718 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:25:58.792 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:25:58.792 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:01.830 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:01.830 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:04.917 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:04.917 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:07.995 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:07.995 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:11.048 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:11.048 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:14.079 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:14.079 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:17.174 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:17.175 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:20.271 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:20.271 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:23.308 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:23.308 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:26.400 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:26.400 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:29.448 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:29.448 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:32.502 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:32.502 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:35.541 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:35.541 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:38.579 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:38.579 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:41.618 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:41.618 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:44.655 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:44.655 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:47.696 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:47.696 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:50.744 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:50.744 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:53.795 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:53.795 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:56.886 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:56.886 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:26:59.937 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:26:59.937 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:03.065 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:03.065 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:06.224 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:06.224 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:09.309 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:09.309 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:12.406 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:12.406 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:15.441 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:15.441 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:18.541 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:18.541 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:21.592 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:21.592 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:24.635 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:24.635 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:27.735 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:27.735 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:30.777 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:30.777 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:33.832 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:33.832 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:36.929 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:36.929 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:40.016 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:40.016 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:43.071 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:43.071 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:46.168 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:46.168 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:49.258 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:49.258 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:52.369 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:52.369 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:55.407 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:55.407 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:27:58.498 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:27:58.498 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:01.592 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:01.592 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:04.670 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:04.670 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:07.776 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:07.776 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:10.805 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:10.805 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.jobs 4 2 2015-02-05 17:28:13.292 +!MESSAGE An internal error occurred during: "Periodic workspace save.". +!STACK 0 +java.lang.NumberFormatException: null + at java.lang.Integer.parseInt(Unknown Source) + at java.lang.Integer.(Unknown Source) + at org.eclipse.core.internal.resources.SaveManager.validateMasterTableBeforeSave(SaveManager.java:1595) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1263) + at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1255) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1232) + at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1144) + at org.eclipse.core.internal.resources.DelayedSnapshotJob.run(DelayedSnapshotJob.java:51) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:13.845 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:13.845 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:16.922 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:16.922 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:20.012 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:20.012 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:23.090 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:23.090 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:26.131 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:26.131 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:29.230 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:29.230 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:32.273 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:32.273 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:35.327 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:35.327 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:38.391 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:38.391 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:41.445 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:41.445 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:44.484 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:44.484 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:47.575 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:47.575 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:50.662 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:50.662 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:53.753 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:53.753 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:56.831 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:56.832 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:28:59.879 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:28:59.879 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:29:02.908 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:29:02.908 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:29:05.947 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:29:05.947 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:29:09.026 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:29:09.026 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:29:12.123 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:29:12.123 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:29:15.218 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:29:15.218 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:29:18.266 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:29:18.266 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:29:21.353 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:29:21.353 +!MESSAGE Problem occurred in auto-refresh native code: 5. + +!ENTRY org.eclipse.core.resources 4 1 2015-02-05 17:29:24.401 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-02-05 17:29:24.401 +!MESSAGE Problem occurred in auto-refresh native code: 5. +!SESSION 2015-02-05 18:36:45.083 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-05 18:36:48.112 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-05 18:36:49.182 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 18:37:04.116 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 18:37:04.504 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-02-05 20:40:01.682 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-05 20:40:01.749 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/eclipse/saves/Village]) +!SESSION 2015-02-05 23:41:51.731 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-05 23:41:54.561 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-05 23:41:57.557 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 23:42:23.905 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 23:42:24.041 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-02-05 23:42:41.056 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-05 23:42:43.668 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-05 23:42:44.491 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 23:43:07.321 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 23:43:07.402 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.jdt.debug.ui 4 4 2015-02-06 01:42:55.357 +!MESSAGE java.lang.InternalError: Got MethodID of ReferenceType that is not a member of the ReferenceType occurred retrieving stack frames. +!STACK 0 +java.lang.InternalError: Got MethodID of ReferenceType that is not a member of the ReferenceType + at org.eclipse.jdi.internal.MethodImpl.readWithReferenceTypeWithTag(MethodImpl.java:697) + at org.eclipse.jdi.internal.LocationImpl.read(LocationImpl.java:169) + at org.eclipse.jdi.internal.StackFrameImpl.readWithLocation(StackFrameImpl.java:354) + at org.eclipse.jdi.internal.ThreadReferenceImpl.frames(ThreadReferenceImpl.java:275) + at org.eclipse.jdi.internal.ThreadReferenceImpl.frames(ThreadReferenceImpl.java:240) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.getUnderlyingFrames(JDIThread.java:664) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.computeStackFrames(JDIThread.java:563) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.computeStackFrames(JDIThread.java:635) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.getTopStackFrame(JDIThread.java:1212) + at org.eclipse.jdt.internal.debug.ui.breakpoints.SuspendOnCompilationErrorListener.breakpointHit(SuspendOnCompilationErrorListener.java:65) + at org.eclipse.jdt.internal.debug.core.breakpoints.BreakpointListenerManager$JavaBreakpointListenerProxy.breakpointHit(BreakpointListenerManager.java:160) + at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin$HitNotifier.run(JDIDebugPlugin.java:736) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin$AbstractNotifier.notifyListeners(JDIDebugPlugin.java:541) + at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin$HitNotifier.notifyHit(JDIDebugPlugin.java:752) + at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin.fireBreakpointHit(JDIDebugPlugin.java:493) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.handleSuspendForBreakpoint(JDIThread.java:1298) + at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.suspend(JavaBreakpoint.java:401) + at org.eclipse.jdt.internal.debug.core.breakpoints.JavaExceptionBreakpoint.handleBreakpointEvent(JavaExceptionBreakpoint.java:387) + at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.handleEvent(JavaBreakpoint.java:308) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100) + at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:249) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-06 02:27:18.574 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-06 02:50:47.860 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-02-06 16:22:11.171 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-06 16:22:14.745 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-06 16:22:16.287 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-06 16:22:33.791 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-06 16:22:33.860 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-06 18:16:59.011 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-06 19:26:10.814 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-06 19:26:16.362 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-06 20:39:00.140 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-06 20:39:43.690 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-06 20:39:56.482 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-07 00:02:23.613 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-07 00:04:44.025 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.jdt.debug.ui 4 4 2015-02-07 00:32:32.341 +!MESSAGE java.lang.InternalError: Got MethodID of ReferenceType that is not a member of the ReferenceType occurred retrieving stack frames. +!STACK 0 +java.lang.InternalError: Got MethodID of ReferenceType that is not a member of the ReferenceType + at org.eclipse.jdi.internal.MethodImpl.readWithReferenceTypeWithTag(MethodImpl.java:697) + at org.eclipse.jdi.internal.LocationImpl.read(LocationImpl.java:169) + at org.eclipse.jdi.internal.StackFrameImpl.readWithLocation(StackFrameImpl.java:354) + at org.eclipse.jdi.internal.ThreadReferenceImpl.frames(ThreadReferenceImpl.java:275) + at org.eclipse.jdi.internal.ThreadReferenceImpl.frames(ThreadReferenceImpl.java:240) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.getUnderlyingFrames(JDIThread.java:664) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.computeStackFrames(JDIThread.java:563) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.computeStackFrames(JDIThread.java:635) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.getTopStackFrame(JDIThread.java:1212) + at org.eclipse.jdt.internal.debug.ui.breakpoints.SuspendOnCompilationErrorListener.breakpointHit(SuspendOnCompilationErrorListener.java:65) + at org.eclipse.jdt.internal.debug.core.breakpoints.BreakpointListenerManager$JavaBreakpointListenerProxy.breakpointHit(BreakpointListenerManager.java:160) + at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin$HitNotifier.run(JDIDebugPlugin.java:736) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin$AbstractNotifier.notifyListeners(JDIDebugPlugin.java:541) + at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin$HitNotifier.notifyHit(JDIDebugPlugin.java:752) + at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin.fireBreakpointHit(JDIDebugPlugin.java:493) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.handleSuspendForBreakpoint(JDIThread.java:1298) + at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.suspend(JavaBreakpoint.java:401) + at org.eclipse.jdt.internal.debug.core.breakpoints.JavaExceptionBreakpoint.handleBreakpointEvent(JavaExceptionBreakpoint.java:387) + at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.handleEvent(JavaBreakpoint.java:308) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100) + at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:249) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SESSION 2015-02-07 02:31:55.381 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-07 02:31:59.225 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-07 02:32:01.863 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-07 02:32:29.437 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-07 02:32:29.587 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-02-07 12:28:44.948 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-07 12:28:47.506 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-07 12:28:48.913 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-07 12:29:02.509 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-07 12:29:02.636 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.jobs 2 2 2015-02-07 12:49:13.553 +!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.core.internal.refresh.RefreshJob +!SESSION 2015-02-07 12:49:14.099 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-07 12:49:20.878 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-07 12:49:21.617 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-07 12:49:35.882 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-07 12:49:35.925 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-02-07 14:56:33.768 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-07 14:56:33.824 +!MESSAGE Worker thread ended job: Refreshing workspace(21), but still holds rule: ThreadJob(Refreshing workspace(21),[F/Minecraft/build/tmp/recompSrc/net/minecraft]) + +!ENTRY org.eclipse.core.resources 4 566 2015-02-07 14:56:34.517 +!MESSAGE Workspace was not properly initialized or has already shutdown. +!SESSION 2015-02-07 17:04:33.097 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-07 17:04:44.295 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-07 17:04:45.006 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-07 17:05:00.306 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-07 17:05:00.396 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-07 17:33:00.060 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.core.resources 4 566 2015-02-07 19:02:58.328 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-07 19:02:58.427 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/tmp/recompSrc/assets/minecraft/textures/entity]) +!SESSION 2015-02-08 12:46:10.345 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-08 12:46:13.809 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-08 12:46:15.646 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-08 12:46:38.061 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-08 12:46:38.149 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-02-08 13:56:58.079 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-08 13:56:58.103 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[P/Minecraft]) +!SESSION 2015-02-08 17:53:52.109 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-08 17:53:54.769 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-08 17:53:55.756 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-08 17:54:18.251 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-08 17:54:18.375 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-02-08 18:00:11.985 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-08 18:00:12.032 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/bin/darkknight/jewelrycraft]) +!SESSION 2015-02-08 20:52:53.094 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-08 20:53:04.251 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-08 20:53:04.951 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-08 20:53:19.707 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-08 20:53:19.903 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2015-02-08 22:13:02.029 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.lang.String;, sign:()[Ljava.lang.String;, declKey:, key:, name:clone, replace:[1719,1719], token:[1719,1719], relevance:65}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2015-02-08 22:13:38.333 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.lang.String;, sign:()[Ljava.lang.String;, declKey:, key:, name:clone, replace:[1706,1706], token:[1706,1706], relevance:65}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-09 00:09:57.175 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-09 01:31:23.373 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.core.resources 4 566 2015-02-09 02:22:09.320 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-09 02:22:09.364 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/eclipse]) +!SESSION 2015-02-09 12:13:35.309 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-09 12:13:42.513 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-09 12:13:44.491 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-09 12:14:10.319 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-09 12:14:10.370 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-02-10 19:50:21.715 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-10 19:50:39.825 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-10 19:50:42.372 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-10 19:51:20.741 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-10 19:51:20.845 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-02-11 21:20:24.497 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-11 21:20:37.262 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-11 21:20:53.166 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-11 21:20:53.310 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-02-13 20:07:53.851 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-13 20:08:08.519 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-13 20:08:10.720 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-13 20:08:39.167 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-13 20:08:39.304 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-13 21:37:50.530 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-02-14 10:42:39.265 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-14 10:42:44.613 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-14 10:43:01.873 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-14 10:43:01.945 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.jdt.core 4 4 2015-02-14 10:44:23.229 +!MESSAGE JavaBuilder handling ImageBuilderInternalException while building: Minecraft +!STACK 1 +org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources. + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:816) + at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:115) + at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:47) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:256) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:175) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not delete '/Minecraft/bin/src'. +org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources. + at org.eclipse.core.internal.localstore.FileSystemResourceManager.delete(FileSystemResourceManager.java:351) + at org.eclipse.core.internal.resources.ResourceTree.internalDeleteFolder(ResourceTree.java:352) + at org.eclipse.core.internal.resources.ResourceTree.standardDeleteFolder(ResourceTree.java:798) + at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1983) + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:803) + at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:115) + at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:47) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:256) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:175) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Problems encountered while deleting files. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git\objects\91. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git\objects. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src. +!SUBENTRY 1 org.eclipse.core.resources 4 273 2015-02-14 10:44:23.230 +!MESSAGE Problems encountered while deleting resources. +!SUBENTRY 2 org.eclipse.core.resources 4 273 2015-02-14 10:44:23.230 +!MESSAGE Could not delete '/Minecraft/bin/src'. +!STACK 1 +org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources. + at org.eclipse.core.internal.localstore.FileSystemResourceManager.delete(FileSystemResourceManager.java:351) + at org.eclipse.core.internal.resources.ResourceTree.internalDeleteFolder(ResourceTree.java:352) + at org.eclipse.core.internal.resources.ResourceTree.standardDeleteFolder(ResourceTree.java:798) + at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1983) + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:803) + at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:115) + at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:47) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:256) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:175) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Problems encountered while deleting files. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git\objects\91. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git\objects. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src. +!SUBENTRY 3 org.eclipse.core.resources 4 273 2015-02-14 10:44:23.231 +!MESSAGE Problems encountered while deleting resources. +!SUBENTRY 4 org.eclipse.core.filesystem 4 273 2015-02-14 10:44:23.231 +!MESSAGE Problems encountered while deleting files. +!SUBENTRY 5 org.eclipse.core.filesystem 4 273 2015-02-14 10:44:23.231 +!MESSAGE Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git\objects\91. +!SUBENTRY 5 org.eclipse.core.filesystem 4 273 2015-02-14 10:44:23.231 +!MESSAGE Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git\objects. +!SUBENTRY 5 org.eclipse.core.filesystem 4 273 2015-02-14 10:44:23.231 +!MESSAGE Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git. +!SUBENTRY 5 org.eclipse.core.filesystem 4 273 2015-02-14 10:44:23.231 +!MESSAGE Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main. +!SUBENTRY 5 org.eclipse.core.filesystem 4 273 2015-02-14 10:44:23.231 +!MESSAGE Could not delete: H:\Jewelrycraft\1.7.10\bin\src. + +!ENTRY org.eclipse.jdt.core 4 4 2015-02-14 10:44:42.145 +!MESSAGE JavaBuilder handling ImageBuilderInternalException while building: Minecraft +!STACK 1 +org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources. + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:816) + at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:115) + at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:47) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:256) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:180) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Could not delete '/Minecraft/bin/src'. +org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources. + at org.eclipse.core.internal.localstore.FileSystemResourceManager.delete(FileSystemResourceManager.java:351) + at org.eclipse.core.internal.resources.ResourceTree.internalDeleteFolder(ResourceTree.java:352) + at org.eclipse.core.internal.resources.ResourceTree.standardDeleteFolder(ResourceTree.java:798) + at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1983) + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:803) + at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:115) + at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:47) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:256) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:180) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Problems encountered while deleting files. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git\objects\1a. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git\objects. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src. +!SUBENTRY 1 org.eclipse.core.resources 4 273 2015-02-14 10:44:42.146 +!MESSAGE Problems encountered while deleting resources. +!SUBENTRY 2 org.eclipse.core.resources 4 273 2015-02-14 10:44:42.146 +!MESSAGE Could not delete '/Minecraft/bin/src'. +!STACK 1 +org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources. + at org.eclipse.core.internal.localstore.FileSystemResourceManager.delete(FileSystemResourceManager.java:351) + at org.eclipse.core.internal.resources.ResourceTree.internalDeleteFolder(ResourceTree.java:352) + at org.eclipse.core.internal.resources.ResourceTree.standardDeleteFolder(ResourceTree.java:798) + at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1983) + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:803) + at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:115) + at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:47) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:256) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:180) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +Contains: Problems encountered while deleting files. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git\objects\1a. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git\objects. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main. +Contains: Could not delete: H:\Jewelrycraft\1.7.10\bin\src. +!SUBENTRY 3 org.eclipse.core.resources 4 273 2015-02-14 10:44:42.146 +!MESSAGE Problems encountered while deleting resources. +!SUBENTRY 4 org.eclipse.core.filesystem 4 273 2015-02-14 10:44:42.146 +!MESSAGE Problems encountered while deleting files. +!SUBENTRY 5 org.eclipse.core.filesystem 4 273 2015-02-14 10:44:42.146 +!MESSAGE Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git\objects\1a. +!SUBENTRY 5 org.eclipse.core.filesystem 4 273 2015-02-14 10:44:42.146 +!MESSAGE Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git\objects. +!SUBENTRY 5 org.eclipse.core.filesystem 4 273 2015-02-14 10:44:42.146 +!MESSAGE Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main\.git. +!SUBENTRY 5 org.eclipse.core.filesystem 4 273 2015-02-14 10:44:42.146 +!MESSAGE Could not delete: H:\Jewelrycraft\1.7.10\bin\src\main. +!SUBENTRY 5 org.eclipse.core.filesystem 4 273 2015-02-14 10:44:42.146 +!MESSAGE Could not delete: H:\Jewelrycraft\1.7.10\bin\src. +!SESSION 2015-02-14 12:26:16.616 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-14 12:26:19.864 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-14 12:26:21.698 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-14 12:26:44.173 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-14 12:26:44.243 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-14 12:54:44.682 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.search 4 0 2015-02-14 13:19:07.507 +!MESSAGE Problems encountered during text search. +!SUBENTRY 1 org.eclipse.search 4 4 2015-02-14 13:19:07.517 +!MESSAGE File 'Minecraft/eclipse/.recommenders/index/http___download_eclipse_org_recommenders_models_luna_/write.lock' has been skipped, problem while reading: ('The process cannot access the file because another process has locked a portion of the file'). +!STACK 0 +java.io.IOException: The process cannot access the file because another process has locked a portion of the file + at java.io.FileInputStream.readBytes(Native Method) + at java.io.FileInputStream.read(Unknown Source) + at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) + at sun.nio.cs.StreamDecoder.implRead(Unknown Source) + at sun.nio.cs.StreamDecoder.read(Unknown Source) + at java.io.InputStreamReader.read(Unknown Source) + at java.io.Reader.read(Unknown Source) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$Buffer.fill(FileCharSequenceProvider.java:172) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.fillBuffer(FileCharSequenceProvider.java:385) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.getBuffer(FileCharSequenceProvider.java:358) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.charAt(FileCharSequenceProvider.java:414) + at org.eclipse.search.internal.core.text.TextSearchVisitor.hasBinaryContent(TextSearchVisitor.java:320) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFile(TextSearchVisitor.java:261) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFiles(TextSearchVisitor.java:196) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:172) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:184) + at org.eclipse.search.core.text.TextSearchEngine$1.search(TextSearchEngine.java:56) + at org.eclipse.search.internal.ui.text.FileSearchQuery.run(FileSearchQuery.java:190) + at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 1 org.eclipse.search 4 4 2015-02-14 13:19:07.518 +!MESSAGE File 'Minecraft/eclipse/.metadata/.lock' has been skipped, problem while reading: ('The process cannot access the file because another process has locked a portion of the file'). +!STACK 0 +java.io.IOException: The process cannot access the file because another process has locked a portion of the file + at java.io.FileInputStream.readBytes(Native Method) + at java.io.FileInputStream.read(Unknown Source) + at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) + at sun.nio.cs.StreamDecoder.implRead(Unknown Source) + at sun.nio.cs.StreamDecoder.read(Unknown Source) + at java.io.InputStreamReader.read(Unknown Source) + at java.io.Reader.read(Unknown Source) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$Buffer.fill(FileCharSequenceProvider.java:172) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.fillBuffer(FileCharSequenceProvider.java:385) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.getBuffer(FileCharSequenceProvider.java:358) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.charAt(FileCharSequenceProvider.java:414) + at org.eclipse.search.internal.core.text.TextSearchVisitor.hasBinaryContent(TextSearchVisitor.java:320) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFile(TextSearchVisitor.java:261) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFiles(TextSearchVisitor.java:196) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:172) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:184) + at org.eclipse.search.core.text.TextSearchEngine$1.search(TextSearchEngine.java:56) + at org.eclipse.search.internal.ui.text.FileSearchQuery.run(FileSearchQuery.java:190) + at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-14 13:32:13.693 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-14 13:36:36.823 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-14 15:00:21.140 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-14 15:04:57.068 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-14 15:26:28.198 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-02-14 20:55:20.406 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-14 20:55:34.208 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-14 20:55:56.603 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-14 20:55:56.706 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-14 21:09:56.580 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-14 21:11:21.438 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-14 21:30:23.258 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-14 21:35:20.401 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-14 21:35:56.443 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.core.jobs 2 2 2015-02-14 22:26:58.588 +!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.core.internal.refresh.RefreshJob +!SESSION 2015-02-15 00:39:35.540 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-15 00:39:38.456 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-15 00:39:39.930 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-15 00:39:58.273 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-15 00:39:58.496 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-15 00:53:15.504 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-15 00:54:44.719 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-15 00:59:09.117 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.core.resources 4 566 2015-02-15 03:13:03.896 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-15 03:13:03.936 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/tmp/expandedArchives/fmlpatches.zip_3ip7jb846mit1s70albqunfgbe/net]) +!SESSION 2015-02-16 22:51:25.787 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-16 22:51:36.242 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-16 22:51:38.331 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-16 22:52:08.748 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-16 22:52:08.898 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-16 23:13:18.736 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-16 23:21:42.059 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-17 00:42:44.220 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-02-20 14:31:01.785 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-20 14:31:08.755 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-20 14:31:12.139 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-20 14:31:37.719 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-20 14:31:37.791 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-02-20 17:51:10.093 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-20 17:51:13.529 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-20 17:51:14.656 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-20 17:51:29.013 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-20 17:51:29.226 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-20 19:41:43.792 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-20 19:41:48.638 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.search 4 0 2015-02-20 21:09:15.831 +!MESSAGE Problems encountered during text search. +!SUBENTRY 1 org.eclipse.search 4 4 2015-02-20 21:09:15.831 +!MESSAGE File 'Minecraft/eclipse/.recommenders/index/http___download_eclipse_org_recommenders_models_luna_/write.lock' has been skipped, problem while reading: ('The process cannot access the file because another process has locked a portion of the file'). +!STACK 0 +java.io.IOException: The process cannot access the file because another process has locked a portion of the file + at java.io.FileInputStream.readBytes(Native Method) + at java.io.FileInputStream.read(Unknown Source) + at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) + at sun.nio.cs.StreamDecoder.implRead(Unknown Source) + at sun.nio.cs.StreamDecoder.read(Unknown Source) + at java.io.InputStreamReader.read(Unknown Source) + at java.io.Reader.read(Unknown Source) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$Buffer.fill(FileCharSequenceProvider.java:172) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.fillBuffer(FileCharSequenceProvider.java:385) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.getBuffer(FileCharSequenceProvider.java:358) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.charAt(FileCharSequenceProvider.java:414) + at org.eclipse.search.internal.core.text.TextSearchVisitor.hasBinaryContent(TextSearchVisitor.java:320) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFile(TextSearchVisitor.java:261) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFiles(TextSearchVisitor.java:196) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:172) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:184) + at org.eclipse.search.core.text.TextSearchEngine$1.search(TextSearchEngine.java:56) + at org.eclipse.search.internal.ui.text.FileSearchQuery.run(FileSearchQuery.java:190) + at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 1 org.eclipse.search 4 4 2015-02-20 21:09:15.831 +!MESSAGE File 'Minecraft/eclipse/.metadata/.lock' has been skipped, problem while reading: ('The process cannot access the file because another process has locked a portion of the file'). +!STACK 0 +java.io.IOException: The process cannot access the file because another process has locked a portion of the file + at java.io.FileInputStream.readBytes(Native Method) + at java.io.FileInputStream.read(Unknown Source) + at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) + at sun.nio.cs.StreamDecoder.implRead(Unknown Source) + at sun.nio.cs.StreamDecoder.read(Unknown Source) + at java.io.InputStreamReader.read(Unknown Source) + at java.io.Reader.read(Unknown Source) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$Buffer.fill(FileCharSequenceProvider.java:172) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.fillBuffer(FileCharSequenceProvider.java:385) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.getBuffer(FileCharSequenceProvider.java:358) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.charAt(FileCharSequenceProvider.java:414) + at org.eclipse.search.internal.core.text.TextSearchVisitor.hasBinaryContent(TextSearchVisitor.java:320) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFile(TextSearchVisitor.java:261) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFiles(TextSearchVisitor.java:196) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:172) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:184) + at org.eclipse.search.core.text.TextSearchEngine$1.search(TextSearchEngine.java:56) + at org.eclipse.search.internal.ui.text.FileSearchQuery.run(FileSearchQuery.java:190) + at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.recommenders.rcp 4 5 2015-02-20 21:17:14.139 +!MESSAGE Failed to resolve selection in ‘=Minecraft/src\/main\/java Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-21 12:06:25.904 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-21 13:41:28.999 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.core.resources 4 566 2015-02-21 14:56:02.599 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-21 14:56:02.631 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/tmp/expandedArchives/fmlpatches.zip_3kqkbf8il9agegljl2p3vei0li/net]) +!SESSION 2015-02-22 13:56:24.990 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-22 13:56:32.631 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-22 13:56:34.645 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-22 13:57:00.937 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-22 13:57:01.019 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-02-24 11:31:42.323 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-24 11:31:45.888 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-24 11:31:47.362 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-24 11:32:12.468 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-24 11:32:12.527 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-24 12:06:15.220 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-24 12:06:33.930 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-24 12:12:54.405 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-24 12:13:42.481 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-02-24 12:18:03.278 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-02-26 23:07:00.374 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-26 23:07:08.360 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-26 23:07:10.394 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-26 23:07:36.077 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-26 23:07:36.224 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-03-02 14:43:40.892 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-02 14:43:47.688 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-02 14:43:49.365 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-02 14:44:13.717 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-02 14:44:13.873 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 1 2015-03-02 18:33:33.005 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-03-02 18:33:33.007 +!MESSAGE Problem finding next change, code: 21 + +!ENTRY org.eclipse.core.resources 4 1 2015-03-02 18:33:36.879 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-03-02 18:33:36.879 +!MESSAGE Problem finding next change, code: 21 + +!ENTRY org.eclipse.core.resources 4 1 2015-03-02 18:33:40.290 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-03-02 18:33:40.290 +!MESSAGE Problem finding next change, code: 21 +!SESSION 2015-03-02 18:42:06.287 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-02 18:42:11.350 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-02 18:42:34.526 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-02 18:42:34.669 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-03-02 18:51:20.661 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-03-02 18:51:20.691 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/tmp/recompCls/cpw/mods/fml/common]) + +!ENTRY org.eclipse.core.jobs 2 2 2015-03-02 18:51:20.992 +!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.core.internal.events.NotificationManager$NotifyJob +!SESSION 2015-03-05 21:33:47.343 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-05 21:36:47.688 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-05 21:37:08.554 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-05 21:37:08.721 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.ui.workbench 4 0 2015-03-05 21:49:37.201 +!MESSAGE startLine (59) does not match endLine (61) +!STACK 0 +java.lang.IllegalStateException: startLine (59) does not match endLine (61) + at org.eclipse.jface.text.projection.ProjectionMapping.toImageLine(ProjectionMapping.java:480) + at org.eclipse.jface.text.TextViewer.modelLine2WidgetLine(TextViewer.java:5320) + at org.eclipse.jface.text.source.MatchingCharacterPainter.handleDrawRequest(MatchingCharacterPainter.java:217) + at org.eclipse.jface.text.source.MatchingCharacterPainter.paintControl(MatchingCharacterPainter.java:187) + at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:230) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.VtblCall(Native Method) + at org.eclipse.swt.internal.ole.win32.IPersistFile.IsDirty(IPersistFile.java:19) + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:855) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.WorkbenchPage.getDirtyParts(WorkbenchPage.java:3551) + at org.eclipse.ui.internal.handlers.SaveAllHandler.evaluate(SaveAllHandler.java:68) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationService.requestEvaluation(EvaluationService.java:356) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.update(DirtyStateTracker.java:45) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.propertyChanged(DirtyStateTracker.java:173) + at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:132) + at org.eclipse.ui.texteditor.AbstractTextEditor.firePropertyChange(AbstractTextEditor.java:6387) + at org.eclipse.ui.texteditor.AbstractTextEditor$3.run(AbstractTextEditor.java:436) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.execute(AbstractTextEditor.java:600) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.elementDirtyStateChanged(AbstractTextEditor.java:439) + at org.eclipse.ui.editors.text.TextFileDocumentProvider$FileBufferListener.dirtyStateChanged(TextFileDocumentProvider.java:288) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager$3.run(TextFileBufferManager.java:706) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireDirtyStateChanged(TextFileBufferManager.java:704) + at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer$DocumentListener.documentChanged(ResourceTextFileBuffer.java:79) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) + at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) + at org.eclipse.text.undo.DocumentUndoManager$UndoableTextChange.undoTextChange(DocumentUndoManager.java:144) + at org.eclipse.text.undo.DocumentUndoManager$UndoableTextChange.undo(DocumentUndoManager.java:264) + at org.eclipse.core.commands.operations.DefaultOperationHistory.doUndo(DefaultOperationHistory.java:417) + at org.eclipse.core.commands.operations.DefaultOperationHistory.undo(DefaultOperationHistory.java:1282) + at org.eclipse.ui.operations.UndoActionHandler.runCommand(UndoActionHandler.java:87) + at org.eclipse.ui.operations.OperationHistoryActionHandler$1.run(OperationHistoryActionHandler.java:318) + at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466) + at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374) + at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:527) + at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog.access$6(TimeTriggeredProgressMonitorDialog.java:1) + at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog$2.run(TimeTriggeredProgressMonitorDialog.java:214) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog.run(TimeTriggeredProgressMonitorDialog.java:227) + at org.eclipse.ui.operations.OperationHistoryActionHandler.run(OperationHistoryActionHandler.java:333) + at org.eclipse.jface.action.Action.runWithEvent(Action.java:519) + at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122) + at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) + at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149) + at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499) + at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) + at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:378) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:324) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:86) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1060) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1112) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108) + at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1529) + at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4722) + at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:343) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4610) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.search 4 0 2015-03-05 22:14:43.255 +!MESSAGE Problems encountered during text search. +!SUBENTRY 1 org.eclipse.search 4 4 2015-03-05 22:14:43.255 +!MESSAGE File 'Minecraft/eclipse/.recommenders/index/http___download_eclipse_org_recommenders_models_luna_/write.lock' has been skipped, problem while reading: ('The process cannot access the file because another process has locked a portion of the file'). +!STACK 0 +java.io.IOException: The process cannot access the file because another process has locked a portion of the file + at java.io.FileInputStream.readBytes(Native Method) + at java.io.FileInputStream.read(Unknown Source) + at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) + at sun.nio.cs.StreamDecoder.implRead(Unknown Source) + at sun.nio.cs.StreamDecoder.read(Unknown Source) + at java.io.InputStreamReader.read(Unknown Source) + at java.io.Reader.read(Unknown Source) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$Buffer.fill(FileCharSequenceProvider.java:172) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.fillBuffer(FileCharSequenceProvider.java:385) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.getBuffer(FileCharSequenceProvider.java:358) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.charAt(FileCharSequenceProvider.java:414) + at org.eclipse.search.internal.core.text.TextSearchVisitor.hasBinaryContent(TextSearchVisitor.java:320) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFile(TextSearchVisitor.java:261) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFiles(TextSearchVisitor.java:196) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:172) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:184) + at org.eclipse.search.core.text.TextSearchEngine$1.search(TextSearchEngine.java:56) + at org.eclipse.search.internal.ui.text.FileSearchQuery.run(FileSearchQuery.java:190) + at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SUBENTRY 1 org.eclipse.search 4 4 2015-03-05 22:14:43.255 +!MESSAGE File 'Minecraft/eclipse/.metadata/.lock' has been skipped, problem while reading: ('The process cannot access the file because another process has locked a portion of the file'). +!STACK 0 +java.io.IOException: The process cannot access the file because another process has locked a portion of the file + at java.io.FileInputStream.readBytes(Native Method) + at java.io.FileInputStream.read(Unknown Source) + at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) + at sun.nio.cs.StreamDecoder.implRead(Unknown Source) + at sun.nio.cs.StreamDecoder.read(Unknown Source) + at java.io.InputStreamReader.read(Unknown Source) + at java.io.Reader.read(Unknown Source) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$Buffer.fill(FileCharSequenceProvider.java:172) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.fillBuffer(FileCharSequenceProvider.java:385) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.getBuffer(FileCharSequenceProvider.java:358) + at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.charAt(FileCharSequenceProvider.java:414) + at org.eclipse.search.internal.core.text.TextSearchVisitor.hasBinaryContent(TextSearchVisitor.java:320) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFile(TextSearchVisitor.java:261) + at org.eclipse.search.internal.core.text.TextSearchVisitor.processFiles(TextSearchVisitor.java:196) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:172) + at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:184) + at org.eclipse.search.core.text.TextSearchEngine$1.search(TextSearchEngine.java:56) + at org.eclipse.search.internal.ui.text.FileSearchQuery.run(FileSearchQuery.java:190) + at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) + +!ENTRY org.eclipse.ui.workbench 4 0 2015-03-05 22:17:55.851 +!MESSAGE startLine (50) does not match endLine (51) +!STACK 0 +java.lang.IllegalStateException: startLine (50) does not match endLine (51) + at org.eclipse.jface.text.projection.ProjectionMapping.toImageLine(ProjectionMapping.java:480) + at org.eclipse.jface.text.TextViewer.modelLine2WidgetLine(TextViewer.java:5320) + at org.eclipse.jface.text.source.MatchingCharacterPainter.handleDrawRequest(MatchingCharacterPainter.java:217) + at org.eclipse.jface.text.source.MatchingCharacterPainter.paintControl(MatchingCharacterPainter.java:187) + at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:230) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.VtblCall(Native Method) + at org.eclipse.swt.internal.ole.win32.IPersistFile.IsDirty(IPersistFile.java:19) + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:855) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.WorkbenchPage.getDirtyParts(WorkbenchPage.java:3551) + at org.eclipse.ui.internal.handlers.SaveAllHandler.evaluate(SaveAllHandler.java:68) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationService.requestEvaluation(EvaluationService.java:356) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.update(DirtyStateTracker.java:45) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.propertyChanged(DirtyStateTracker.java:173) + at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:132) + at org.eclipse.ui.texteditor.AbstractTextEditor.firePropertyChange(AbstractTextEditor.java:6387) + at org.eclipse.ui.texteditor.AbstractTextEditor$3.run(AbstractTextEditor.java:436) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.execute(AbstractTextEditor.java:600) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.elementDirtyStateChanged(AbstractTextEditor.java:439) + at org.eclipse.ui.editors.text.TextFileDocumentProvider$FileBufferListener.dirtyStateChanged(TextFileDocumentProvider.java:288) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager$3.run(TextFileBufferManager.java:706) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireDirtyStateChanged(TextFileBufferManager.java:704) + at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer$DocumentListener.documentChanged(ResourceTextFileBuffer.java:79) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) + at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:180) + at org.eclipse.jface.text.projection.ProjectionTextStore.replace(ProjectionTextStore.java:111) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1184) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.jface.text.projection.ProjectionDocument.replace(ProjectionDocument.java:629) + at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:248) + at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7268) + at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:8111) + at org.eclipse.swt.custom.StyledText.paste(StyledText.java:7324) + at org.eclipse.jface.text.TextViewer.paste(TextViewer.java:4100) + at org.eclipse.jface.text.TextViewer.doOperation(TextViewer.java:4029) + at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:1018) + at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1501) + at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:191) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:200) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.doPasteWithImportsOperation(ClipboardOperationAction.java:544) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.internalDoOperation(ClipboardOperationAction.java:328) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction$1.run(ClipboardOperationAction.java:278) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.run(ClipboardOperationAction.java:276) + at org.eclipse.jface.action.Action.runWithEvent(Action.java:519) + at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122) + at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90) + at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) + at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149) + at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499) + at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) + at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:378) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:324) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:86) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1060) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1112) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108) + at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1529) + at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4722) + at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:343) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4610) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.ui.workbench 4 0 2015-03-05 22:46:30.201 +!MESSAGE startLine (201) does not match endLine (202) +!STACK 0 +java.lang.IllegalStateException: startLine (201) does not match endLine (202) + at org.eclipse.jface.text.projection.ProjectionMapping.toImageLine(ProjectionMapping.java:480) + at org.eclipse.jface.text.TextViewer.modelLine2WidgetLine(TextViewer.java:5320) + at org.eclipse.jface.text.source.MatchingCharacterPainter.handleDrawRequest(MatchingCharacterPainter.java:217) + at org.eclipse.jface.text.source.MatchingCharacterPainter.paintControl(MatchingCharacterPainter.java:187) + at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:230) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.VtblCall(Native Method) + at org.eclipse.swt.internal.ole.win32.IPersistFile.IsDirty(IPersistFile.java:19) + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:855) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.WorkbenchPage.getDirtyParts(WorkbenchPage.java:3551) + at org.eclipse.ui.internal.handlers.SaveAllHandler.evaluate(SaveAllHandler.java:68) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationService.requestEvaluation(EvaluationService.java:356) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.update(DirtyStateTracker.java:45) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.propertyChanged(DirtyStateTracker.java:173) + at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:132) + at org.eclipse.ui.texteditor.AbstractTextEditor.firePropertyChange(AbstractTextEditor.java:6387) + at org.eclipse.ui.texteditor.AbstractTextEditor$3.run(AbstractTextEditor.java:436) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.execute(AbstractTextEditor.java:600) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.elementDirtyStateChanged(AbstractTextEditor.java:439) + at org.eclipse.ui.editors.text.TextFileDocumentProvider$FileBufferListener.dirtyStateChanged(TextFileDocumentProvider.java:288) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager$3.run(TextFileBufferManager.java:706) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireDirtyStateChanged(TextFileBufferManager.java:704) + at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer$DocumentListener.documentChanged(ResourceTextFileBuffer.java:79) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) + at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:180) + at org.eclipse.jface.text.projection.ProjectionTextStore.replace(ProjectionTextStore.java:111) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1184) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.jface.text.projection.ProjectionDocument.replace(ProjectionDocument.java:629) + at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:248) + at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7268) + at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:8111) + at org.eclipse.swt.custom.StyledText.doContent(StyledText.java:2481) + at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5955) + at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5986) + at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5663) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1112) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108) + at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1529) + at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4722) + at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:343) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4610) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.ui.workbench 4 0 2015-03-05 23:08:29.358 +!MESSAGE startLine (99) does not match endLine (100) +!STACK 0 +java.lang.IllegalStateException: startLine (99) does not match endLine (100) + at org.eclipse.jface.text.projection.ProjectionMapping.toImageLine(ProjectionMapping.java:480) + at org.eclipse.jface.text.TextViewer.modelLine2WidgetLine(TextViewer.java:5320) + at org.eclipse.jface.text.source.MatchingCharacterPainter.handleDrawRequest(MatchingCharacterPainter.java:217) + at org.eclipse.jface.text.source.MatchingCharacterPainter.paintControl(MatchingCharacterPainter.java:187) + at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:230) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.VtblCall(Native Method) + at org.eclipse.swt.internal.ole.win32.IPersistFile.IsDirty(IPersistFile.java:19) + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:855) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.WorkbenchPage.getDirtyParts(WorkbenchPage.java:3551) + at org.eclipse.ui.internal.handlers.SaveAllHandler.evaluate(SaveAllHandler.java:68) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationService.requestEvaluation(EvaluationService.java:356) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.update(DirtyStateTracker.java:45) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.propertyChanged(DirtyStateTracker.java:173) + at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:132) + at org.eclipse.ui.texteditor.AbstractTextEditor.firePropertyChange(AbstractTextEditor.java:6387) + at org.eclipse.ui.texteditor.AbstractTextEditor$3.run(AbstractTextEditor.java:436) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.execute(AbstractTextEditor.java:600) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.elementDirtyStateChanged(AbstractTextEditor.java:439) + at org.eclipse.ui.editors.text.TextFileDocumentProvider$FileBufferListener.dirtyStateChanged(TextFileDocumentProvider.java:288) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager$3.run(TextFileBufferManager.java:706) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireDirtyStateChanged(TextFileBufferManager.java:704) + at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer$DocumentListener.documentChanged(ResourceTextFileBuffer.java:79) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) + at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:180) + at org.eclipse.jface.text.projection.ProjectionTextStore.replace(ProjectionTextStore.java:111) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1184) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.jface.text.projection.ProjectionDocument.replace(ProjectionDocument.java:629) + at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:248) + at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7268) + at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:8111) + at org.eclipse.swt.custom.StyledText.paste(StyledText.java:7324) + at org.eclipse.jface.text.TextViewer.paste(TextViewer.java:4100) + at org.eclipse.jface.text.TextViewer.doOperation(TextViewer.java:4029) + at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:1018) + at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1501) + at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:191) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:200) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.doPasteWithImportsOperation(ClipboardOperationAction.java:544) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.internalDoOperation(ClipboardOperationAction.java:328) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction$1.run(ClipboardOperationAction.java:278) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.run(ClipboardOperationAction.java:276) + at org.eclipse.jface.action.Action.runWithEvent(Action.java:519) + at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122) + at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90) + at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) + at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149) + at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499) + at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) + at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:378) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:324) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:86) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1060) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1112) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108) + at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1529) + at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4722) + at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:343) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4610) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) diff --git a/eclipse/.metadata/.lock b/eclipse/.metadata/.lock new file mode 100644 index 0000000..e69de29 diff --git a/eclipse/.metadata/.log b/eclipse/.metadata/.log new file mode 100644 index 0000000..6307fef --- /dev/null +++ b/eclipse/.metadata/.log @@ -0,0 +1,3678 @@ +!SESSION 2015-03-05 21:33:47.343 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +This is a continuation of log file H:\Jewelrycraft\1.7.10\eclipse\.metadata\.bak_0.log +Created Time: 2015-03-05 23:33:15.813 + +!ENTRY org.eclipse.core.jobs 2 2 2015-03-05 23:33:15.902 +!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.core.internal.refresh.RefreshJob +!SESSION 2015-03-06 00:10:41.793 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-06 00:10:52.269 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-06 00:10:52.975 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-06 00:11:03.545 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-06 00:11:03.714 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-03-06 00:20:20.585 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-03-06 00:20:20.614 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/eclipse/saves/Village]) +!SESSION 2015-03-06 00:20:32.944 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-06 00:20:35.050 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-06 00:20:35.623 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-06 00:20:46.027 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-06 00:20:46.212 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-03-06 13:06:21.808 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-06 13:06:33.462 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-06 13:06:34.578 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-06 13:06:49.608 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-06 13:06:49.811 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-03-06 19:32:27.066 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-06 19:32:30.522 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-06 19:32:31.318 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-06 19:32:44.462 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-06 19:32:44.542 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.e4.ui.workbench.swt 4 2 2015-03-06 23:25:44.848 +!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.e4.ui.workbench.swt". +!STACK 0 +java.lang.NullPointerException + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:851) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.handlers.SaveHandler.evaluate(SaveHandler.java:92) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationReference.changed(EvaluationReference.java:131) + at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:110) + at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:338) + at org.eclipse.e4.core.internal.contexts.EclipseContext.remove(EclipseContext.java:312) + at org.eclipse.ui.internal.services.EvaluationService$1.changed(EvaluationService.java:73) + at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:110) + at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:338) + at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:352) + at org.eclipse.e4.core.internal.contexts.EclipseContext.deactivate(EclipseContext.java:650) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.clearContext(PartRenderingEngine.java:970) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeRemoveGui(PartRenderingEngine.java:954) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$3(PartRenderingEngine.java:862) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$8.run(PartRenderingEngine.java:857) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.removeGui(PartRenderingEngine.java:841) + at org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchWindow.java:1937) + at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:1560) + at org.eclipse.ui.internal.WorkbenchWindow.access$15(WorkbenchWindow.java:1527) + at org.eclipse.ui.internal.WorkbenchWindow$10.run(WorkbenchWindow.java:1592) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:1589) + at org.eclipse.ui.internal.Workbench$14.run(Workbench.java:1155) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:1137) + at org.eclipse.ui.internal.Workbench.access$21(Workbench.java:1079) + at org.eclipse.ui.internal.Workbench$19.run(Workbench.java:1410) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.ui.internal.Workbench.close(Workbench.java:1407) + at org.eclipse.ui.internal.Workbench.close(Workbench.java:1380) + at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:1556) + at org.eclipse.ui.internal.WorkbenchWindow.access$15(WorkbenchWindow.java:1527) + at org.eclipse.ui.internal.WorkbenchWindow$10.run(WorkbenchWindow.java:1592) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:1589) + at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:1603) + at org.eclipse.ui.internal.WorkbenchWindow$6.close(WorkbenchWindow.java:521) + at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer$11.shellClosed(WBWRenderer.java:564) + at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:98) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Decorations.closeWidget(Decorations.java:308) + at org.eclipse.swt.widgets.Decorations.WM_CLOSE(Decorations.java:1696) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4612) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1626) + at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) + at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544) + at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:498) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1626) + at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) + at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544) + at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:498) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1626) + at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2015-03-06 23:25:44.918 +!MESSAGE Exception occurred while unrendering: org.eclipse.e4.ui.model.application.ui.basic.impl.TrimmedWindowImpl@46963479 (elementId: IDEWindow, tags: [topLevel, shellMaximized], contributorURI: platform:/plugin/org.eclipse.ui.workbench) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (label: null, iconURI: null, tooltip: null, context: TrimmedWindowImpl (IDEWindow) Context, variables: [], x: 0, y: 0, width: 974, height: 1047) +!STACK 0 +java.lang.NullPointerException + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:851) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.handlers.SaveHandler.evaluate(SaveHandler.java:92) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationReference.changed(EvaluationReference.java:131) + at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:110) + at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:338) + at org.eclipse.e4.core.internal.contexts.EclipseContext.remove(EclipseContext.java:312) + at org.eclipse.ui.internal.services.EvaluationService$1.changed(EvaluationService.java:73) + at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:110) + at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:338) + at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:352) + at org.eclipse.e4.core.internal.contexts.EclipseContext.deactivate(EclipseContext.java:650) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.clearContext(PartRenderingEngine.java:970) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeRemoveGui(PartRenderingEngine.java:954) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$3(PartRenderingEngine.java:862) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$8.run(PartRenderingEngine.java:857) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.removeGui(PartRenderingEngine.java:841) + at org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchWindow.java:1937) + at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:1560) + at org.eclipse.ui.internal.WorkbenchWindow.access$15(WorkbenchWindow.java:1527) + at org.eclipse.ui.internal.WorkbenchWindow$10.run(WorkbenchWindow.java:1592) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:1589) + at org.eclipse.ui.internal.Workbench$14.run(Workbench.java:1155) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:1137) + at org.eclipse.ui.internal.Workbench.access$21(Workbench.java:1079) + at org.eclipse.ui.internal.Workbench$19.run(Workbench.java:1410) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.ui.internal.Workbench.close(Workbench.java:1407) + at org.eclipse.ui.internal.Workbench.close(Workbench.java:1380) + at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:1556) + at org.eclipse.ui.internal.WorkbenchWindow.access$15(WorkbenchWindow.java:1527) + at org.eclipse.ui.internal.WorkbenchWindow$10.run(WorkbenchWindow.java:1592) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:1589) + at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:1603) + at org.eclipse.ui.internal.WorkbenchWindow$6.close(WorkbenchWindow.java:521) + at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer$11.shellClosed(WBWRenderer.java:564) + at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:98) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Decorations.closeWidget(Decorations.java:308) + at org.eclipse.swt.widgets.Decorations.WM_CLOSE(Decorations.java:1696) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4612) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1626) + at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) + at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544) + at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:498) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1626) + at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) + at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544) + at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:498) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1626) + at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-03-07 14:57:05.620 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-07 14:57:19.229 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-07 14:57:34.677 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-07 14:57:34.830 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-07 15:47:21.457 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.ui.workbench 4 0 2015-03-07 17:36:49.846 +!MESSAGE An unexpected exception was thrown. +!STACK 0 +java.lang.IllegalStateException + at org.eclipse.jface.text.projection.ProjectionTextStore.internalError(ProjectionTextStore.java:85) + at org.eclipse.jface.text.projection.ProjectionTextStore.get(ProjectionTextStore.java:152) + at org.eclipse.jface.text.AbstractDocument.get(AbstractDocument.java:1039) + at org.eclipse.jface.text.DefaultDocumentAdapter.doGetLine(DefaultDocumentAdapter.java:150) + at org.eclipse.jface.text.DefaultDocumentAdapter.getLine(DefaultDocumentAdapter.java:173) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:774) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:720) + at org.eclipse.swt.custom.StyledTextRenderer.drawLine(StyledTextRenderer.java:364) + at org.eclipse.swt.custom.StyledText.handlePaint(StyledText.java:6133) + at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5669) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.VtblCall(Native Method) + at org.eclipse.swt.internal.ole.win32.IPersistFile.IsDirty(IPersistFile.java:19) + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:855) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.WorkbenchPage.getDirtyParts(WorkbenchPage.java:3551) + at org.eclipse.ui.internal.handlers.SaveAllHandler.evaluate(SaveAllHandler.java:68) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationService.requestEvaluation(EvaluationService.java:356) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.update(DirtyStateTracker.java:45) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.propertyChanged(DirtyStateTracker.java:173) + at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:132) + at org.eclipse.ui.texteditor.AbstractTextEditor.firePropertyChange(AbstractTextEditor.java:6387) + at org.eclipse.ui.texteditor.AbstractTextEditor$3.run(AbstractTextEditor.java:436) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.execute(AbstractTextEditor.java:600) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.elementDirtyStateChanged(AbstractTextEditor.java:439) + at org.eclipse.ui.editors.text.TextFileDocumentProvider$FileBufferListener.dirtyStateChanged(TextFileDocumentProvider.java:288) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager$3.run(TextFileBufferManager.java:706) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireDirtyStateChanged(TextFileBufferManager.java:704) + at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer$DocumentListener.documentChanged(ResourceTextFileBuffer.java:79) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) + at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:180) + at org.eclipse.jface.text.projection.ProjectionTextStore.replace(ProjectionTextStore.java:111) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1184) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.jface.text.projection.ProjectionDocument.replace(ProjectionDocument.java:629) + at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:248) + at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7268) + at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:8111) + at org.eclipse.swt.custom.StyledText.doDelete(StyledText.java:2544) + at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:7061) + at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1464) + at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:191) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:200) + at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:128) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:126) + at org.eclipse.jface.action.Action.runWithEvent(Action.java:519) + at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122) + at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90) + at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) + at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149) + at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499) + at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) + at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558) + at org.eclipse.e4.ui.bindings.keys.OutOfOrderListener.handleEvent(OutOfOrderListener.java:72) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1112) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108) + at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1831) + at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4975) + at org.eclipse.swt.widgets.Canvas.WM_KEYDOWN(Canvas.java:428) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4642) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.ui.workbench 4 0 2015-03-07 17:42:39.918 +!MESSAGE An unexpected exception was thrown. +!STACK 0 +java.lang.IllegalStateException + at org.eclipse.jface.text.projection.ProjectionTextStore.internalError(ProjectionTextStore.java:85) + at org.eclipse.jface.text.projection.ProjectionTextStore.get(ProjectionTextStore.java:152) + at org.eclipse.jface.text.AbstractDocument.get(AbstractDocument.java:1039) + at org.eclipse.jface.text.DefaultDocumentAdapter.doGetLine(DefaultDocumentAdapter.java:150) + at org.eclipse.jface.text.DefaultDocumentAdapter.getLine(DefaultDocumentAdapter.java:173) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:774) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:720) + at org.eclipse.swt.custom.StyledText.getOffsetAtPoint(StyledText.java:4474) + at org.eclipse.swt.custom.StyledText.getOffsetAtLocation(StyledText.java:4414) + at org.eclipse.jface.text.source.AnnotationPainter.computeClippingRegion(AnnotationPainter.java:1498) + at org.eclipse.jface.text.source.AnnotationPainter.handleDrawRequest(AnnotationPainter.java:1370) + at org.eclipse.jface.text.source.AnnotationPainter.paintControl(AnnotationPainter.java:1355) + at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:230) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.VtblCall(Native Method) + at org.eclipse.swt.internal.ole.win32.IPersistFile.IsDirty(IPersistFile.java:19) + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:855) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.WorkbenchPage.getDirtyParts(WorkbenchPage.java:3551) + at org.eclipse.ui.internal.handlers.SaveAllHandler.evaluate(SaveAllHandler.java:68) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationService.requestEvaluation(EvaluationService.java:356) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.update(DirtyStateTracker.java:45) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.propertyChanged(DirtyStateTracker.java:173) + at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:132) + at org.eclipse.ui.texteditor.AbstractTextEditor.firePropertyChange(AbstractTextEditor.java:6387) + at org.eclipse.ui.texteditor.AbstractTextEditor$3.run(AbstractTextEditor.java:436) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.execute(AbstractTextEditor.java:600) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.elementDirtyStateChanged(AbstractTextEditor.java:439) + at org.eclipse.ui.editors.text.TextFileDocumentProvider$FileBufferListener.dirtyStateChanged(TextFileDocumentProvider.java:288) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager$3.run(TextFileBufferManager.java:706) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireDirtyStateChanged(TextFileBufferManager.java:704) + at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer$DocumentListener.documentChanged(ResourceTextFileBuffer.java:79) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) + at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:180) + at org.eclipse.text.edits.DeleteEdit.performDocumentUpdating(DeleteEdit.java:64) + at org.eclipse.text.edits.TextEdit.traverseDocumentUpdating(TextEdit.java:917) + at org.eclipse.text.edits.TextEditProcessor.executeDo(TextEditProcessor.java:194) + at org.eclipse.text.edits.TextEdit.dispatchPerformEdits(TextEdit.java:739) + at org.eclipse.text.edits.TextEditProcessor.performEdits(TextEditProcessor.java:156) + at org.eclipse.text.edits.TextEdit.apply(TextEdit.java:711) + at org.eclipse.jface.internal.text.SelectionProcessor.doDelete(SelectionProcessor.java:686) + at org.eclipse.jface.text.source.projection.ProjectionViewer.deleteSelection(ProjectionViewer.java:1608) + at org.eclipse.jface.text.source.projection.ProjectionViewer.copyToClipboard(ProjectionViewer.java:1592) + at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1439) + at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:191) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:200) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.doCutCopyWithImportsOperation(ClipboardOperationAction.java:380) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.internalDoOperation(ClipboardOperationAction.java:330) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction$1.run(ClipboardOperationAction.java:278) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.run(ClipboardOperationAction.java:276) + at org.eclipse.jface.action.Action.runWithEvent(Action.java:519) + at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122) + at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90) + at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) + at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149) + at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499) + at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) + at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:378) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:324) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:86) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1060) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1112) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108) + at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1529) + at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4722) + at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:343) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4610) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.ui.workbench 4 0 2015-03-07 18:18:31.966 +!MESSAGE An unexpected exception was thrown. +!STACK 0 +java.lang.IllegalStateException + at org.eclipse.jface.text.projection.ProjectionTextStore.internalError(ProjectionTextStore.java:85) + at org.eclipse.jface.text.projection.ProjectionTextStore.get(ProjectionTextStore.java:152) + at org.eclipse.jface.text.AbstractDocument.get(AbstractDocument.java:1039) + at org.eclipse.jface.text.DefaultDocumentAdapter.doGetLine(DefaultDocumentAdapter.java:150) + at org.eclipse.jface.text.DefaultDocumentAdapter.getLine(DefaultDocumentAdapter.java:173) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:774) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:720) + at org.eclipse.swt.custom.StyledTextRenderer.drawLine(StyledTextRenderer.java:364) + at org.eclipse.swt.custom.StyledText.handlePaint(StyledText.java:6133) + at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5669) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.VtblCall(Native Method) + at org.eclipse.swt.internal.ole.win32.IPersistFile.IsDirty(IPersistFile.java:19) + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:855) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.WorkbenchPage.getDirtyParts(WorkbenchPage.java:3551) + at org.eclipse.ui.internal.handlers.SaveAllHandler.evaluate(SaveAllHandler.java:68) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationService.requestEvaluation(EvaluationService.java:356) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.update(DirtyStateTracker.java:45) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.propertyChanged(DirtyStateTracker.java:173) + at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:132) + at org.eclipse.ui.texteditor.AbstractTextEditor.firePropertyChange(AbstractTextEditor.java:6387) + at org.eclipse.ui.texteditor.AbstractTextEditor$3.run(AbstractTextEditor.java:436) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.execute(AbstractTextEditor.java:600) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.elementDirtyStateChanged(AbstractTextEditor.java:439) + at org.eclipse.ui.editors.text.TextFileDocumentProvider$FileBufferListener.dirtyStateChanged(TextFileDocumentProvider.java:288) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager$3.run(TextFileBufferManager.java:706) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireDirtyStateChanged(TextFileBufferManager.java:704) + at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer$DocumentListener.documentChanged(ResourceTextFileBuffer.java:79) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) + at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:180) + at org.eclipse.text.edits.DeleteEdit.performDocumentUpdating(DeleteEdit.java:64) + at org.eclipse.text.edits.TextEdit.traverseDocumentUpdating(TextEdit.java:917) + at org.eclipse.text.edits.TextEditProcessor.executeDo(TextEditProcessor.java:194) + at org.eclipse.text.edits.TextEdit.dispatchPerformEdits(TextEdit.java:739) + at org.eclipse.text.edits.TextEditProcessor.performEdits(TextEditProcessor.java:156) + at org.eclipse.text.edits.TextEdit.apply(TextEdit.java:711) + at org.eclipse.jface.internal.text.SelectionProcessor.doDelete(SelectionProcessor.java:686) + at org.eclipse.jface.text.source.projection.ProjectionViewer.deleteSelection(ProjectionViewer.java:1608) + at org.eclipse.jface.text.source.projection.ProjectionViewer.copyToClipboard(ProjectionViewer.java:1592) + at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1439) + at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:191) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:200) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.doCutCopyWithImportsOperation(ClipboardOperationAction.java:380) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.internalDoOperation(ClipboardOperationAction.java:330) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction$1.run(ClipboardOperationAction.java:278) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.run(ClipboardOperationAction.java:276) + at org.eclipse.jface.action.Action.runWithEvent(Action.java:519) + at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122) + at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90) + at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) + at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149) + at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499) + at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) + at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:378) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:324) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:86) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1060) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1112) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108) + at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1529) + at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4722) + at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:343) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4610) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-07 18:20:42.511 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2015-03-08 01:57:50.468 +!MESSAGE Error setting focus to : org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl ScreenHandler.java +!STACK 0 +org.eclipse.swt.SWTException: Widget is disposed + at org.eclipse.swt.SWT.error(SWT.java:4441) + at org.eclipse.swt.SWT.error(SWT.java:4356) + at org.eclipse.swt.SWT.error(SWT.java:4327) + at org.eclipse.swt.widgets.Widget.error(Widget.java:476) + at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:348) + at org.eclipse.swt.widgets.Control.setFocus(Control.java:3320) + at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1039) + at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1039) + at org.eclipse.ui.texteditor.StatusTextEditor.setFocus(StatusTextEditor.java:120) + at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.setFocus(JavaEditor.java:2389) + at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:191) + at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:253) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:225) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:107) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.focusGui(PartRenderingEngine.java:795) + at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$2.setFocus(ContributedPartRenderer.java:100) + at org.eclipse.swt.custom.CTabItem.setFocus(CTabItem.java:332) + at org.eclipse.swt.custom.CTabFolder.setFocus(CTabFolder.java:2555) + at org.eclipse.swt.widgets.Control.fixFocus(Control.java:1052) + at org.eclipse.swt.widgets.Control.setVisible(Control.java:3818) + at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3098) + at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3055) + at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1260) + at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:68) + at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40) + at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187) + at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156) + at org.eclipse.swt.widgets.Display.syncExec(Display.java:4734) + at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:218) + at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36) + at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197) + at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197) + at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1) + at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) + at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) + at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135) + at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78) + at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39) + at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81) + at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:59) + at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374) + at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171) + at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.hidePart(PartServiceImpl.java:1251) + at org.eclipse.ui.internal.WorkbenchPage.hidePart(WorkbenchPage.java:1599) + at org.eclipse.ui.internal.WorkbenchPage.hidePart(WorkbenchPage.java:1550) + at org.eclipse.ui.internal.WorkbenchPage.closeEditors(WorkbenchPage.java:1520) + at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java:1645) + at org.eclipse.ui.texteditor.AbstractTextEditor$23.run(AbstractTextEditor.java:4333) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.rcp 4 6 2015-03-08 01:57:50.707 +!MESSAGE Exception while checking editor offset +!STACK 1 +Java Model Exception: Java Model Status [src.main.java.darkknight.jewelrycraft.events [in [in Minecraft]] does not exist] + at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:544) + at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:247) + at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:505) + at org.eclipse.jdt.internal.core.CompilationUnit.openAncestors(CompilationUnit.java:1173) + at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:241) + at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:557) + at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:294) + at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:280) + at org.eclipse.jdt.internal.core.CompilationUnit.getSourceRange(CompilationUnit.java:908) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.isInvalidSelection(JavaElementSelections.java:176) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromTypeRootInEditor(JavaElementSelections.java:130) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromEditor(JavaElementSelections.java:117) + at org.eclipse.recommenders.internal.rcp.JavaElementSelections.resolveJavaElementFromEditor(JavaElementSelections.java:100) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService.handleSelectionInEditor(JavaElementSelectionService.java:108) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService.access$1(JavaElementSelectionService.java:105) + at org.eclipse.recommenders.internal.rcp.JavaElementSelectionService$1.run(JavaElementSelectionService.java:82) + at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) + at java.util.concurrent.FutureTask.run(Unknown Source) + at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) + at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) + at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) + at java.lang.Thread.run(Unknown Source) +!SUBENTRY 1 org.eclipse.jdt.core 4 969 2015-03-08 01:57:50.707 +!MESSAGE src.main.java.darkknight.jewelrycraft.events [in [in Minecraft]] does not exist + +!ENTRY org.eclipse.core.resources 4 1 2015-03-08 02:11:55.980 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-03-08 02:11:55.980 +!MESSAGE Problem finding next change, code: 21 +!SESSION 2015-03-08 16:12:58.267 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-08 16:13:06.482 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-08 16:13:48.149 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-08 16:13:49.312 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-03-08 16:15:23.013 +!MESSAGE Workspace was not properly initialized or has already shutdown. +!SESSION 2015-03-08 20:50:58.635 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-08 20:51:11.307 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-08 20:51:13.348 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-08 20:51:42.164 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-08 20:51:42.310 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.jobs 2 2 2015-03-08 21:54:31.944 +!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.core.internal.refresh.RefreshJob +!SESSION 2015-03-09 14:28:38.465 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-09 14:28:41.937 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-09 14:28:43.883 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-09 14:29:06.244 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-09 14:29:06.395 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.ui.workbench 4 0 2015-03-09 14:45:41.847 +!MESSAGE An unexpected exception was thrown. +!STACK 0 +java.lang.IllegalStateException + at org.eclipse.jface.text.projection.ProjectionTextStore.internalError(ProjectionTextStore.java:85) + at org.eclipse.jface.text.projection.ProjectionTextStore.get(ProjectionTextStore.java:152) + at org.eclipse.jface.text.AbstractDocument.get(AbstractDocument.java:1039) + at org.eclipse.jface.text.DefaultDocumentAdapter.doGetLine(DefaultDocumentAdapter.java:150) + at org.eclipse.jface.text.DefaultDocumentAdapter.getLine(DefaultDocumentAdapter.java:173) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:774) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:720) + at org.eclipse.swt.custom.StyledTextRenderer.drawLine(StyledTextRenderer.java:364) + at org.eclipse.swt.custom.StyledText.handlePaint(StyledText.java:6133) + at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5669) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.VtblCall(Native Method) + at org.eclipse.swt.internal.ole.win32.IPersistFile.IsDirty(IPersistFile.java:19) + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:855) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.WorkbenchPage.getDirtyParts(WorkbenchPage.java:3551) + at org.eclipse.ui.internal.handlers.SaveAllHandler.evaluate(SaveAllHandler.java:68) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationService.requestEvaluation(EvaluationService.java:356) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.update(DirtyStateTracker.java:45) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.propertyChanged(DirtyStateTracker.java:173) + at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:132) + at org.eclipse.ui.texteditor.AbstractTextEditor.firePropertyChange(AbstractTextEditor.java:6387) + at org.eclipse.ui.texteditor.AbstractTextEditor$3.run(AbstractTextEditor.java:436) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.execute(AbstractTextEditor.java:600) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.elementDirtyStateChanged(AbstractTextEditor.java:439) + at org.eclipse.ui.editors.text.TextFileDocumentProvider$FileBufferListener.dirtyStateChanged(TextFileDocumentProvider.java:288) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager$3.run(TextFileBufferManager.java:706) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireDirtyStateChanged(TextFileBufferManager.java:704) + at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer$DocumentListener.documentChanged(ResourceTextFileBuffer.java:79) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) + at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:180) + at org.eclipse.jface.text.projection.ProjectionTextStore.replace(ProjectionTextStore.java:111) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1184) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.jface.text.projection.ProjectionDocument.replace(ProjectionDocument.java:629) + at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:248) + at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7268) + at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:8111) + at org.eclipse.swt.custom.StyledText.doDelete(StyledText.java:2544) + at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:7061) + at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1464) + at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:191) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:200) + at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:128) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:126) + at org.eclipse.jface.action.Action.runWithEvent(Action.java:519) + at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122) + at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90) + at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) + at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149) + at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499) + at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) + at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558) + at org.eclipse.e4.ui.bindings.keys.OutOfOrderListener.handleEvent(OutOfOrderListener.java:72) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1112) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108) + at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1831) + at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4975) + at org.eclipse.swt.widgets.Canvas.WM_KEYDOWN(Canvas.java:428) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4642) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.ui.workbench 4 0 2015-03-09 15:03:13.452 +!MESSAGE startLine (224) does not match endLine (225) +!STACK 0 +java.lang.IllegalStateException: startLine (224) does not match endLine (225) + at org.eclipse.jface.text.projection.ProjectionMapping.toImageLine(ProjectionMapping.java:480) + at org.eclipse.jface.text.TextViewer.modelLine2WidgetLine(TextViewer.java:5320) + at org.eclipse.jface.text.source.MatchingCharacterPainter.handleDrawRequest(MatchingCharacterPainter.java:217) + at org.eclipse.jface.text.source.MatchingCharacterPainter.paintControl(MatchingCharacterPainter.java:187) + at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:230) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.VtblCall(Native Method) + at org.eclipse.swt.internal.ole.win32.IPersistFile.IsDirty(IPersistFile.java:19) + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:855) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.WorkbenchPage.getDirtyParts(WorkbenchPage.java:3551) + at org.eclipse.ui.internal.handlers.SaveAllHandler.evaluate(SaveAllHandler.java:68) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationService.requestEvaluation(EvaluationService.java:356) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.update(DirtyStateTracker.java:45) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.propertyChanged(DirtyStateTracker.java:173) + at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:132) + at org.eclipse.ui.texteditor.AbstractTextEditor.firePropertyChange(AbstractTextEditor.java:6387) + at org.eclipse.ui.texteditor.AbstractTextEditor$3.run(AbstractTextEditor.java:436) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.execute(AbstractTextEditor.java:600) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.elementDirtyStateChanged(AbstractTextEditor.java:439) + at org.eclipse.ui.editors.text.TextFileDocumentProvider$FileBufferListener.dirtyStateChanged(TextFileDocumentProvider.java:288) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager$3.run(TextFileBufferManager.java:706) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireDirtyStateChanged(TextFileBufferManager.java:704) + at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer$DocumentListener.documentChanged(ResourceTextFileBuffer.java:79) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) + at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:180) + at org.eclipse.jface.text.projection.ProjectionTextStore.replace(ProjectionTextStore.java:111) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1184) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.jface.text.projection.ProjectionDocument.replace(ProjectionDocument.java:629) + at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:248) + at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7268) + at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:8111) + at org.eclipse.swt.custom.StyledText.doDelete(StyledText.java:2556) + at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:7061) + at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1464) + at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:191) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:200) + at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:128) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:126) + at org.eclipse.jface.action.Action.runWithEvent(Action.java:519) + at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122) + at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90) + at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) + at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149) + at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499) + at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) + at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558) + at org.eclipse.e4.ui.bindings.keys.OutOfOrderListener.handleEvent(OutOfOrderListener.java:72) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1112) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108) + at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1831) + at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4975) + at org.eclipse.swt.widgets.Canvas.WM_KEYDOWN(Canvas.java:428) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4642) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.ui.workbench 4 0 2015-03-09 15:10:52.791 +!MESSAGE An unexpected exception was thrown. +!STACK 0 +java.lang.IllegalStateException + at org.eclipse.jface.text.projection.ProjectionTextStore.internalError(ProjectionTextStore.java:85) + at org.eclipse.jface.text.projection.ProjectionTextStore.get(ProjectionTextStore.java:152) + at org.eclipse.jface.text.AbstractDocument.get(AbstractDocument.java:1039) + at org.eclipse.jface.text.DefaultDocumentAdapter.doGetLine(DefaultDocumentAdapter.java:150) + at org.eclipse.jface.text.DefaultDocumentAdapter.getLine(DefaultDocumentAdapter.java:173) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:774) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:720) + at org.eclipse.swt.custom.StyledTextRenderer.drawLine(StyledTextRenderer.java:364) + at org.eclipse.swt.custom.StyledText.handlePaint(StyledText.java:6133) + at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5669) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.VtblCall(Native Method) + at org.eclipse.swt.internal.ole.win32.IPersistFile.IsDirty(IPersistFile.java:19) + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:855) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.WorkbenchPage.getDirtyParts(WorkbenchPage.java:3551) + at org.eclipse.ui.internal.handlers.SaveAllHandler.evaluate(SaveAllHandler.java:68) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationService.requestEvaluation(EvaluationService.java:356) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.update(DirtyStateTracker.java:45) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.propertyChanged(DirtyStateTracker.java:173) + at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:132) + at org.eclipse.ui.texteditor.AbstractTextEditor.firePropertyChange(AbstractTextEditor.java:6387) + at org.eclipse.ui.texteditor.AbstractTextEditor$3.run(AbstractTextEditor.java:436) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.execute(AbstractTextEditor.java:600) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.elementDirtyStateChanged(AbstractTextEditor.java:439) + at org.eclipse.ui.editors.text.TextFileDocumentProvider$FileBufferListener.dirtyStateChanged(TextFileDocumentProvider.java:288) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager$3.run(TextFileBufferManager.java:706) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireDirtyStateChanged(TextFileBufferManager.java:704) + at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer$DocumentListener.documentChanged(ResourceTextFileBuffer.java:79) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) + at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:180) + at org.eclipse.jface.text.projection.ProjectionTextStore.replace(ProjectionTextStore.java:111) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1184) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.jface.text.projection.ProjectionDocument.replace(ProjectionDocument.java:629) + at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:248) + at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7268) + at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:8111) + at org.eclipse.swt.custom.StyledText.doDelete(StyledText.java:2544) + at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:7061) + at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1464) + at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:191) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:200) + at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:128) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:126) + at org.eclipse.jface.action.Action.runWithEvent(Action.java:519) + at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122) + at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90) + at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) + at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149) + at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499) + at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) + at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558) + at org.eclipse.e4.ui.bindings.keys.OutOfOrderListener.handleEvent(OutOfOrderListener.java:72) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1112) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108) + at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1831) + at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4975) + at org.eclipse.swt.widgets.Canvas.WM_KEYDOWN(Canvas.java:428) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4642) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.ui.workbench 4 0 2015-03-09 17:19:11.610 +!MESSAGE An unexpected exception was thrown. +!STACK 0 +java.lang.IllegalStateException + at org.eclipse.jface.text.projection.ProjectionTextStore.internalError(ProjectionTextStore.java:85) + at org.eclipse.jface.text.projection.ProjectionTextStore.get(ProjectionTextStore.java:152) + at org.eclipse.jface.text.AbstractDocument.get(AbstractDocument.java:1039) + at org.eclipse.jface.text.DefaultDocumentAdapter.doGetLine(DefaultDocumentAdapter.java:150) + at org.eclipse.jface.text.DefaultDocumentAdapter.getLine(DefaultDocumentAdapter.java:173) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:774) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:720) + at org.eclipse.swt.custom.StyledTextRenderer.drawLine(StyledTextRenderer.java:364) + at org.eclipse.swt.custom.StyledText.handlePaint(StyledText.java:6133) + at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5669) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.VtblCall(Native Method) + at org.eclipse.swt.internal.ole.win32.IPersistFile.IsDirty(IPersistFile.java:19) + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:855) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.WorkbenchPage.getDirtyParts(WorkbenchPage.java:3551) + at org.eclipse.ui.internal.handlers.SaveAllHandler.evaluate(SaveAllHandler.java:68) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationService.requestEvaluation(EvaluationService.java:356) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.update(DirtyStateTracker.java:45) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.propertyChanged(DirtyStateTracker.java:173) + at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:132) + at org.eclipse.ui.texteditor.AbstractTextEditor.firePropertyChange(AbstractTextEditor.java:6387) + at org.eclipse.ui.texteditor.AbstractTextEditor$3.run(AbstractTextEditor.java:436) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.execute(AbstractTextEditor.java:600) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.elementDirtyStateChanged(AbstractTextEditor.java:439) + at org.eclipse.ui.editors.text.TextFileDocumentProvider$FileBufferListener.dirtyStateChanged(TextFileDocumentProvider.java:288) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager$3.run(TextFileBufferManager.java:706) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireDirtyStateChanged(TextFileBufferManager.java:704) + at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer$DocumentListener.documentChanged(ResourceTextFileBuffer.java:79) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) + at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:180) + at org.eclipse.jface.text.projection.ProjectionTextStore.replace(ProjectionTextStore.java:111) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1184) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.jface.text.projection.ProjectionDocument.replace(ProjectionDocument.java:629) + at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:248) + at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7268) + at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:8111) + at org.eclipse.swt.custom.StyledText.doDelete(StyledText.java:2544) + at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:7061) + at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1464) + at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:191) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:200) + at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:128) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:126) + at org.eclipse.jface.action.Action.runWithEvent(Action.java:519) + at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122) + at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90) + at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) + at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149) + at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499) + at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) + at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558) + at org.eclipse.e4.ui.bindings.keys.OutOfOrderListener.handleEvent(OutOfOrderListener.java:72) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1112) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108) + at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1831) + at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4975) + at org.eclipse.swt.widgets.Canvas.WM_KEYDOWN(Canvas.java:428) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4642) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.ui.workbench 4 0 2015-03-09 17:20:17.663 +!MESSAGE An unexpected exception was thrown. +!STACK 0 +java.lang.IllegalStateException + at org.eclipse.jface.text.projection.ProjectionTextStore.internalError(ProjectionTextStore.java:85) + at org.eclipse.jface.text.projection.ProjectionTextStore.get(ProjectionTextStore.java:152) + at org.eclipse.jface.text.AbstractDocument.get(AbstractDocument.java:1039) + at org.eclipse.jface.text.DefaultDocumentAdapter.doGetLine(DefaultDocumentAdapter.java:150) + at org.eclipse.jface.text.DefaultDocumentAdapter.getLine(DefaultDocumentAdapter.java:173) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:774) + at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:720) + at org.eclipse.swt.custom.StyledTextRenderer.drawLine(StyledTextRenderer.java:364) + at org.eclipse.swt.custom.StyledText.handlePaint(StyledText.java:6133) + at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5669) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) + at org.eclipse.swt.internal.win32.OS.VtblCall(Native Method) + at org.eclipse.swt.internal.ole.win32.IPersistFile.IsDirty(IPersistFile.java:19) + at org.eclipse.swt.ole.win32.OleClientSite.isDirty(OleClientSite.java:855) + at org.eclipse.ui.internal.editorsupport.win32.OleEditor.isDirty(OleEditor.java:534) + at org.eclipse.ui.internal.WorkbenchPage.getDirtyParts(WorkbenchPage.java:3551) + at org.eclipse.ui.internal.handlers.SaveAllHandler.evaluate(SaveAllHandler.java:68) + at org.eclipse.ui.internal.handlers.AbstractSaveHandler$1.evaluate(AbstractSaveHandler.java:47) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98) + at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:137) + at org.eclipse.ui.internal.services.EvaluationService.requestEvaluation(EvaluationService.java:356) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.update(DirtyStateTracker.java:45) + at org.eclipse.ui.internal.handlers.DirtyStateTracker.propertyChanged(DirtyStateTracker.java:173) + at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:132) + at org.eclipse.ui.texteditor.AbstractTextEditor.firePropertyChange(AbstractTextEditor.java:6387) + at org.eclipse.ui.texteditor.AbstractTextEditor$3.run(AbstractTextEditor.java:436) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.execute(AbstractTextEditor.java:600) + at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.elementDirtyStateChanged(AbstractTextEditor.java:439) + at org.eclipse.ui.editors.text.TextFileDocumentProvider$FileBufferListener.dirtyStateChanged(TextFileDocumentProvider.java:288) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager$3.run(TextFileBufferManager.java:706) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireDirtyStateChanged(TextFileBufferManager.java:704) + at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer$DocumentListener.documentChanged(ResourceTextFileBuffer.java:79) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) + at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) + at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:194) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:180) + at org.eclipse.jface.text.projection.ProjectionTextStore.replace(ProjectionTextStore.java:111) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1184) + at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) + at org.eclipse.jface.text.projection.ProjectionDocument.replace(ProjectionDocument.java:629) + at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:248) + at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7268) + at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:8111) + at org.eclipse.swt.custom.StyledText.doDelete(StyledText.java:2544) + at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:7061) + at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1464) + at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:191) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:200) + at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:128) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:126) + at org.eclipse.jface.action.Action.runWithEvent(Action.java:519) + at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122) + at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90) + at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) + at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149) + at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499) + at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) + at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507) + at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558) + at org.eclipse.e4.ui.bindings.keys.OutOfOrderListener.handleEvent(OutOfOrderListener.java:72) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1112) + at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1108) + at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1831) + at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4975) + at org.eclipse.swt.widgets.Canvas.WM_KEYDOWN(Canvas.java:428) + at org.eclipse.swt.widgets.Control.windowProc(Control.java:4642) + at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339) + at org.eclipse.swt.widgets.Display.windowProc(Display.java:5023) + at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-03-09 19:11:36.982 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-09 19:11:40.039 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-09 19:11:41.728 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-09 19:11:58.266 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-09 19:11:58.370 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-09 19:21:07.010 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-09 19:41:34.702 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-09 19:55:55.524 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-09 21:04:54.352 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-03-09 23:29:19.899 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-09 23:29:31.348 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-09 23:29:33.366 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-09 23:29:53.542 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-09 23:29:53.672 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-03-10 18:34:46.059 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -data H:\Jewelrycraft\1.7.10\eclipse -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-10 18:34:51.371 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-10 18:34:52.721 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-10 18:35:19.948 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-10 18:35:20.425 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-03-11 14:47:49.779 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-11 14:47:54.347 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-11 14:48:14.893 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-11 14:48:15.095 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-11 15:23:36.185 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-03-11 16:53:25.406 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-11 16:53:29.168 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-11 16:53:30.004 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-11 16:53:47.378 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-11 16:53:47.438 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2015-03-11 17:37:55.984 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.lang.String;, sign:()[Ljava.lang.String;, declKey:, key:, name:clone, replace:[1318,1318], token:[1318,1318], relevance:35}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 4 2 2015-03-11 17:39:58.603 +!MESSAGE Proposal matching failed for [METHOD_REF]{completion:clone(), declSign:[Ljava.lang.String;, sign:()[Ljava.lang.String;, declKey:, key:, name:clone, replace:[2579,2579], token:[2579,2579], relevance:35}. +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.process(CallCompletionSessionProcessor.java:209) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireProcessProposal(IntelligentCompletionProposalComputer.java:243) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:143) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-12 00:32:27.893 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-12 01:18:56.636 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-12 01:20:29.332 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-03-13 19:17:20.313 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-13 19:17:24.378 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-13 19:17:25.696 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-13 19:17:51.769 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-13 19:17:51.900 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-03-18 17:40:08.586 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-18 17:40:12.010 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-18 17:40:13.156 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-18 17:40:39.946 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-18 17:40:40.093 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-03-20 01:14:16.612 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-20 01:14:21.629 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-20 01:14:23.122 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-20 01:14:54.435 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-20 01:14:54.579 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-20 02:07:08.418 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-03-20 14:57:07.406 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-20 14:57:09.821 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-20 14:57:10.566 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-20 14:57:26.393 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-20 14:57:26.600 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-20 16:47:39.195 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-03-20 20:17:06.331 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-20 20:17:23.543 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-20 20:17:26.044 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-20 20:17:53.571 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-20 20:17:53.733 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-03-21 00:57:03.492 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-21 00:57:16.872 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-21 00:57:18.739 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-21 00:57:46.534 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-21 00:57:46.795 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-21 02:10:34.744 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-21 02:12:42.701 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-21 03:30:44.176 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-03-21 14:17:52.984 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-21 14:17:55.227 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-21 14:17:56.198 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-21 14:18:08.689 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-21 14:18:08.811 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-21 17:12:39.835 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-21 17:16:02.188 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-21 17:19:31.132 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SESSION 2015-03-22 02:24:19.144 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-22 02:24:21.646 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-22 02:24:22.365 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-22 02:24:42.138 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-22 02:24:42.401 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 1 2015-03-22 10:32:23.534 +!MESSAGE Problems occurred refreshing resources +!SUBENTRY 1 org.eclipse.core.resources 4 1 2015-03-22 10:32:23.535 +!MESSAGE Problem finding next change, code: 21 +!SESSION 2015-03-22 10:46:25.987 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-22 10:46:28.649 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-22 10:46:37.666 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-22 10:46:37.792 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2015-03-22 10:46:52.357 +!MESSAGE Error setting focus to : org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl ScreenHandler.java +!STACK 0 +org.eclipse.swt.SWTException: Widget is disposed + at org.eclipse.swt.SWT.error(SWT.java:4441) + at org.eclipse.swt.SWT.error(SWT.java:4356) + at org.eclipse.swt.SWT.error(SWT.java:4327) + at org.eclipse.swt.widgets.Widget.error(Widget.java:476) + at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:348) + at org.eclipse.swt.widgets.Control.setFocus(Control.java:3320) + at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1039) + at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1039) + at org.eclipse.ui.texteditor.StatusTextEditor.setFocus(StatusTextEditor.java:120) + at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.setFocus(JavaEditor.java:2389) + at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:191) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:253) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:225) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:107) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.focusGui(PartRenderingEngine.java:795) + at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$2.setFocus(ContributedPartRenderer.java:100) + at org.eclipse.swt.custom.CTabItem.setFocus(CTabItem.java:332) + at org.eclipse.swt.custom.CTabFolder.setFocus(CTabFolder.java:2555) + at org.eclipse.swt.widgets.Control.fixFocus(Control.java:1052) + at org.eclipse.swt.widgets.Control.setVisible(Control.java:3818) + at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3098) + at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3106) + at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1794) + at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:283) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2015-03-22 10:46:53.598 +!MESSAGE Error setting focus to : org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl EffectEnderEye.java +!STACK 0 +org.eclipse.swt.SWTException: Widget is disposed + at org.eclipse.swt.SWT.error(SWT.java:4441) + at org.eclipse.swt.SWT.error(SWT.java:4356) + at org.eclipse.swt.SWT.error(SWT.java:4327) + at org.eclipse.swt.widgets.Widget.error(Widget.java:476) + at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:348) + at org.eclipse.swt.widgets.Control.setFocus(Control.java:3320) + at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1039) + at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1039) + at org.eclipse.ui.texteditor.StatusTextEditor.setFocus(StatusTextEditor.java:120) + at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.setFocus(JavaEditor.java:2389) + at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:191) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:253) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:225) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:107) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.focusGui(PartRenderingEngine.java:795) + at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$2.setFocus(ContributedPartRenderer.java:100) + at org.eclipse.swt.custom.CTabItem.setFocus(CTabItem.java:332) + at org.eclipse.swt.custom.CTabFolder.setFocus(CTabFolder.java:2555) + at org.eclipse.swt.widgets.Control.fixFocus(Control.java:1052) + at org.eclipse.swt.widgets.Control.setVisible(Control.java:3818) + at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3098) + at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3106) + at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1794) + at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:283) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2015-03-22 10:46:56.296 +!MESSAGE Error setting focus to : org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl ScreenHandler.java +!STACK 0 +org.eclipse.swt.SWTException: Widget is disposed + at org.eclipse.swt.SWT.error(SWT.java:4441) + at org.eclipse.swt.SWT.error(SWT.java:4356) + at org.eclipse.swt.SWT.error(SWT.java:4327) + at org.eclipse.swt.widgets.Widget.error(Widget.java:476) + at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:348) + at org.eclipse.swt.widgets.Control.setFocus(Control.java:3320) + at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1039) + at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1039) + at org.eclipse.ui.texteditor.StatusTextEditor.setFocus(StatusTextEditor.java:120) + at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.setFocus(JavaEditor.java:2389) + at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:191) + at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247) + at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:253) + at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:225) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:107) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.focusGui(PartRenderingEngine.java:795) + at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$2.setFocus(ContributedPartRenderer.java:100) + at org.eclipse.swt.custom.CTabItem.setFocus(CTabItem.java:332) + at org.eclipse.swt.custom.CTabFolder.setFocus(CTabFolder.java:2555) + at org.eclipse.swt.widgets.Control.fixFocus(Control.java:1052) + at org.eclipse.swt.widgets.Control.setVisible(Control.java:3818) + at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3098) + at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3106) + at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1794) + at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:283) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-22 10:57:27.394 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.jdt.debug.ui 4 4 2015-03-22 11:17:54.701 +!MESSAGE java.lang.InternalError: Got MethodID of ReferenceType that is not a member of the ReferenceType occurred retrieving stack frames. +!STACK 0 +java.lang.InternalError: Got MethodID of ReferenceType that is not a member of the ReferenceType + at org.eclipse.jdi.internal.MethodImpl.readWithReferenceTypeWithTag(MethodImpl.java:697) + at org.eclipse.jdi.internal.LocationImpl.read(LocationImpl.java:169) + at org.eclipse.jdi.internal.StackFrameImpl.readWithLocation(StackFrameImpl.java:354) + at org.eclipse.jdi.internal.ThreadReferenceImpl.frames(ThreadReferenceImpl.java:275) + at org.eclipse.jdi.internal.ThreadReferenceImpl.frames(ThreadReferenceImpl.java:240) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.getUnderlyingFrames(JDIThread.java:664) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.computeStackFrames(JDIThread.java:563) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.computeStackFrames(JDIThread.java:635) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.getTopStackFrame(JDIThread.java:1212) + at org.eclipse.jdt.internal.debug.ui.breakpoints.SuspendOnCompilationErrorListener.breakpointHit(SuspendOnCompilationErrorListener.java:65) + at org.eclipse.jdt.internal.debug.core.breakpoints.BreakpointListenerManager$JavaBreakpointListenerProxy.breakpointHit(BreakpointListenerManager.java:160) + at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin$HitNotifier.run(JDIDebugPlugin.java:736) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) + at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin$AbstractNotifier.notifyListeners(JDIDebugPlugin.java:541) + at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin$HitNotifier.notifyHit(JDIDebugPlugin.java:752) + at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin.fireBreakpointHit(JDIDebugPlugin.java:493) + at org.eclipse.jdt.internal.debug.core.model.JDIThread.handleSuspendForBreakpoint(JDIThread.java:1298) + at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.suspend(JavaBreakpoint.java:401) + at org.eclipse.jdt.internal.debug.core.breakpoints.JavaExceptionBreakpoint.handleBreakpointEvent(JavaExceptionBreakpoint.java:387) + at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.handleEvent(JavaBreakpoint.java:308) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch(EventDispatcher.java:152) + at org.eclipse.jdt.internal.debug.core.EventDispatcher.access$0(EventDispatcher.java:100) + at org.eclipse.jdt.internal.debug.core.EventDispatcher$1.run(EventDispatcher.java:249) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) +!SESSION 2015-03-22 11:23:25.540 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY org.eclipse.core.resources 2 10035 2015-03-22 11:23:28.188 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-03-22 11:23:28.998 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-22 11:23:45.187 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-03-22 11:23:45.423 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Sorin'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.recommenders.calls.rcp 2 1 2015-03-22 14:59:15.929 +!MESSAGE Cannot obtain JDT’s lookup environment (debug only). +!STACK 0 +org.eclipse.recommenders.utils.Logs$LogTraceException + at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:377) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:130) + at org.eclipse.recommenders.utils.Logs.log(Logs.java:122) + at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:104) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:229) + at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:131) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333) + at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:325) + at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:282) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1861) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) + at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) + +!ENTRY org.eclipse.recommenders.rcp 4 5 2015-03-22 16:25:50.243 +!MESSAGE Failed to resolve selection in ‘=Minecraft/src\/main\/java +
+
+ + + + + + + + + + + + + + + + + + + + +
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/00f44bf8f2cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/00f44bf8f2cf0014170de422db399e8d new file mode 100644 index 0000000..c7f47cf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/00f44bf8f2cf0014170de422db399e8d @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); + if (chunkposition != null && chunkposition.chunkPosX != (int)player.posX && chunkposition.chunkPosZ != (int)player.posZ){ + Minecraft.getMinecraft().thePlayer.motionX += 0.01D*Math.signum((double)chunkposition.chunkPosX); + Minecraft.getMinecraft().thePlayer.motionZ += 0.01D*Math.signum((double)chunkposition.chunkPosZ); + Minecraft.getMinecraft().thePlayer.motionY += 0.01D*Math.signum((double)chunkposition.chunkPosY); + System.out.println(chunkposition.chunkPosX + " " + player.chunkCoordX); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/60ca70f3b9d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/60ca70f3b9d000141b65e2fc7f94332d new file mode 100644 index 0000000..639ee7b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/60ca70f3b9d000141b65e2fc7f94332d @@ -0,0 +1,232 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; +// GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/90d037febbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/90d037febbd000141b65e2fc7f94332d new file mode 100644 index 0000000..9e5a035 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/90d037febbd000141b65e2fc7f94332d @@ -0,0 +1,236 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/c03acc5982d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/c03acc5982d000141a1fb02abca5ff55 new file mode 100644 index 0000000..9d12634 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/c03acc5982d000141a1fb02abca5ff55 @@ -0,0 +1,67 @@ +package darkknight.jewelrycraft.effects; + +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.DamageSource; +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 +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1) Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 2.0F); + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/50aa0d289bd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/50aa0d289bd000141b65e2fc7f94332d new file mode 100644 index 0000000..e69de29 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/70a57e40e75300141786a2891bfc8d75 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/70a57e40e75300141786a2891bfc8d75 new file mode 100644 index 0000000..045539f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/70a57e40e75300141786a2891bfc8d75 @@ -0,0 +1,85 @@ +package darkknight.jewelrycraft.particles; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import org.lwjgl.opengl.GL11; + +public class EntityShadowsFX extends EntityFX +{ + float moteParticleScale; + + public EntityShadowsFX(World world, double x, double y, double z, float size, float red, float green, float blue, float maxAge) + { + super(world, x, y, z, 0D, 0D, 0D); + + particleRed = red; + particleGreen = green; + particleBlue = blue; + particleMaxAge = (int) (28D / (Math.random() * 0.3D + 0.7D) * maxAge); + particleGravity = 0F; + motionX = motionY = motionZ = 0; + particleScale *= size; + moteParticleScale = particleScale; + noClip = true; + setSize(0.01F, 0.01F); + } + + @Override + public void renderParticle(Tessellator tessellator, float partialTicks, float minX, float minY, float minZ, float maxX, float maxZ) + { + tessellator.draw(); + ResourceLocation particle = new ResourceLocation("jewelrycraft", "textures/particle/shadows.png"); + Minecraft.getMinecraft().renderEngine.bindTexture(particle); + GL11.glColor4f(1, 1, 1, 1); + tessellator.startDrawingQuads(); + tessellator.setBrightness(this.getBrightnessForRender(0)); + float scale = 0.1F * particleScale; + float x = (float) (prevPosX + (posX - prevPosX) * partialTicks - interpPosX); + float y = (float) (prevPosY + (posY - prevPosY) * partialTicks - interpPosY); + float z = (float) (prevPosZ + (posZ - prevPosZ) * partialTicks - interpPosZ); + tessellator.setColorRGBA_F(particleRed, particleGreen, particleBlue, 0.5F); + tessellator.addVertexWithUV(x - minX * scale - maxX * scale, y - minY * scale, z - minZ * scale - maxZ * scale, 0, 0); + tessellator.addVertexWithUV(x - minX * scale + maxX * scale, y + minY * scale, z - minZ * scale + maxZ * scale, 1, 0); + tessellator.addVertexWithUV(x + minX * scale + maxX * scale, y + minY * scale, z + minZ * scale + maxZ * scale, 1, 1); + tessellator.addVertexWithUV(x + minX * scale - maxX * scale, y - minY * scale, z + minZ * scale - maxZ * scale, 0, 1); + tessellator.draw(); + tessellator.startDrawingQuads(); + } + + public void onUpdate() + { + super.onUpdate(); + AxisAlignedBB axisalignedbb = this.boundingBox.expand(1.0D, 16.0D, 1.0D); + List list1 = this.worldObj.getEntitiesWithinAABB(Entity.class, axisalignedbb); + if (list1 != null && !list1.isEmpty()) + { + Iterator iterator = list1.iterator(); + + while (iterator.hasNext()) + { + Entity entity = (Entity) iterator.next(); + if (entity != null && this.posX <= entity.posX + 0.5F && this.posX >= entity.posX - 0.5F && this.posZ <= entity.posZ + 0.5F && this.posZ >= entity.posZ - 0.5F) entity.setDead(); + if (entity instanceof EntityThrowable){ + ((EntityThrowable)entity).setDead(); + } + } + } + } + + public int getFXLayer() + { + return 2; + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/908f5c3bb4d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/908f5c3bb4d000141b65e2fc7f94332d new file mode 100644 index 0000000..364132f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/908f5c3bb4d000141b65e2fc7f94332d @@ -0,0 +1,195 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 10, y + 20, 145, 150, 35, 30); + name.add(item.getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/70a157f022cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/70a157f022cf00141c41f52413db5e31 new file mode 100644 index 0000000..c5e21f2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/70a157f022cf00141c41f52413db5e31 @@ -0,0 +1,459 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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 || player.getHealth() <= 0){ + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/a058ee18bcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/a058ee18bcd000141b65e2fc7f94332d new file mode 100644 index 0000000..afd9dd3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/a058ee18bcd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/b0d74dd670cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/b0d74dd670cf00141de78e4a85bb2469 new file mode 100644 index 0000000..776a6e8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/b0d74dd670cf00141de78e4a85bb2469 @@ -0,0 +1,41 @@ +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (rand.nextInt(5) == 0 && !world.isRemote && !(target instanceof EntityMob) && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && target.canAttackWithItem()){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if (player.getMaxHealth() >= 3F){ + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + player.setHealth(player.getHealth() - 2.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/3014ba2224cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/3014ba2224cf00141c41f52413db5e31 new file mode 100644 index 0000000..9a3ac60 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/3014ba2224cf00141c41f52413db5e31 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class CurseBlind extends Curse +{ + public CurseBlind(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void action(World world, EntityPlayer player) + { +// if (!player.isPotionActive(Potion.blindness) || player.getActivePotionEffect(Potion.blindness).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 60)); + } + + public String getDescription() + { + return "You see the light slowly fading in front of you"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/70793b297ecf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/70793b297ecf00141de78e4a85bb2469 new file mode 100644 index 0000000..623aca8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/70793b297ecf00141de78e4a85bb2469 @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.client; + +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.CommonProxy; +import darkknight.jewelrycraft.block.BlockList; +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.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.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.ItemRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +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; + +public class ClientProxy extends CommonProxy +{ + @Override + public void registerRenderers() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation("jewelrycraft", "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation("jewelrycraft", "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(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("jewelrycraft", "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("jewelrycraft", "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/f0b8342df3cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/f0b8342df3cf0014170de422db399e8d new file mode 100644 index 0000000..3738506 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/f0b8342df3cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); + if (chunkposition != null && chunkposition.chunkPosX != (int)player.posX && chunkposition.chunkPosZ != (int)player.posZ){ + Minecraft.getMinecraft().thePlayer.motionX += 0.01D*Math.signum((double)chunkposition.chunkPosX); + Minecraft.getMinecraft().thePlayer.motionZ += 0.01D*Math.signum((double)chunkposition.chunkPosZ); + System.out.println(chunkposition.chunkPosX + " " + 0.01D*Math.signum((double)chunkposition.chunkPosX)); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/40b7127a9cd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/40b7127a9cd000141b65e2fc7f94332d new file mode 100644 index 0000000..c6a409b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/40b7127a9cd000141b65e2fc7f94332d @@ -0,0 +1,52 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.item.ItemList; + +public class GuiTabIntroduction extends GuiTab +{ + public GuiTabIntroduction(int id) + { + super("Introduction", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(ItemList.ring); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Welcome to Jewelrycraft 2! This mod is about making jewelry that you can modify to your own will. To find out how to create a jewelry, please consult the book and look at the Smelter block. To add modifiers to it you need to perform a ritual. To see how to do that, look at the Cursed Eye"; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 2: + text = "block in this giude. Please be aware that even if you can add anything as a modifier and can have multiple modifiers on one jewelry, this mod is still in alpha and does not have that many modifiers implemtnted and currently don't have any different effects depending on the gem used. To see"; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 3: + text = "block in this giude. Please be aware that even if you can add anything as a modifier and can have multiple modifiers on one jewelry, this mod is still in alpha and does not have that many modifiers implemtnted and currently don't have any different effects depending on the gem used."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/70a655ecbdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/70a655ecbdd000141b65e2fc7f94332d new file mode 100644 index 0000000..9288248 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/70a655ecbdd000141b65e2fc7f94332d @@ -0,0 +1,237 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(-0.3F, 0F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/208e063bf5cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/208e063bf5cf0014170de422db399e8d new file mode 100644 index 0000000..9335f52 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/208e063bf5cf0014170de422db399e8d @@ -0,0 +1,69 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + if (player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky){ + if (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 100, 1)); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/807d1568bed000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/807d1568bed000141b65e2fc7f94332d new file mode 100644 index 0000000..30c7f2a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/807d1568bed000141b65e2fc7f94332d @@ -0,0 +1,239 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))){ + GL11.glTranslatef(0.2F, 0F, 0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + // GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if (xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if (Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/f07260f599d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/f07260f599d000141b65e2fc7f94332d new file mode 100644 index 0000000..6bae4bb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/f07260f599d000141b65e2fc7f94332d @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabModifiers extends GuiTab +{ + int maxPages; + public GuiTabModifiers(int id) + { + super("Modifiers", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.blaze_powder); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all of modifiers that have a use and what they do, in the form of a story/riddle/poem. However different jewellery have different effects for the same modifier."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + maxPages++; + break; + case 2: + text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.blaze_powder), text, 40f); + maxPages++; + break; + case 3: + text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Be aware, against an arrow you can't compare. Fire is your enemy and weakness is the penalty."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.feather), text, 40f); + maxPages++; + break; + case 4: + text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.ender_eye), text, 40f); + maxPages++; + break; + } + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return maxPages; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/10a8250bf2cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/10a8250bf2cf0014170de422db399e8d new file mode 100644 index 0000000..9d58dae --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/10a8250bf2cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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); + Minecraft.getMinecraft().thePlayer.motionZ += 0.01D*Math.signum((double)chunkposition.chunkPosZ); + System.out.println((double)chunkposition.chunkPosX + " " + Math.signum((double)chunkposition.chunkPosX)); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/304ae31aa0ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/304ae31aa0ce00141801ff0972626827 new file mode 100644 index 0000000..9e33caf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/304ae31aa0ce00141801ff0972626827 @@ -0,0 +1,71 @@ +/** + * + */ +package darkknight.jewelrycraft.network; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import io.netty.buffer.ByteBuf; +import cpw.mods.fml.common.network.ByteBufUtils; +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.events.PlayerRenderHandler; +import darkknight.jewelrycraft.lib.Reference; +import darkknight.jewelrycraft.util.PlayerUtils; + +/** + * @author Sorin + * + */ +public class PacketSendCurseStats implements IMessage, IMessageHandler +{ + public PacketSendCurseStats() + { + + } + + /** + * @param message + * @param ctx + * @return + */ + @Override + public IMessage onMessage(PacketSendCurseStats message, MessageContext ctx) + { + return null; + } + + /** + * @param buf + */ + @Override + public void fromBytes(ByteBuf buf) + { + String temp = ByteBufUtils.readUTF8String(buf); + if (temp != "") + PlayerRenderHandler.infamyCache = temp.split(";"); + else + PlayerRenderHandler.infamyCache = new String[] { }; + } + + /** + * @param buf + */ + @Override + public void toBytes(ByteBuf buf) + { + Iterator players = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator(); + String greedPlayers = ""; + while (players.hasNext()) + { + EntityPlayer current = players.next(); + if(PlayerUtils.getModPlayerPersistTag(current, "Jewelrycraft").getInteger(Reference.MODNAME + ":" + "Infamy") > 0) + greedPlayers = greedPlayers + (greedPlayers == "" ? "" : ";") + current.getDisplayName(); + } + ByteBufUtils.writeUTF8String(buf, greedPlayers); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/00b1e982a0ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/00b1e982a0ce00141801ff0972626827 new file mode 100644 index 0000000..a69ff99 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/00b1e982a0ce00141801ff0972626827 @@ -0,0 +1,25 @@ +package darkknight.jewelrycraft.curses; + +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import darkknight.jewelrycraft.lib.Reference; + +public class CurseList +{ + private static Curse rotten, flaming, blind, greed, infamy; + private static boolean isInitialized = false; + + /** + * @param e + */ + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized){ + rotten = new CurseRottenHeart(0, Reference.MODNAME + ":" + "Rotten Heart", 0); + flaming = new CurseFlamingSoul(1, Reference.MODNAME + ":" + "Flaming Soul", 0); + greed = new CurseGreed(2, Reference.MODNAME + ":" + "Greed", 0); + blind = new CurseBlind(3, Reference.MODNAME + ":" + "Blind", 0); + infamy = new CurseBlind(4, Reference.MODNAME + ":" + "Infamy", 0); + isInitialized = true; + } + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/e0daccca6fcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/e0daccca6fcf00141de78e4a85bb2469 new file mode 100644 index 0000000..4063764 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/e0daccca6fcf00141de78e4a85bb2469 @@ -0,0 +1,43 @@ +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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.canAttackWithItem()){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + if(playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if(player.getMaxHealth() >= 3F){ + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + player.setHealth(player.getHealth() - 1.0F); + } + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/20cffe1816cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/20cffe1816cf00141c41f52413db5e31 new file mode 100644 index 0000000..4662b74 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/20cffe1816cf00141c41f52413db5e31 @@ -0,0 +1,30 @@ +package darkknight.jewelrycraft.curses; + +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20f && rand.nextInt(5) == 0) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 2.0F); + JewelrycraftUtil.addCursePoints(player, 100); + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/804b704ea7ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/804b704ea7ce00141801ff0972626827 new file mode 100644 index 0000000..8ea597b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/804b704ea7ce00141801ff0972626827 @@ -0,0 +1,113 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + NBTTagCompound enemyData = target.getEntityData(); + if (jewelry instanceof ItemRing && pos != -1){ + if (target instanceof EntityPlayer){ + NBTTagCompound enemyInfo = PlayerUtils.getModPlayerPersistTag((EntityPlayer)target, "Jewelrycraft"); + if (enemyInfo.getInteger("reAttacked") == 0){ + enemyInfo.setInteger("reAttacked", enemyInfo.getInteger("reAttacked") + 1); + target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); + if (rand.nextInt(2) == 0){ + enemyInfo.setInteger("stunTime", 50); + enemyInfo.setBoolean("stunned", true); + } + } + }else if (enemyData.getInteger("reAttacked") == 0){ + enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); + 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, "Jewelrycraft"); + 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/2/e064279b24cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/e064279b24cf00141c41f52413db5e31 new file mode 100644 index 0000000..8d5b853 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/e064279b24cf00141c41f52413db5e31 @@ -0,0 +1,36 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +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.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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)){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + if(playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if(player.getMaxHealth() > 4F) player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/709a7da620cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/709a7da620cf00141c41f52413db5e31 new file mode 100644 index 0000000..c465050 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/709a7da620cf00141c41f52413db5e31 @@ -0,0 +1,459 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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(player.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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/20/80c96a3f6fcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/80c96a3f6fcf00141de78e4a85bb2469 new file mode 100644 index 0000000..3f93448 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/80c96a3f6fcf00141de78e4a85bb2469 @@ -0,0 +1,39 @@ +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.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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.canAttackWithItem()){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + if(playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if(player.getMaxHealth() >= 3F) player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/906f9d59f3cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/906f9d59f3cf0014170de422db399e8d new file mode 100644 index 0000000..eaae507 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/906f9d59f3cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); + if (chunkposition != null && chunkposition.chunkPosX != (int)player.posX && chunkposition.chunkPosZ != (int)player.posZ){ + 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); + System.out.println(chunkposition.chunkPosX + " " + 0.01D*Math.signum((double)chunkposition.chunkPosX - player.posX)); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/90210400bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/90210400bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..6cb5af7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/90210400bbd000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/400e338dbcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/400e338dbcd000141b65e2fc7f94332d new file mode 100644 index 0000000..97ec4e0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/400e338dbcd000141b65e2fc7f94332d @@ -0,0 +1,238 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } +// if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } +// if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/50c220fcb9d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/50c220fcb9d000141b65e2fc7f94332d new file mode 100644 index 0000000..8068fcb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/50c220fcb9d000141b65e2fc7f94332d @@ -0,0 +1,232 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); +// GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/408dbb6524cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/408dbb6524cf00141c41f52413db5e31 new file mode 100644 index 0000000..73985da --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/408dbb6524cf00141c41f52413db5e31 @@ -0,0 +1,36 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +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.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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)){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/e06abfb6f6cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/e06abfb6f6cf0014170de422db399e8d new file mode 100644 index 0000000..7ba1c1a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/e06abfb6f6cf0014170de422db399e8d @@ -0,0 +1,66 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote && rand.nextInt(30) == 0) player.setPositionAndUpdate(player.posX + rand.nextInt(30)*(rand.nextBoolean()?-1:1), player.posY, player.posZ + rand.nextInt(30)*(rand.nextBoolean()?-1:1)); + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/10ad6571bed000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/10ad6571bed000141b65e2fc7f94332d new file mode 100644 index 0000000..4f4fa8a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/10ad6571bed000141b65e2fc7f94332d @@ -0,0 +1,240 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))){ + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-0.2F, 0F, 0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + // GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if (xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if (Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/6035720f6fcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/6035720f6fcf00141de78e4a85bb2469 new file mode 100644 index 0000000..a01dbd5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/6035720f6fcf00141de78e4a85bb2469 @@ -0,0 +1,36 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +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.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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)){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + if(playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if(player.getMaxHealth() >= 3F) player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/60b18a49bdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/60b18a49bdd000141b65e2fc7f94332d new file mode 100644 index 0000000..1d33b9b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/60b18a49bdd000141b65e2fc7f94332d @@ -0,0 +1,125 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + + case 5: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 0), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + break; + } + } + + @Override + public int getMaxPages() + { + return 5; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/60f0dd6d12cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/60f0dd6d12cf00141c41f52413db5e31 new file mode 100644 index 0000000..0a75a6f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/60f0dd6d12cf00141c41f52413db5e31 @@ -0,0 +1,453 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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.attackedAction(player.worldObj, player); + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + 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); + // int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + 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()); + // if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/25/f08a3fedf1cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/f08a3fedf1cf0014170de422db399e8d new file mode 100644 index 0000000..ce8b031 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/f08a3fedf1cf0014170de422db399e8d @@ -0,0 +1,63 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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); + Minecraft.getMinecraft().thePlayer.motionZ += 0.01D*Math.signum((double)chunkposition.chunkPosZ); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/40b2f4a3b8d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/40b2f4a3b8d000141b65e2fc7f94332d new file mode 100644 index 0000000..c0d0e10 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/40b2f4a3b8d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, x, y - 10); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/801b0ce922cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/801b0ce922cf00141c41f52413db5e31 new file mode 100644 index 0000000..52d6801 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/801b0ce922cf00141c41f52413db5e31 @@ -0,0 +1,460 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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); + } + event.setCanceled(true); + if (player.getHealth() != player.prevHealth || player.getHealth() <= 0){ + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/26/905604776fcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/905604776fcf00141de78e4a85bb2469 new file mode 100644 index 0000000..f4366f2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/905604776fcf00141de78e4a85bb2469 @@ -0,0 +1,39 @@ +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.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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.canAttackWithItem()){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + if(playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if(player.getMaxHealth() >= 3F) player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/10f40556bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/10f40556bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..749c6cd --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/10f40556bbd000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/60dda1c0bcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/60dda1c0bcd000141b65e2fc7f94332d new file mode 100644 index 0000000..58d6181 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/60dda1c0bcd000141b65e2fc7f94332d @@ -0,0 +1,245 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHT1); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT1); + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/a01e32b5bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/a01e32b5bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..ce2944b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/a01e32b5bbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 230, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/5054a9ea70cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/5054a9ea70cf00141de78e4a85bb2469 new file mode 100644 index 0000000..aa815f7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/5054a9ea70cf00141de78e4a85bb2469 @@ -0,0 +1,41 @@ +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (rand.nextInt(5) == 0 && !world.isRemote && !(target instanceof EntityMob) && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && target.canAttackWithItem()){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if (player.getMaxHealth() >= 3F){ + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + player.setHealth(player.getHealth() - 1.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/90616b3e85d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/90616b3e85d000141a1fb02abca5ff55 new file mode 100644 index 0000000..3a51bcb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/90616b3e85d000141a1fb02abca5ff55 @@ -0,0 +1,79 @@ +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) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && rand.nextInt(500) == 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) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/b02c9da3a5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/b02c9da3a5ce00141801ff0972626827 new file mode 100644 index 0000000..ef937e9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/b02c9da3a5ce00141801ff0972626827 @@ -0,0 +1,104 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + 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); + playerInfo.setInteger("stunTime", 50); + playerInfo.setBoolean("stunned", 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, "Jewelrycraft"); + 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/2a/30dc218d2f9300141384bdd0ca2744d8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/30dc218d2f9300141384bdd0ca2744d8 new file mode 100644 index 0000000..eeb9c96 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/30dc218d2f9300141384bdd0ca2744d8 @@ -0,0 +1,659 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import darkknight.jewelrycraft.item.ItemRing; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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); + if (itemStackData.hasKey("gemNumber")) itemStackData.setInteger("gemNumber", itemStackData.getInteger("gemNumber") + 1); + else itemStackData.setInteger("gemNumber", 1); + int no = itemStackData.getInteger("gemNumber"); + itemStackData.setTag("gem" + no, 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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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 + public static void addGemColor(ItemStack item, int color, int indice) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound colors = new NBTTagCompound(); + colors.setInteger("gemColor" + indice, color); +// System.out.println("gemColor" + indice + " Color: " + color); + itemStackData.setTag("gemColors", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + 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; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack gem(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems.get(new Random().nextInt(gems.size())); + } + return null; + } + + public static ArrayList gems(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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 + public static int gemColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()) + { + NBTTagCompound color = (NBTTagCompound) stack.getTagCompound().getTag("gemColors"); + if (stack.getTagCompound().hasKey("gemNumber")) + { + ArrayList colors = new ArrayList(); + int no = stack.getTagCompound().getInteger("gemNumber"); + for (int i = 0; i < no; i++) + { + int col = color.getInteger("gemColor" + i); + colors.add(col); + } + int prevColor = colors.get(0); + if(new Random().nextInt(1) == 0) prevColor = colors.get(new Random().nextInt(colors.size())); + return prevColor; + } + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/2069bbfabdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/2069bbfabdd000141b65e2fc7f94332d new file mode 100644 index 0000000..76d6579 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/2069bbfabdd000141b65e2fc7f94332d @@ -0,0 +1,237 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.02F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/a09c5791f6cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/a09c5791f6cf0014170de422db399e8d new file mode 100644 index 0000000..c65217f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/a09c5791f6cf0014170de422db399e8d @@ -0,0 +1,65 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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)); + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/0057e48384c600141066cb38d875561a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/0057e48384c600141066cb38d875561a new file mode 100644 index 0000000..9a944d4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/0057e48384c600141066cb38d875561a @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.PlayerUtils; + +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); + // 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(); + } + } + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + {} + + @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, "Jewelrycraft"); + if (jewelry instanceof ItemNecklace && pos != -1 && rand.nextInt(4) == 0 && 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 * 6F); + // Negative earrings + if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); + } + + @Override + public boolean onPlayerFall(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/0075f9bc9fd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/0075f9bc9fd000141b65e2fc7f94332d new file mode 100644 index 0000000..aa41611 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/0075f9bc9fd000141b65e2fc7f94332d @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class GuiTabGemsAndIngots extends GuiTab +{ + + /** + * @param id + */ + public GuiTabGemsAndIngots(int id) + { + super("Gems and ingots", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.emerald); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + for(int i = (page - 1) * 9; i < page * 9; i++) + if (i < JewelrycraftUtil.gem.size()){ + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Gems", gui.getLeft() + xPos + 40, gui.getTop(), 0); + gui.renderItem(JewelrycraftUtil.gem.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f); + gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.gem.get(i).getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + page -= JewelrycraftUtil.gem.size() / 9 + 1; + for(int i = (page - 1) * 9; i < page * 9; i++) + if (i < JewelrycraftUtil.metal.size() && page > 0){ + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ingots", gui.getLeft() + xPos + 40, gui.getTop(), 0); + gui.renderItem(JewelrycraftUtil.metal.get(i).copy(), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f); + gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.metal.get(i).copy().getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return JewelrycraftUtil.gem.size() / 9 + JewelrycraftUtil.metal.size() / 9 + 2; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/702e06909bd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/702e06909bd000141b65e2fc7f94332d new file mode 100644 index 0000000..7f26d74 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/702e06909bd000141b65e2fc7f94332d @@ -0,0 +1,44 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.item.ItemList; + +public class GuiTabIntroduction extends GuiTab +{ + public GuiTabIntroduction(int id) + { + super("Introduction", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(ItemList.ring); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all of modifiers that have a use and what they do, in the form of a story/riddle/poem. However different jewellery have different effects for the same modifier."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/b0fd61c916cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/b0fd61c916cf00141c41f52413db5e31 new file mode 100644 index 0000000..928ba1b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/b0fd61c916cf00141c41f52413db5e31 @@ -0,0 +1,115 @@ +package darkknight.jewelrycraft.curses; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class Curse +{ + protected int id, texturepack; + protected String name, description; + protected Random rand = new Random(); + private static ArrayList curses = new ArrayList(); + public static ArrayList availableCurses = new ArrayList(); + + /** + * @param id the ID of the curse + * @param name the name of the curse + * @param texturepack the ID of the pack the texture is located in + */ + protected Curse(int id, String name, int texturepack) + { + this.id = id; + this.name = name; + this.texturepack = texturepack; + curses.add(this); + availableCurses.add(this); + } + + /** + * @return the name of the curse + */ + public String getName() + { + return name; + } + + /** + * @return the description of the curse + */ + public String getDescription() + { + return description; + } + + public Curse setDescription(String desc) + { + description = desc; + return this; + } + + /** + * @return the curse ID + */ + public int getID() + { + return id; + } + + /** + * @return the texture pack ID + */ + public int getTexturePack() + { + return texturepack; + } + + /** + * @param world + * @param player + */ + public void action(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void deathAction(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void respawnAction(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void attackedAction(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void attackedByPlayerAction(World world, EntityPlayer player) + {} + + public boolean itemToss() + { + return false; + } + + /** + * @return + */ + public static ArrayList getCurseList() + { + return curses; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/90ac8e2b9fce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/90ac8e2b9fce00141801ff0972626827 new file mode 100644 index 0000000..21f4d0f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/90ac8e2b9fce00141801ff0972626827 @@ -0,0 +1,68 @@ +package darkknight.jewelrycraft.events; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +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.lib.Reference; +import darkknight.jewelrycraft.model.ModelMask; +import darkknight.jewelrycraft.tileentity.renders.MaskRender; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class PlayerRenderHandler +{ + ModelMask maskModel = new ModelMask(); + MaskRender mask = new MaskRender(); + + public static String[] infamyCache = new String[] {}; + + @SubscribeEvent + public void renderScreen(RenderPlayerEvent.Specials.Post event) + { + if (infamyCache != null) + { + Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); + + while(players.hasNext()) + { + EntityPlayer player = players.next(); + if (checkPlayerGreed(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(); + } + } + } + } + + /** + * @param string + * @return + */ + private boolean checkPlayerGreed(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/2f/3016ca8fa3d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/3016ca8fa3d000141b65e2fc7f94332d new file mode 100644 index 0000000..1f3a590 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/3016ca8fa3d000141b65e2fc7f94332d @@ -0,0 +1,68 @@ +package darkknight.jewelrycraft.events; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +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.lib.Reference; +import darkknight.jewelrycraft.model.ModelMask; +import darkknight.jewelrycraft.tileentity.renders.MaskRender; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class PlayerRenderHandler +{ + ModelMask maskModel = new ModelMask(); + public MaskRender mask = new MaskRender(); + + public static String[] infamyCache = new String[] {}; + + @SubscribeEvent + public void renderScreen(RenderPlayerEvent.Specials.Post event) + { + if (infamyCache != null) + { + Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); + + while(players.hasNext()) + { + EntityPlayer player = players.next(); + 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(); + } + } + } + } + + /** + * @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/2f/90f98826b0d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/90f98826b0d000141b65e2fc7f94332d new file mode 100644 index 0000000..df93297 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/90f98826b0d000141b65e2fc7f94332d @@ -0,0 +1,247 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + if(ItemStack.areItemStacksEqual(item, new ItemStack(Blocks.light_weighted_pressure_plate, 1, 0)))GL11.glRotatef(25.0F, -1.0F, 0.0F, 0.0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ +// GL11.glEnable(GL11.GL_LIGHTING); +// GL11.glEnable(GL11.GL_LIGHT0); + RenderHelper.enableStandardItemLighting(); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ +// GL11.glDisable(GL11.GL_LIGHT0); +// GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + RenderHelper.disableStandardItemLighting(); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/902846c39fd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/902846c39fd000141b65e2fc7f94332d new file mode 100644 index 0000000..a0a1fd9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/902846c39fd000141b65e2fc7f94332d @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabModifiers extends GuiTab +{ + int maxPages; + public GuiTabModifiers(int id) + { + super("Modifiers", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.blaze_powder); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all of modifiers that have a use and what they do, in the form of a story/riddle/poem. However different jewellery have different effects for the same modifier."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 2: + text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 7, new ItemStack(Items.blaze_powder), text, 40f); + break; + case 3: + text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Against an arrow you can't compare, so move around, don't just stare. Fire is your enemy and weakness is the penalty."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 7, new ItemStack(Items.feather), text, 40f); + break; + case 4: + text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 7, new ItemStack(Items.ender_eye), text, 40f); + break; + } + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return 4; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/4099cacb16cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/4099cacb16cf00141c41f52413db5e31 new file mode 100644 index 0000000..50aefe3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/4099cacb16cf00141c41f52413db5e31 @@ -0,0 +1,459 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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(player.worldObj, player); + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/31/7026f2daf4cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/7026f2daf4cf0014170de422db399e8d new file mode 100644 index 0000000..df0990b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/7026f2daf4cf0014170de422db399e8d @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/90e1eeeff3cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/90e1eeeff3cf0014170de422db399e8d new file mode 100644 index 0000000..072cac2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/90e1eeeff3cf0014170de422db399e8d @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); + if (chunkposition != null && chunkposition.chunkPosX != (int)player.posX && chunkposition.chunkPosZ != (int)player.posZ){ + 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); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/009ecb1ebbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/009ecb1ebbd000141b65e2fc7f94332d new file mode 100644 index 0000000..5db4804 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/009ecb1ebbd000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/10854bde6e5f00141b03e33c57c1f917 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/10854bde6e5f00141b03e33c57c1f917 new file mode 100644 index 0000000..f0417ae --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/10854bde6e5f00141b03e33c57c1f917 @@ -0,0 +1,79 @@ +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); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityShadowEye(); + } + + @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 boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) + { + return true; + } + + @Override + public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) + { + } + + @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 void registerBlockIcons(IIconRegister icon) + { + this.blockIcon = icon.registerIcon("jewelrycraft:shadowEye"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/10340d2ef2cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/10340d2ef2cf0014170de422db399e8d new file mode 100644 index 0000000..25dd5bf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/10340d2ef2cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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); + Minecraft.getMinecraft().thePlayer.motionZ += 0.01D*Math.signum((double)chunkposition.chunkPosZ); + System.out.println((double)chunkposition.chunkPosX + " " + (double)chunkposition.chunkPosZ); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/e00a4c70e75300141786a2891bfc8d75 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/e00a4c70e75300141786a2891bfc8d75 new file mode 100644 index 0000000..0b7daf8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/e00a4c70e75300141786a2891bfc8d75 @@ -0,0 +1,85 @@ +package darkknight.jewelrycraft.particles; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import org.lwjgl.opengl.GL11; + +public class EntityShadowsFX extends EntityFX +{ + float moteParticleScale; + + public EntityShadowsFX(World world, double x, double y, double z, float size, float red, float green, float blue, float maxAge) + { + super(world, x, y, z, 0D, 0D, 0D); + + particleRed = red; + particleGreen = green; + particleBlue = blue; + particleMaxAge = (int) (28D / (Math.random() * 0.3D + 0.7D) * maxAge); + particleGravity = 0F; + motionX = motionY = motionZ = 0; + particleScale *= size; + moteParticleScale = particleScale; + noClip = true; + setSize(0.01F, 0.01F); + } + + @Override + public void renderParticle(Tessellator tessellator, float partialTicks, float minX, float minY, float minZ, float maxX, float maxZ) + { + tessellator.draw(); + ResourceLocation particle = new ResourceLocation("jewelrycraft", "textures/particle/shadows.png"); + Minecraft.getMinecraft().renderEngine.bindTexture(particle); + GL11.glColor4f(1, 1, 1, 1); + tessellator.startDrawingQuads(); + tessellator.setBrightness(this.getBrightnessForRender(0)); + float scale = 0.1F * particleScale; + float x = (float) (prevPosX + (posX - prevPosX) * partialTicks - interpPosX); + float y = (float) (prevPosY + (posY - prevPosY) * partialTicks - interpPosY); + float z = (float) (prevPosZ + (posZ - prevPosZ) * partialTicks - interpPosZ); + tessellator.setColorRGBA_F(particleRed, particleGreen, particleBlue, 0.5F); + tessellator.addVertexWithUV(x - minX * scale - maxX * scale, y - minY * scale, z - minZ * scale - maxZ * scale, 0, 0); + tessellator.addVertexWithUV(x - minX * scale + maxX * scale, y + minY * scale, z - minZ * scale + maxZ * scale, 1, 0); + tessellator.addVertexWithUV(x + minX * scale + maxX * scale, y + minY * scale, z + minZ * scale + maxZ * scale, 1, 1); + tessellator.addVertexWithUV(x + minX * scale - maxX * scale, y - minY * scale, z + minZ * scale - maxZ * scale, 0, 1); + tessellator.draw(); + tessellator.startDrawingQuads(); + } + + public void onUpdate() + { + super.onUpdate(); + AxisAlignedBB axisalignedbb = this.boundingBox.expand(1.0D, 16.0D, 1.0D); + List list1 = this.worldObj.getEntitiesWithinAABB(Entity.class, axisalignedbb); + if (list1 != null && !list1.isEmpty()) + { + Iterator iterator = list1.iterator(); + + while (iterator.hasNext()) + { + Entity entity = (Entity) iterator.next(); + if (entity != null && this.posX <= entity.posX + 0.5F && this.posX >= entity.posX - 0.5F && this.posZ <= entity.posZ + 0.5F && this.posZ >= entity.posZ - 0.5F) entity.attackEntityFrom(DamageSource.anvil, 100F); + if (entity instanceof EntityThrowable){ + ((EntityThrowable)entity).setDead(); + } + } + } + } + + public int getFXLayer() + { + return 2; + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/00ec9292a7ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/00ec9292a7ce00141801ff0972626827 new file mode 100644 index 0000000..b11c627 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/00ec9292a7ce00141801ff0972626827 @@ -0,0 +1,116 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + NBTTagCompound enemyData = target.getEntityData(); + if (jewelry instanceof ItemRing && pos != -1){ + if (target instanceof EntityPlayer){ + NBTTagCompound enemyInfo = PlayerUtils.getModPlayerPersistTag((EntityPlayer)target, "Jewelrycraft"); + if (enemyInfo.getInteger("reAttacked") == 0){ + enemyInfo.setInteger("reAttacked", enemyInfo.getInteger("reAttacked") + 1); + target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); + if (rand.nextInt(2) == 0){ + enemyInfo.setInteger("stunTime", 50); + enemyInfo.setBoolean("stunned", true); + } + } + }else if (enemyData.getInteger("reAttacked") == 0){ + enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); + if (rand.nextInt(2) == 0){ + enemyData.setInteger("stunTime", 50); + enemyData.setBoolean("stunned", true); + } + playerInfo.setBoolean("weakDamage", true); + } + } + if (target instanceof EntityPlayer){ + NBTTagCompound enemyInfo = PlayerUtils.getModPlayerPersistTag((EntityPlayer)target, "Jewelrycraft"); + if (enemyInfo.getInteger("reAttacked") == 1) enemyInfo.setInteger("reAttacked", 0); + }else 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, "Jewelrycraft"); + 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/35/50cdc566f48a00141c1cba3f7039360c b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/50cdc566f48a00141c1cba3f7039360c new file mode 100644 index 0000000..3161df0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/50cdc566f48a00141c1cba3f7039360c @@ -0,0 +1,617 @@ +package darkknight.jewelrycraft.util; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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 jewel + * The jewel you want to add on the item + */ + public static void addJewel(ItemStack item, ItemStack jewel) + { + if (jewel != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound jewelNBT = new NBTTagCompound(); + jewel.writeToNBT(jewelNBT); + itemStackData.setTag("jewel", jewelNBT); + } + } + + /** + * + * @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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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); + } + + public static void addJewelColor(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("jewelColor", color); + itemStackData.setTag("jewelColor", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + public static boolean isJewelX(ItemStack stack, ItemStack jewel) + { + if (jewel(stack) != null && jewel(stack).getItem() == jewel.getItem() && jewel(stack).getItemDamage() == jewel.getItemDamage()) return true; + return false; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack jewel(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewel")) + { + NBTTagCompound jewelNBT = (NBTTagCompound) stack.getTagCompound().getTag("jewel"); + ItemStack jewel = new ItemStack(Item.getItemById(0), 0, 0); + jewel.readFromNBT(jewelNBT); + return jewel; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static int jewelColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewelColor")) + { + NBTTagCompound colors = (NBTTagCompound) stack.getTagCompound().getTag("jewelColor"); + int color = colors.getInteger("jewelColor"); + int[] col = {color, 15532663, 11144319}; + return col[new Random().nextInt(3)]; + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/c0e606a470cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/c0e606a470cf00141de78e4a85bb2469 new file mode 100644 index 0000000..aa815f7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/c0e606a470cf00141de78e4a85bb2469 @@ -0,0 +1,41 @@ +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (rand.nextInt(5) == 0 && !world.isRemote && !(target instanceof EntityMob) && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && target.canAttackWithItem()){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if (player.getMaxHealth() >= 3F){ + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + player.setHealth(player.getHealth() - 1.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/9026020ff48a00141c1cba3f7039360c b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/9026020ff48a00141c1cba3f7039360c new file mode 100644 index 0000000..aba7191 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/9026020ff48a00141c1cba3f7039360c @@ -0,0 +1,618 @@ +package darkknight.jewelrycraft.util; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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 jewel + * The jewel you want to add on the item + */ + public static void addJewel(ItemStack item, ItemStack jewel) + { + if (jewel != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound jewelNBT = new NBTTagCompound(); + jewel.writeToNBT(jewelNBT); + itemStackData.setTag("jewel", jewelNBT); + } + } + + /** + * + * @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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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); + } + + public static void addJewelColor(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("jewelColor", color); + itemStackData.setTag("jewelColor", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + public static boolean isJewelX(ItemStack stack, ItemStack jewel) + { + if (jewel(stack) != null && jewel(stack).getItem() == jewel.getItem() && jewel(stack).getItemDamage() == jewel.getItemDamage()) return true; + return false; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack jewel(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewel")) + { + NBTTagCompound jewelNBT = (NBTTagCompound) stack.getTagCompound().getTag("jewel"); + ItemStack jewel = new ItemStack(Item.getItemById(0), 0, 0); + jewel.readFromNBT(jewelNBT); + return jewel; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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"); + int[] col = {color, 142323, 213552}; + return col[new Random().nextInt(3)]; + } + return 16777215; + } + + public static int jewelColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewelColor")) + { + NBTTagCompound colors = (NBTTagCompound) stack.getTagCompound().getTag("jewelColor"); + int color = colors.getInteger("jewelColor"); + int[] col = {color, 142323, 213552}; + return col[new Random().nextInt(3)]; + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/9032f899b7d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/9032f899b7d000141b65e2fc7f94332d new file mode 100644 index 0000000..ab22d90 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/9032f899b7d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 16, y + 25, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/a0809e1223cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/a0809e1223cf00141c41f52413db5e31 new file mode 100644 index 0000000..1c5ca9c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/a0809e1223cf00141c41f52413db5e31 @@ -0,0 +1,460 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + event.setCanceled(true); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/37/10568ea1b7d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/10568ea1b7d000141b65e2fc7f94332d new file mode 100644 index 0000000..60b6c0a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/10568ea1b7d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 15, y + 27, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/a0c4fa6984d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/a0c4fa6984d000141a1fb02abca5ff55 new file mode 100644 index 0000000..d16ec6f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/a0c4fa6984d000141a1fb02abca5ff55 @@ -0,0 +1,69 @@ +package darkknight.jewelrycraft.effects; + +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.DamageSource; +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) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1) Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.0F); + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/002a7b0fb7d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/002a7b0fb7d000141b65e2fc7f94332d new file mode 100644 index 0000000..cd0101c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/002a7b0fb7d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/10dc7459bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/10dc7459bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..1f90dd8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/10dc7459bbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 90); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/606c08157ecf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/606c08157ecf00141de78e4a85bb2469 new file mode 100644 index 0000000..83be132 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/606c08157ecf00141de78e4a85bb2469 @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.client; + +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.CommonProxy; +import darkknight.jewelrycraft.block.BlockList; +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.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.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.ItemRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +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; + +public class ClientProxy extends CommonProxy +{ + @Override +// public void registerRenderers() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation("jewelrycraft", "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation("jewelrycraft", "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(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("jewelrycraft", "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("jewelrycraft", "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/7064faac7dcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/7064faac7dcf00141de78e4a85bb2469 new file mode 100644 index 0000000..acfa026 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/7064faac7dcf00141de78e4a85bb2469 @@ -0,0 +1,186 @@ +/* + * 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.commands.JewelrycraftCommands; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.container.GuiHandler; +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.lib.Reference; +import darkknight.jewelrycraft.network.PacketClearColorCache; +import darkknight.jewelrycraft.network.PacketKeyPressEvent; +import darkknight.jewelrycraft.network.PacketRequestLiquidData; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; +import darkknight.jewelrycraft.network.PacketSendCurseStats; +import darkknight.jewelrycraft.network.PacketSendLiquidData; +import darkknight.jewelrycraft.network.PacketSendPlayerInfo; +import darkknight.jewelrycraft.recipes.CraftingRecipes; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +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 = Reference.MODID, name = Reference.MODNAME, version = Reference.VERSION) +public class JewelrycraftMod +{ + @Instance (Reference.MODID) + public static JewelrycraftMod instance; + @SidedProxy (clientSide = "darkknight.jewelrycraft.client.ClientProxy", serverSide = "darkknight.jewelrycraft.CommonProxy") + public static CommonProxy proxy; + public static final Logger logger = Logger.getLogger("Jewelrycraft"); + public static File dir; + public static CreativeTabs jewelrycraft = new CreativeTabs("JewelryCraft"){ + @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; + public static final int MAX_CURSES = 10; + + /** + * 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, "Jewelrycraft: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("DarkKnight (or sor1n)"); + authorList.add("bspkrs"); + authorList.add("domi1819"); + + dir = e.getModConfigurationDirectory(); + proxy.registerRenderers(); + netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.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); + metadata.autogenerated = false; + metadata.authorList = authorList; + metadata.url = "https://github.com/sor1n/Jewelrycraft"; + + createEntity(EntityHeart.class, "Heart", 0x000000, 0xFF0000, true); + createEntity(EntityHalfHeart.class, "Half-Heart", 0x000000, 0xFF0000, true); + +// 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); + } + + @Mod.EventHandler + public void serverLoad(FMLServerStartingEvent event) + { + event.registerServerCommand(new JewelrycraftCommands()); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/10890341bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/10890341bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..6494f00 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/10890341bbd000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/3024e21485d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/3024e21485d000141a1fb02abca5ff55 new file mode 100644 index 0000000..fb763fd --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/3024e21485d000141a1fb02abca5ff55 @@ -0,0 +1,79 @@ +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) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && rand.nextInt(500) == 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 ore around you.")); + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/503ff62fb6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/503ff62fb6d000141b65e2fc7f94332d new file mode 100644 index 0000000..3fd51ed --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/503ff62fb6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 145, 150, 35, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/60160ac99ad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/60160ac99ad000141b65e2fc7f94332d new file mode 100644 index 0000000..ac47a51 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/60160ac99ad000141b65e2fc7f94332d @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabModifiers extends GuiTab +{ + int maxPages; + public GuiTabModifiers(int id) + { + super("Modifiers", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.blaze_powder); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all of modifiers that have a use and what they do, in the form of a story/riddle/poem. However different jewellery have different effects for the same modifier."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 2: + text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.blaze_powder), text, 40f); + break; + case 3: + text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Against an arrow you can't compare, so move around, don't just stare. Fire is your enemy and weakness is the penalty."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.feather), text, 40f); + break; + case 4: + text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.ender_eye), text, 40f); + break; + } + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return 4; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/90a539afbbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/90a539afbbd000141b65e2fc7f94332d new file mode 100644 index 0000000..1e2ce65 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/90a539afbbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/0091dffeb5d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/0091dffeb5d000141b65e2fc7f94332d new file mode 100644 index 0000000..787595c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/0091dffeb5d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 145, 150, 35, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/30f66b0413cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/30f66b0413cf00141c41f52413db5e31 new file mode 100644 index 0000000..b4cb070 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/30f66b0413cf00141c41f52413db5e31 @@ -0,0 +1,57 @@ +package darkknight.jewelrycraft.effects; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; + +public class ModifierEffects +{ + protected ItemStack modifier; + protected Random rand = new Random(); + protected static ArrayList effects = new ArrayList(); + + /** + * @param modifier + */ + public ModifierEffects(ItemStack modifier) + { + this.modifier = modifier; + effects.add(this); + } + + /** + * @return + */ + public static ArrayList getEffects() + { + return effects; + } + + /** + * @param item + * @param player + * @param jewelry + */ + public void action(ItemStack item, EntityPlayer player, Item jewelry){}; + /** + * @param item + * @param player + * @param target + * @param jewelry + * @return + */ + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount){}; + + /** + * @param item + * @param player + * @param source + * @param jewelry + * @return + */ + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount){}; +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/5019b6d220cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/5019b6d220cf00141c41f52413db5e31 new file mode 100644 index 0000000..938ad15 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/5019b6d220cf00141c41f52413db5e31 @@ -0,0 +1,32 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +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.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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)){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20f && rand.nextInt(5) == 0) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/7005297f22cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/7005297f22cf00141c41f52413db5e31 new file mode 100644 index 0000000..7cd0f97 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/7005297f22cf00141c41f52413db5e31 @@ -0,0 +1,460 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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)); + } + } + event.setCanceled(true); + } + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/3e/808884ea13cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/808884ea13cf00141c41f52413db5e31 new file mode 100644 index 0000000..c7f0fae --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/808884ea13cf00141c41f52413db5e31 @@ -0,0 +1,28 @@ +package darkknight.jewelrycraft.curses; + +import darkknight.jewelrycraft.util.PlayerUtils; +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void deathAction(World world, EntityPlayer player) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20f) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 2.0F); + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/30afb93df48a00141c1cba3f7039360c b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/30afb93df48a00141c1cba3f7039360c new file mode 100644 index 0000000..0a36cb6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/30afb93df48a00141c1cba3f7039360c @@ -0,0 +1,617 @@ +package darkknight.jewelrycraft.util; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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 jewel + * The jewel you want to add on the item + */ + public static void addJewel(ItemStack item, ItemStack jewel) + { + if (jewel != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound jewelNBT = new NBTTagCompound(); + jewel.writeToNBT(jewelNBT); + itemStackData.setTag("jewel", jewelNBT); + } + } + + /** + * + * @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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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); + } + + public static void addJewelColor(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("jewelColor", color); + itemStackData.setTag("jewelColor", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + public static boolean isJewelX(ItemStack stack, ItemStack jewel) + { + if (jewel(stack) != null && jewel(stack).getItem() == jewel.getItem() && jewel(stack).getItemDamage() == jewel.getItemDamage()) return true; + return false; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack jewel(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewel")) + { + NBTTagCompound jewelNBT = (NBTTagCompound) stack.getTagCompound().getTag("jewel"); + ItemStack jewel = new ItemStack(Item.getItemById(0), 0, 0); + jewel.readFromNBT(jewelNBT); + return jewel; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static int jewelColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewelColor")) + { + NBTTagCompound colors = (NBTTagCompound) stack.getTagCompound().getTag("jewelColor"); + int color = colors.getInteger("jewelColor"); + int[] col = {color, 999900, 119999}; + return col[new Random().nextInt(3)]; + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/50b62efab9d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/50b62efab9d000141b65e2fc7f94332d new file mode 100644 index 0000000..e569381 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/50b62efab9d000141b65e2fc7f94332d @@ -0,0 +1,232 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/6048b993bcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/6048b993bcd000141b65e2fc7f94332d new file mode 100644 index 0000000..907d02c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/6048b993bcd000141b65e2fc7f94332d @@ -0,0 +1,243 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/c022d38cf2cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/c022d38cf2cf0014170de422db399e8d new file mode 100644 index 0000000..b60d4a0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/c022d38cf2cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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); + Minecraft.getMinecraft().thePlayer.motionZ -= 0.01D*Math.signum((double)chunkposition.chunkPosZ); + System.out.println(chunkposition.chunkPosX + " " + player.posX); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/e0ed63d312cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/e0ed63d312cf00141c41f52413db5e31 new file mode 100644 index 0000000..cb38b76 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/e0ed63d312cf00141c41f52413db5e31 @@ -0,0 +1,261 @@ +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 ItemBaseJewelry extends Item +{ + public ItemBaseJewelry() + { + super(); + setMaxStackSize(1); + setCreativeTab(JewelrycraftMod.jewelrycraft); + } + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + try{ + return color(stack, pass); + } + catch(IOException e){ + e.printStackTrace(); + } + return 16777215; + } + + /** + * @param stack + * @param pass + * @return + * @throws IOException + */ + public static int color(ItemStack stack, int pass) throws IOException + { + IResourceManager rm = Minecraft.getMinecraft().getResourceManager(); + BufferedImage icon; + if (pass == 0 && stack != null && JewelryNBT.ingot(stack) != null && Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) > 0 && JewelryNBT.ingot(stack).getIconIndex() != null && JewelryNBT.ingotColor(stack) == 16777215){ + ItemStack ingot = JewelryNBT.ingot(stack); + icon = ImageIO.read(rm.getResource(getLocation(ingot, stack, true)).getInputStream()); + int height = icon.getHeight(); + int width = icon.getWidth(); + Map m = new HashMap(); + for(int i = 0; i < width; i++) + for(int j = 0; j < height; j++){ + int rgb = icon.getRGB(i, j); + int red = rgb >> 16 & 0xff; + int green = rgb >> 8 & 0xff; + int blue = rgb & 0xff; + int[] rgbArr = {red, green, blue}; + int Cmax = Math.max(red, Math.max(green, blue)); + int Cmin = Math.min(red, Math.min(green, blue)); + if (!isGray(rgbArr)) m.put(rgb, (Cmax + Cmin) / 2); + } + int color = getMostCommonColour(m); + if (JewelryNBT.ingot(stack) != null && JewelryNBT.ingot(stack).getItem().getColorFromItemStack(JewelryNBT.ingot(stack), 1) != 16777215) JewelryNBT.addIngotColor(stack, JewelryNBT.ingot(stack).getItem().getColorFromItemStack(JewelryNBT.ingot(stack), 1)); + else JewelryNBT.addIngotColor(stack, color); + }else if (pass == 1 && stack != null && JewelryNBT.gem(stack) != null && JewelryNBT.gem(stack).getIconIndex() != null && JewelryNBT.gem(stack) != null){ + ItemStack gem = JewelryNBT.gem(stack); + icon = ImageIO.read(rm.getResource(getLocation(gem, stack, true)).getInputStream()); + int height = icon.getHeight(); + int width = icon.getWidth(); + Map m = new HashMap(); + for(int i = 0; i < width; i++) + for(int j = 0; j < height; j++){ + int rgb = icon.getRGB(i, j); + int red = rgb >> 16 & 0xff; + int green = rgb >> 8 & 0xff; + int blue = rgb & 0xff; + int[] rgbArr = {red, green, blue}; + int Cmax = Math.max(red, Math.max(green, blue)); + int Cmin = Math.min(red, Math.min(green, blue)); + if (!isGray(rgbArr)) m.put(rgb, (Cmax + Cmin) / 2); + } + int color = getMostCommonColour(m); + if (JewelryNBT.gem(stack).getItem().getColorFromItemStack(JewelryNBT.gem(stack), 1) == 16777215) JewelryNBT.addGemColor(stack, color); + else JewelryNBT.addGemColor(stack, JewelryNBT.gem(stack).getItem().getColorFromItemStack(JewelryNBT.gem(stack), 1)); + } + if (pass == 0 && JewelryNBT.ingot(stack) != null) return JewelryNBT.ingotColor(stack); + if (pass == 1 && JewelryNBT.gem(stack) != null) return JewelryNBT.gemColor(stack); + else if (JewelryNBT.ingot(stack) != null) return JewelryNBT.ingotColor(stack); + return 16777215; + } + + /** + * @param item + * @param stack + * @param changeMeta + * @return + */ + public static ResourceLocation getLocation(ItemStack item, ItemStack stack, boolean changeMeta) + { + String domain = ""; + String texture; + if (changeMeta && (Item.getIdFromItem(item.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(item.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(item.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(item.getItem()) == Block.getIdFromBlock(Blocks.carpet))) item.setItemDamage(15 - item.getItemDamage()); + IIcon itemIcon = item.getItem().getIcon(item, 0); + String iconName = itemIcon.getIconName(); + if (iconName.substring(0, iconName.indexOf(":") + 1) != "") domain = iconName.substring(0, iconName.indexOf(":") + 1).replace(":", " ").trim(); + else domain = "minecraft"; + texture = iconName.substring(iconName.lastIndexOf(":") + 1) + ".png"; + ResourceLocation textureLocation = null; + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); + if (texturemanager.getResourceLocation(item.getItemSpriteNumber()).toString().contains("items")) textureLocation = new ResourceLocation(domain.toLowerCase(), "textures/items/" + texture); + else textureLocation = new ResourceLocation(domain.toLowerCase(), "textures/blocks/" + texture); + return textureLocation; + } + + /** + * @param map + * @return + */ + public static int getMostCommonColour(Map map) + { + List list = new LinkedList(map.entrySet()); + Collections.sort(list, new Comparator(){ + public int compare(Object o1, Object o2) + { + return ((Comparable)((Map.Entry)o1).getValue()).compareTo(((Map.Entry)o2).getValue()); + } + }); + Map.Entry me = (Map.Entry)list.get(list.size() - 1); + for(int i = 0; i < list.size(); i++){ + float alpha = Float.valueOf(list.get(i).toString().split("=")[1]); + if (alpha < 180) me = (Map.Entry)list.get(i); + } + int rgb = (Integer)me.getKey(); + return rgb; + } + + /** + * @param rgbArr + * @return + */ + public static boolean isGray(int[] rgbArr) + { + int rgbSum = rgbArr[0] + rgbArr[1] + rgbArr[2]; + if (rgbSum > 0 && rgbSum < 256 * 3) return false; + return true; + } + + /** + * @param stack + * @return + */ + 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(); + } + + /** + * allows items to add custom lines of information to the mouseover description. + * + * @param stack + * @param player + * @param list + * @param par4 + */ + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if (stack.hasTagCompound() && par4){ + ItemStack ingot = JewelryNBT.ingot(stack); + if (ingot != null && Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) > 0) list.add("Ingot: " + EnumChatFormatting.YELLOW + ingot.getDisplayName()); + ItemStack gem = JewelryNBT.gem(stack); + if (gem != null) list.add("Gem: " + EnumChatFormatting.BLUE + gem.getDisplayName()); + ArrayList modifier = JewelryNBT.modifier(stack); + if (!modifier.isEmpty()) list.add("Modifiers: "); + for(int i = 0; i < modifier.size(); i++) + list.add(EnumChatFormatting.DARK_PURPLE + modifier.get(i).getDisplayName() + " x" + modifier.get(i).stackSize); + } + } + + /** + * @param stack + * @param player + */ + public void action(ItemStack stack, EntityPlayer player) + { + for(ModifierEffects mod: ModifierEffects.getEffects()) + mod.action(stack, player, this); + } + + /** + * @param item + * @param player + * @param source + * @return + */ + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, float amount) + { + for(ModifierEffects mod: ModifierEffects.getEffects()) + return mod.onPlayerAttackedCacellable(item, player, source, this, amount); + return false; + } + + /** + * @param item + * @param player + * @param target + * @return + */ + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, float amount) + { + for(ModifierEffects mod: ModifierEffects.getEffects()) + return mod.onEntityAttackedCacellable(item, player, target, this, amount); + return false; + } + + /** + * @param item + * @param player + * @param source + * @return + */ + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, float amount) + { + for(ModifierEffects mod: ModifierEffects.getEffects()) mod.onPlayerAttacked(item, player, source, this, amount); + } + + /** + * @param item + * @param player + * @param target + * @return + */ + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, float amount) + { + for(ModifierEffects mod: ModifierEffects.getEffects()) mod.onEntityAttacked(item, player, target, this, amount); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/003ee58eafd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/003ee58eafd000141b65e2fc7f94332d new file mode 100644 index 0000000..8b2e5b5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/003ee58eafd000141b65e2fc7f94332d @@ -0,0 +1,247 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + if(ItemStack.areItemStacksEqual(item, new ItemStack(Blocks.light_weighted_pressure_plate, 1, 0)))GL11.glRotatef(25.0F, -1.0F, 0.0F, 0.0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + GL11.glPushMatrix(); + drawHoveringText(lst, x, y, fontRendererObj); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glPopMatrix(); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/c02871fbb6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/c02871fbb6d000141b65e2fc7f94332d new file mode 100644 index 0000000..59daac9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/c02871fbb6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 20, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/b0889c1bbcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/b0889c1bbcd000141b65e2fc7f94332d new file mode 100644 index 0000000..0264b78 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/b0889c1bbcd000141b65e2fc7f94332d @@ -0,0 +1,115 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/c080ae01bcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/c080ae01bcd000141b65e2fc7f94332d new file mode 100644 index 0000000..02a7037 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/c080ae01bcd000141b65e2fc7f94332d @@ -0,0 +1,236 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/20200c94b8d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/20200c94b8d000141b65e2fc7f94332d new file mode 100644 index 0000000..bad5b6a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/20200c94b8d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/70f7cff5b6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/70f7cff5b6d000141b65e2fc7f94332d new file mode 100644 index 0000000..fcbad49 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/70f7cff5b6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 154, 30, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/50241a6d84c600141066cb38d875561a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/50241a6d84c600141066cb38d875561a new file mode 100644 index 0000000..93f2346 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/50241a6d84c600141066cb38d875561a @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.PlayerUtils; + +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); + // 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(); + } + } + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + {} + + @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, "Jewelrycraft"); + if (jewelry instanceof ItemNecklace && pos != -1 && rand.nextInt(4) == 0){ + 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 * 6F); + // Negative earrings + if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); + } + + @Override + public boolean onPlayerFall(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/d0a17b8f13cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/d0a17b8f13cf00141c41f52413db5e31 new file mode 100644 index 0000000..d4ba829 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/d0a17b8f13cf00141c41f52413db5e31 @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void deathAction(World world, EntityPlayer player) + { + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/90a975eca4ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/90a975eca4ce00141801ff0972626827 new file mode 100644 index 0000000..fd23486 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/90a975eca4ce00141801ff0972626827 @@ -0,0 +1,103 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + 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); + playerInfo.setBoolean("stunned", 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, "Jewelrycraft"); + 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/46/104eb856f48a00141c1cba3f7039360c b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/104eb856f48a00141c1cba3f7039360c new file mode 100644 index 0000000..893ff84 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/104eb856f48a00141c1cba3f7039360c @@ -0,0 +1,617 @@ +package darkknight.jewelrycraft.util; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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 jewel + * The jewel you want to add on the item + */ + public static void addJewel(ItemStack item, ItemStack jewel) + { + if (jewel != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound jewelNBT = new NBTTagCompound(); + jewel.writeToNBT(jewelNBT); + itemStackData.setTag("jewel", jewelNBT); + } + } + + /** + * + * @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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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); + } + + public static void addJewelColor(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("jewelColor", color); + itemStackData.setTag("jewelColor", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + public static boolean isJewelX(ItemStack stack, ItemStack jewel) + { + if (jewel(stack) != null && jewel(stack).getItem() == jewel.getItem() && jewel(stack).getItemDamage() == jewel.getItemDamage()) return true; + return false; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack jewel(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewel")) + { + NBTTagCompound jewelNBT = (NBTTagCompound) stack.getTagCompound().getTag("jewel"); + ItemStack jewel = new ItemStack(Item.getItemById(0), 0, 0); + jewel.readFromNBT(jewelNBT); + return jewel; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static int jewelColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewelColor")) + { + NBTTagCompound colors = (NBTTagCompound) stack.getTagCompound().getTag("jewelColor"); + int color = colors.getInteger("jewelColor"); + int[] col = {color, 15532663, 119999}; + return col[new Random().nextInt(3)]; + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/7051d7cf22cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/7051d7cf22cf00141c41f52413db5e31 new file mode 100644 index 0000000..3cdb2bc --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/7051d7cf22cf00141c41f52413db5e31 @@ -0,0 +1,460 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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() <= 1) event.setCanceled(true); + if (player.getHealth() != player.prevHealth || player.getHealth() <= 0){ + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/48/20293dcd23cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/20293dcd23cf00141c41f52413db5e31 new file mode 100644 index 0000000..b6321a9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/20293dcd23cf00141c41f52413db5e31 @@ -0,0 +1,99 @@ +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; + +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("jewelrycraft", "textures/gui/hearts.png"); + + public ScreenHandler(Minecraft mc, ResourceLocation tex) + { + super(); + this.mc = mc; + texture = tex; + } + + @SubscribeEvent + public void renderScreen(RenderGameOverlayEvent event) + { + 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(texture); + 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); + count++; + } + } + 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(4, 4 + (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.glColor4f(1f, 1f, 1f, 1.0f); + mc.renderEngine.bindTexture(hearts); + count = 0; + 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); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/f0362027f4cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/f0362027f4cf0014170de422db399e8d new file mode 100644 index 0000000..339dd64 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/f0362027f4cf0014170de422db399e8d @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/2066f1c9bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/2066f1c9bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..f404f18 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/2066f1c9bbd000141b65e2fc7f94332d @@ -0,0 +1,115 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + GL11.glTranslatef(0F, 0.2F, 0F); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/707c7127bed000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/707c7127bed000141b65e2fc7f94332d new file mode 100644 index 0000000..70a597e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/707c7127bed000141b65e2fc7f94332d @@ -0,0 +1,178 @@ +package darkknight.jewelrycraft.container; + +import java.awt.Desktop; +import java.net.URL; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.item.ItemList; + +public class GuiTabBlocks extends GuiTab +{ + + /** + * @param id + */ + public GuiTabBlocks(int id) + { + super("Blocks", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.jewelAltar); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "This ore is extremely rare and can be found only between Y-level 5 and 8. It can only be mined using a diamond pickaxe."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(BlockList.shadowOre), text, 90f, true); + break; + case 2: + text = "The Shadow Block is crafted using 9 shadow ingots. Magicians believed it held the ability to merge with the shadows. It becomes more transparent as it"; + Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.shadowBlock), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot)); + break; + case 3: + text = "gets darker. If a comparator is attached to it, the output strength will be equal to the value of darkness it is in."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 4: + text = "The smelter is one of the first blocks needed to get started with Jewelrycraft. Requiring just some cobble and a couple buckets. It is required in order to"; + Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.smelter), new ItemStack(Blocks.cobblestone), new ItemStack(Items.bucket), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.cobblestone)); + break; + case 5: + text = "melt ingots or even ores which can be made into rings, necklaces, bracelets or earrings. To use the block all you need to do is right click on it with any ore or ingot. It can melt multimple ingots/ores at a time. Crouch (default: Shift) + Right Click will remove all items"; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 6: + text = "added. If right clicked when done smelting, it will say what the block contains."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 7: + text = "The molder is a key piece in creating jewellery. You need to pour the molten metal out of the smelter somewhere. That somewhere is the"; + Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.molder), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone)); + break; + case 8: + text = "molder. But before pouring the molten metal in it, you must first add a mold. You can do that by simply right clicking the block with the mold of your choice. If you want to get the mold out, simply crouch and Right Click it with an empty hand. Once you"; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 9: + text = "have a mold inside, left click on the smelter and wait for the metal to cool down. When it's done, left click on the molder to get the jewellery. Be aware that this block must be placed directly in front of the smelter, otherwise it won't work!"; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 10: + text = "This table allows you to add a gem to a piece of jewellery. Right click the block while holding a jewellery to add it in. Then do the same with a gem (you"; + if (del == 0) values++; + del++; + if (del >= 300) del = 0; + if (values >= 4) values = 0; + Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.jewelCraftingTable), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone)); + break; + case 11: + text = "can find a list with all possible gems in this guide). Crouch + Right Click to retreive placed items. Left Click the block to see the progress the crafting has made. Once the crafting is done, Left Click the block to get the item. You are able to recraft a"; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 12: + text = "jewellery by readding the modified version to this block and adding a different gem to it. Once the crafting is done, the current gem will be replaced by the new one. There is also a 50% chance that you will get back the old gem."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 13: + text = "This block can store any jewellery in it and activate their effects as it were a player. To do that simply right click the block with a jewellery. Crouch +"; + Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.jewelAltar), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.wool, 1, 5), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.nether_brick), new ItemStack(Blocks.wool, 1, 5), new ItemStack(Blocks.nether_brick), new ItemStack(Blocks.nether_brick), new ItemStack(Blocks.nether_brick), new ItemStack(Blocks.nether_brick)); + break; + case 14: + text = "Right Click to retreive the jewellery."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 15: + text = "The Storage Displayer, as the name suggests, can store a large amount (Up to: " + Integer.MAX_VALUE + ") of a single item/block placed in it. It will"; + Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.displayer), null, new ItemStack(Items.iron_ingot), null, new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot), new ItemStack(Blocks.emerald_block), new ItemStack(Blocks.emerald_block), new ItemStack(Blocks.emerald_block)); + break; + case 16: + text = "display all possible infromation about the object in it, such as the name, durability, enchantments etc. To store something in it simply right click with that object on it and the whole amount of items or blocks you are holding will be immediately stored inside."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 17: + text = "If a displayer already contains an item and you have that in your inventory, you can simply hold right click on it with an empty hand to add all of your items of that type from your inventory. To retrieve a single item just left click the block. If you wish to"; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 18: + text = "get a whole stack, Crouch + Left Click on it. In creative mode you can simply hold Right Click on a displayer containing an object and it will add 64 of it with every right click, without it being in your inventory."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 19: + text = "This mysterious shaped block is used in the ritual. The acient ones claimed it had the power to travel through worlds. They would use these to offer"; + Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.handPedestal), new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall), null, new ItemStack(Blocks.stonebrick), null, new ItemStack(Blocks.stone_slab, 1, 5), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stone_slab, 1, 5)); + break; + case 20: + text = "sacrifices to 'The Dark One' in exchange for unimaginable powers."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 21: + text = "The Cursed Eye is an ancient artifact also known as 'The Dark One's Eye'. It is part of the sacrifice ritual the ancient ones talk about. Be careful"; + Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.shadowEye), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Items.ender_eye), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick)); + break; + case 22: + String link = "HERE"; + if (x >= gui.getLeft() + 130 && x <= gui.getLeft() + 160 && y >= gui.getTop() + 40 && y <= gui.getTop() + 50) link = EnumChatFormatting.DARK_BLUE + "HERE" + EnumChatFormatting.BLACK; + text = "though, for He sees everything. To see how to create the ritual click " + link + " for a link with the pictures (will be part of the book later)."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + default: + ; + } + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return 21; + } + + /** + * @param gui + * @param x + * @param y + * @param button + */ + @Override + public void mouseClick(GuiGuide gui, int x, int y, int button) + { + if (gui.page == 21 && x >= gui.getLeft() + 130 && x <= gui.getLeft() + 160 && y >= gui.getTop() + 40 && y <= gui.getTop() + 50) try{ + Desktop.getDesktop().browse(new URL("http://imgur.com/a/Zk0LW").toURI()); + } + catch(Exception e){} + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/4009975e82d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/4009975e82d000141a1fb02abca5ff55 new file mode 100644 index 0000000..e538d87 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/4009975e82d000141a1fb02abca5ff55 @@ -0,0 +1,67 @@ +package darkknight.jewelrycraft.effects; + +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.DamageSource; +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 +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1) Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 0.0F); + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/6016724bbad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/6016724bbad000141b65e2fc7f94332d new file mode 100644 index 0000000..fb06bc8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/6016724bbad000141b65e2fc7f94332d @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class GuiTabGemsAndIngots extends GuiTab +{ + + /** + * @param id + */ + public GuiTabGemsAndIngots(int id) + { + super("Gems and ingots", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.emerald); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + for(int i = (page - 1) * 9; i < page * 9; i++) + if (i < JewelrycraftUtil.gem.size()){ + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Gems", gui.getLeft() + xPos + 40, gui.getTop(), 0); + gui.renderItem(JewelrycraftUtil.gem.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f, true); + gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.gem.get(i).getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + page -= JewelrycraftUtil.gem.size() / 9 + 1; + for(int i = (page - 1) * 9; i < page * 9; i++) + if (i < JewelrycraftUtil.metal.size() && page > 0){ + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ingots", gui.getLeft() + xPos + 40, gui.getTop(), 0); + gui.renderItem(JewelrycraftUtil.metal.get(i).copy(), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f, true, 0, 0, 0); + gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.metal.get(i).copy().getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return JewelrycraftUtil.gem.size() / 9 + JewelrycraftUtil.metal.size() / 9 + 2; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/9089738c21cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/9089738c21cf00141c41f52413db5e31 new file mode 100644 index 0000000..13ea746 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/9089738c21cf00141c41f52413db5e31 @@ -0,0 +1,36 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +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.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (!(target instanceof EntityMob)){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/20a0a61c84d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/20a0a61c84d000141a1fb02abca5ff55 new file mode 100644 index 0000000..5c223aa --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/20a0a61c84d000141a1fb02abca5ff55 @@ -0,0 +1,13 @@ +package darkknight.jewelrycraft.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; + +public class BlockJCOre extends Block +{ + protected BlockJCOre() + { + super(Material.rock); + setHarvestLevel("pickaxe", 3); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/20bea20c21cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/20bea20c21cf00141c41f52413db5e31 new file mode 100644 index 0000000..4e56fc1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/20bea20c21cf00141c41f52413db5e31 @@ -0,0 +1,36 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +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.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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)){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20f && rand.nextInt(5) == 0){ + playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 2.0F); + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 2.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/405c7f377ecf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/405c7f377ecf00141de78e4a85bb2469 new file mode 100644 index 0000000..a129467 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/405c7f377ecf00141de78e4a85bb2469 @@ -0,0 +1,13 @@ +package darkknight.jewelrycraft; + +/** + * The Class CommonProxy. + */ +public class CommonProxy +{ + /** + * Register renderers. + */ + public void preInit() + {} +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/90de45a1bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/90de45a1bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..0a83583 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/90de45a1bbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/a055ddd2bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/a055ddd2bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..5c7fc7a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/a055ddd2bbd000141b65e2fc7f94332d @@ -0,0 +1,115 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + GL11.glTranslatef(0F, 1.2F, 0F); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/d0c27ea5f6cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/d0c27ea5f6cf0014170de422db399e8d new file mode 100644 index 0000000..94f79d9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/d0c27ea5f6cf0014170de422db399e8d @@ -0,0 +1,66 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote && rand.nextInt(30) == 0) player.setPositionAndUpdate(player.posX + rand.nextInt(30)*(rand.nextBoolean()?-1:1), player.posY + rand.nextInt(5)*(rand.nextBoolean()?-1:1), player.posZ + rand.nextInt(30)*(rand.nextBoolean()?-1:1)); + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/1031dd2dbbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/1031dd2dbbd000141b65e2fc7f94332d new file mode 100644 index 0000000..703495d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/1031dd2dbbd000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 25, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/70c9f176f2cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/70c9f176f2cf0014170de422db399e8d new file mode 100644 index 0000000..802343e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/70c9f176f2cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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); + Minecraft.getMinecraft().thePlayer.motionZ -= 0.01D*Math.signum((double)chunkposition.chunkPosZ); + System.out.println((double)chunkposition.chunkPosX + " " + player.posX); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/f08f115612cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/f08f115612cf00141c41f52413db5e31 new file mode 100644 index 0000000..eecce2f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/f08f115612cf00141c41f52413db5e31 @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void action(World world, EntityPlayer player) + { + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/50025dc484c600141066cb38d875561a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/50025dc484c600141066cb38d875561a new file mode 100644 index 0000000..1d7f96a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/50025dc484c600141066cb38d875561a @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.PlayerUtils; + +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); + // 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(); + } + } + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + {} + + @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, "Jewelrycraft"); + if (jewelry instanceof ItemNecklace && pos != -1 && rand.nextInt(4) == 0 && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ + player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage! " + source)); + 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 * 4F); + // Negative earrings + if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); + } + + @Override + public boolean onPlayerFall(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/b0576841f2cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/b0576841f2cf0014170de422db399e8d new file mode 100644 index 0000000..5e7a241 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/b0576841f2cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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); + Minecraft.getMinecraft().thePlayer.motionZ = 0.01D*Math.signum((double)chunkposition.chunkPosZ); + System.out.println((double)chunkposition.chunkPosX + " " + (double)chunkposition.chunkPosZ); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/007bc83ab6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/007bc83ab6d000141b65e2fc7f94332d new file mode 100644 index 0000000..9c481c8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/007bc83ab6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 145, 150, 35, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, 10, 20); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/402d4daebcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/402d4daebcd000141b65e2fc7f94332d new file mode 100644 index 0000000..1a73edd --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/402d4daebcd000141b65e2fc7f94332d @@ -0,0 +1,246 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + GL11.glEnable(GL11.GL_LIGHT1); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + RenderHelper.enableStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHT1); + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/e0d9514683d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/e0d9514683d000141a1fb02abca5ff55 new file mode 100644 index 0000000..28be82b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/e0d9514683d000141a1fb02abca5ff55 @@ -0,0 +1,79 @@ +package darkknight.jewelrycraft.effects; + +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.DamageSource; +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) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1){ + if(!originalVD){ + originalViewDistance = Minecraft.getMinecraft().gameSettings.getOptionFloatValue(Options.RENDER_DISTANCE); + originalVD = true; + } + Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.0F); + } + else if(originalVD){ + Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, originalViewDistance); + originalVD = false; + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/f00c439cb7d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/f00c439cb7d000141b65e2fc7f94332d new file mode 100644 index 0000000..bad5b6a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/f00c439cb7d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/10b548dabad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/10b548dabad000141b65e2fc7f94332d new file mode 100644 index 0000000..ab28319 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/10b548dabad000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -135, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/70986997b7d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/70986997b7d000141b65e2fc7f94332d new file mode 100644 index 0000000..bad5b6a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/70986997b7d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/c0326ecba5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/c0326ecba5ce00141801ff0972626827 new file mode 100644 index 0000000..f20b813 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/c0326ecba5ce00141801ff0972626827 @@ -0,0 +1,448 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + playerInfo.setBoolean("stunned", true); + playerInfo.setInteger("stunTime", 50); + 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 + entity.height, 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/52/e06a0851bdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/e06a0851bdd000141b65e2fc7f94332d new file mode 100644 index 0000000..9bb83d4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/e06a0851bdd000141b65e2fc7f94332d @@ -0,0 +1,125 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + + case 5: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + break; + } + } + + @Override + public int getMaxPages() + { + return 5; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/90cafa5d14cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/90cafa5d14cf00141c41f52413db5e31 new file mode 100644 index 0000000..98427f5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/90cafa5d14cf00141c41f52413db5e31 @@ -0,0 +1,35 @@ +package darkknight.jewelrycraft.curses; + +import darkknight.jewelrycraft.util.PlayerUtils; +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void deathAction(World world, EntityPlayer player) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20f) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 2.0F); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20f) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 2.0F); + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/8048f9edb6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/8048f9edb6d000141b65e2fc7f94332d new file mode 100644 index 0000000..0dfc842 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/8048f9edb6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 149, 150, 30, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/a09b425fbbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/a09b425fbbd000141b65e2fc7f94332d new file mode 100644 index 0000000..1f4f5f2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/a09b425fbbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 180, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/90504c0bbbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/90504c0bbbd000141b65e2fc7f94332d new file mode 100644 index 0000000..9cca58c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/90504c0bbbd000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/a0087dd116cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/a0087dd116cf00141c41f52413db5e31 new file mode 100644 index 0000000..cf9b333 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/a0087dd116cf00141c41f52413db5e31 @@ -0,0 +1,116 @@ +package darkknight.jewelrycraft.curses; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class Curse +{ + protected int id, texturepack; + protected String name, description; + protected Random rand = new Random(); + private static ArrayList curses = new ArrayList(); + public static ArrayList availableCurses = new ArrayList(); + + /** + * @param id the ID of the curse + * @param name the name of the curse + * @param texturepack the ID of the pack the texture is located in + */ + protected Curse(int id, String name, int texturepack) + { + this.id = id; + this.name = name; + this.texturepack = texturepack; + curses.add(this); + availableCurses.add(this); + } + + /** + * @return the name of the curse + */ + public String getName() + { + return name; + } + + /** + * @return the description of the curse + */ + public String getDescription() + { + return description; + } + + public Curse setDescription(String desc) + { + description = desc; + return this; + } + + /** + * @return the curse ID + */ + public int getID() + { + return id; + } + + /** + * @return the texture pack ID + */ + public int getTexturePack() + { + return texturepack; + } + + /** + * @param world + * @param player + */ + public void action(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void deathAction(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void respawnAction(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void attackedAction(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void attackedByPlayerAction(World world, EntityPlayer player, EntityLiving target) + {} + + public boolean itemToss() + { + return false; + } + + /** + * @return + */ + public static ArrayList getCurseList() + { + return curses; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/20ddfa7621cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/20ddfa7621cf00141c41f52413db5e31 new file mode 100644 index 0000000..73985da --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/20ddfa7621cf00141c41f52413db5e31 @@ -0,0 +1,36 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +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.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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)){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/a04f0c50a4ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/a04f0c50a4ce00141801ff0972626827 new file mode 100644 index 0000000..32db913 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/a04f0c50a4ce00141801ff0972626827 @@ -0,0 +1,435 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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); + } + if (entity.motionX == 0D && entity.motionY == 0D && entity.motionZ == 0D && entity.rotationPitch == entity.prevRotationPitch && entity.rotationYaw == entity.prevRotationYaw) 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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/57/c08394fe40cf001411138789b9e67617 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/c08394fe40cf001411138789b9e67617 new file mode 100644 index 0000000..52599de --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/c08394fe40cf001411138789b9e67617 @@ -0,0 +1,459 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/57/e0aa469384d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/e0aa469384d000141a1fb02abca5ff55 new file mode 100644 index 0000000..2b5c36a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/e0aa469384d000141a1fb02abca5ff55 @@ -0,0 +1,79 @@ +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) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && rand.nextInt(50) == 0){ + 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 ore around you.")); + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/1044992a23cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/1044992a23cf00141c41f52413db5e31 new file mode 100644 index 0000000..52599de --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/1044992a23cf00141c41f52413db5e31 @@ -0,0 +1,459 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/59/1048515cbbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/1048515cbbd000141b65e2fc7f94332d new file mode 100644 index 0000000..84f0d07 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/1048515cbbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/b085ddbd9ad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/b085ddbd9ad000141b65e2fc7f94332d new file mode 100644 index 0000000..8e26620 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/b085ddbd9ad000141b65e2fc7f94332d @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabModifiers extends GuiTab +{ + int maxPages; + public GuiTabModifiers(int id) + { + super("Modifiers", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.blaze_powder); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all of modifiers that have a use and what they do, in the form of a story/riddle/poem. However different jewellery have different effects for the same modifier."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 2: + text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.blaze_powder), text, 40f); + break; + case 3: + text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Against an arrow you can't compare, so move around, don't just stare. Fire is your enemy and weakness is the penalty."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.feather), text, 40f); + break; + case 4: + text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 7, new ItemStack(Items.ender_eye), text, 40f); + break; + } + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return 4; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c07baaa5bcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c07baaa5bcd000141b65e2fc7f94332d new file mode 100644 index 0000000..20c32d2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c07baaa5bcd000141b65e2fc7f94332d @@ -0,0 +1,245 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + GL11.glEnable(GL11.GL_LIGHT1); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT1); + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/e0e84e2dbdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/e0e84e2dbdd000141b65e2fc7f94332d new file mode 100644 index 0000000..4b22e01 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/e0e84e2dbdd000141b65e2fc7f94332d @@ -0,0 +1,115 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/80f31216bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/80f31216bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..785a1f7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/80f31216bbd000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 170, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b0474f9184d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b0474f9184d000141a1fb02abca5ff55 new file mode 100644 index 0000000..26bb87b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b0474f9184d000141a1fb02abca5ff55 @@ -0,0 +1,79 @@ +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) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && rand.nextInt(5) == 0){ + 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 ore around you.")); + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b0a71b6116cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b0a71b6116cf00141c41f52413db5e31 new file mode 100644 index 0000000..18a1053 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b0a71b6116cf00141c41f52413db5e31 @@ -0,0 +1,30 @@ +package darkknight.jewelrycraft.curses; + +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20f && rand.nextInt(5) == 0) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 2.0F); + JewelrycraftUtil.addCursePoints(player, 10); + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10e245fff3cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10e245fff3cf0014170de422db399e8d new file mode 100644 index 0000000..339dd64 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10e245fff3cf0014170de422db399e8d @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/d08f32069cd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/d08f32069cd000141b65e2fc7f94332d new file mode 100644 index 0000000..3158ee3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/d08f32069cd000141b65e2fc7f94332d @@ -0,0 +1,44 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.item.ItemList; + +public class GuiTabIntroduction extends GuiTab +{ + public GuiTabIntroduction(int id) + { + super("Introduction", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(ItemList.ring); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Welcome to Jewelrycraft 2! This mod is about making jewelry that you can modify to your own will. To find out how to create a jewelry, please consult the book and look at the Smelter block. To add modifiers to it you need to perform a ritual. To see how to do that, look at the Cursed Eye block in the book."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/f0e98566a7ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/f0e98566a7ce00141801ff0972626827 new file mode 100644 index 0000000..c16d16e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/f0e98566a7ce00141801ff0972626827 @@ -0,0 +1,116 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + NBTTagCompound enemyData = target.getEntityData(); + if (jewelry instanceof ItemRing && pos != -1){ + if (target instanceof EntityPlayer){ + NBTTagCompound enemyInfo = PlayerUtils.getModPlayerPersistTag((EntityPlayer)target, "Jewelrycraft"); + if (enemyInfo.getInteger("reAttacked") == 0){ + enemyInfo.setInteger("reAttacked", enemyInfo.getInteger("reAttacked") + 1); + target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); + if (rand.nextInt(2) == 0){ + enemyInfo.setInteger("stunTime", 50); + enemyInfo.setBoolean("stunned", true); + } + } + }else if (enemyData.getInteger("reAttacked") == 0){ + enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); + if (rand.nextInt(2) == 0){ + enemyData.setInteger("stunTime", 50); + enemyData.setBoolean("stunned", true); + } + } + playerInfo.setBoolean("weakDamage", true); + } + if (target instanceof EntityPlayer){ + NBTTagCompound enemyInfo = PlayerUtils.getModPlayerPersistTag((EntityPlayer)target, "Jewelrycraft"); + if (enemyInfo.getInteger("reAttacked") == 1) enemyInfo.setInteger("reAttacked", 0); + }else 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, "Jewelrycraft"); + 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/5d/00fa2de0a6ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/00fa2de0a6ce00141801ff0972626827 new file mode 100644 index 0000000..712d032 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/00fa2de0a6ce00141801ff0972626827 @@ -0,0 +1,106 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + 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 (target instanceof EntityPlayer && rand.nextInt(2) == 0){ + NBTTagCompound enemyInfo = PlayerUtils.getModPlayerPersistTag((EntityPlayer)target, "Jewelrycraft"); + enemyInfo.setInteger("stunTime", 50); + enemyInfo.setBoolean("stunned", true); + }else 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, "Jewelrycraft"); + 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/5e/50723f9b2f9300141384bdd0ca2744d8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/50723f9b2f9300141384bdd0ca2744d8 new file mode 100644 index 0000000..9d32772 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/50723f9b2f9300141384bdd0ca2744d8 @@ -0,0 +1,660 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import darkknight.jewelrycraft.item.ItemRing; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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); + if (itemStackData.hasKey("gemNumber")) itemStackData.setInteger("gemNumber", itemStackData.getInteger("gemNumber") + 1); + else itemStackData.setInteger("gemNumber", 1); + int no = itemStackData.getInteger("gemNumber"); + itemStackData.setTag("gem" + no, 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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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 + public static void addGemColor(ItemStack item, int color, int indice) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound colors = new NBTTagCompound(); + colors.setInteger("gemColor" + indice, color); +// System.out.println("gemColor" + indice + " Color: " + color); + itemStackData.setTag("gemColors", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + 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; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack gem(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems.get(new Random().nextInt(gems.size())); + } + return null; + } + + public static ArrayList gems(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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 + public static int gemColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()) + { + NBTTagCompound color = (NBTTagCompound) stack.getTagCompound().getTag("gemColors"); + if (stack.getTagCompound().hasKey("gemNumber")) + { + ArrayList colors = new ArrayList(); + int no = stack.getTagCompound().getInteger("gemNumber"); + for (int i = 0; i < no; i++) + { + int col = color.getInteger("gemColor" + i); + colors.add(col); + } + System.out.println(color); + int prevColor = colors.get(0); + if(new Random().nextInt(1) == 0) prevColor = colors.get(new Random().nextInt(colors.size())); + return prevColor; + } + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/f0abea277dcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/f0abea277dcf00141de78e4a85bb2469 new file mode 100644 index 0000000..ff732a4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/f0abea277dcf00141de78e4a85bb2469 @@ -0,0 +1,187 @@ +/* + * 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.commands.JewelrycraftCommands; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.container.GuiHandler; +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.lib.Reference; +import darkknight.jewelrycraft.network.PacketClearColorCache; +import darkknight.jewelrycraft.network.PacketKeyPressEvent; +import darkknight.jewelrycraft.network.PacketRequestLiquidData; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; +import darkknight.jewelrycraft.network.PacketSendCurseStats; +import darkknight.jewelrycraft.network.PacketSendLiquidData; +import darkknight.jewelrycraft.network.PacketSendPlayerInfo; +import darkknight.jewelrycraft.recipes.CraftingRecipes; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +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 = Reference.MODID, name = Reference.MODNAME, version = Reference.VERSION) +public class JewelrycraftMod +{ + @Instance (Reference.MODID) + public static JewelrycraftMod instance; + @SidedProxy (clientSide = "darkknight.jewelrycraft.client.ClientProxy", serverSide = "darkknight.jewelrycraft.CommonProxy") + public static CommonProxy proxy; + public static final Logger logger = Logger.getLogger("Jewelrycraft"); + public static File dir; + public static CreativeTabs jewelrycraft = new CreativeTabs("JewelryCraft"){ + @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; + public static final int MAX_CURSES = 10; + + /** + * 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, "Jewelrycraft: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("DarkKnight (or sor1n)"); + authorList.add("bspkrs"); + authorList.add("domi1819"); + + dir = e.getModConfigurationDirectory(); + proxy.registerRenderers(); + netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.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); + metadata.autogenerated = false; + metadata.authorList = authorList; + metadata.url = "https://github.com/sor1n/Jewelrycraft"; + + createEntity(EntityHeart.class, "Heart", 0x000000, 0xFF0000, true); + createEntity(EntityHalfHeart.class, "Half-Heart", 0x000000, 0xFF0000, true); + +// 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.addStuff(); + JewelrycraftUtil.jamcrafters(); + EffectsList.postInit(e); + DamageSourceList.postInit(e); + } + + @Mod.EventHandler + public void serverLoad(FMLServerStartingEvent event) + { + event.registerServerCommand(new JewelrycraftCommands()); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30d8062da0ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30d8062da0ce00141801ff0972626827 new file mode 100644 index 0000000..3457235 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30d8062da0ce00141801ff0972626827 @@ -0,0 +1,71 @@ +/** + * + */ +package darkknight.jewelrycraft.network; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import io.netty.buffer.ByteBuf; +import cpw.mods.fml.common.network.ByteBufUtils; +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.events.PlayerRenderHandler; +import darkknight.jewelrycraft.lib.Reference; +import darkknight.jewelrycraft.util.PlayerUtils; + +/** + * @author Sorin + * + */ +public class PacketSendCurseStats implements IMessage, IMessageHandler +{ + public PacketSendCurseStats() + { + + } + + /** + * @param message + * @param ctx + * @return + */ + @Override + public IMessage onMessage(PacketSendCurseStats message, MessageContext ctx) + { + return null; + } + + /** + * @param buf + */ + @Override + public void fromBytes(ByteBuf buf) + { + String temp = ByteBufUtils.readUTF8String(buf); + if (temp != "") + PlayerRenderHandler.infamyCache = temp.split(";"); + else + PlayerRenderHandler.infamyCache = new String[] { }; + } + + /** + * @param buf + */ + @Override + public void toBytes(ByteBuf buf) + { + Iterator players = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator(); + String infamyPlayers = ""; + while (players.hasNext()) + { + EntityPlayer current = players.next(); + if(PlayerUtils.getModPlayerPersistTag(current, "Jewelrycraft").getInteger(Reference.MODNAME + ":" + "Infamy") > 0) + infamyPlayers = infamyPlayers + (infamyPlayers == "" ? "" : ";") + current.getDisplayName(); + } + ByteBufUtils.writeUTF8String(buf, infamyPlayers); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30e8b2dea5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30e8b2dea5ce00141801ff0972626827 new file mode 100644 index 0000000..d9be141 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30e8b2dea5ce00141801ff0972626827 @@ -0,0 +1,102 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/5f/50b15c9812cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/50b15c9812cf00141c41f52413db5e31 new file mode 100644 index 0000000..d9be141 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/50b15c9812cf00141c41f52413db5e31 @@ -0,0 +1,102 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/5f/60bc25dabdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/60bc25dabdd000141b65e2fc7f94332d new file mode 100644 index 0000000..9e5a035 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/60bc25dabdd000141b65e2fc7f94332d @@ -0,0 +1,236 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/d0a52e0212cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/d0a52e0212cf00141c41f52413db5e31 new file mode 100644 index 0000000..5ee1677 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/d0a52e0212cf00141c41f52413db5e31 @@ -0,0 +1,446 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/60/601a6034bcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/601a6034bcd000141b65e2fc7f94332d new file mode 100644 index 0000000..a57ee2f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/601a6034bcd000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate, 0, 0, 0); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate, 0, 0, 0); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate, 0, 0, 0); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate, 0, 0, 0); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate, 0, 0, 0); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item, float xRot, float yRot, float zRot) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 22 && mouseY >= y + 20 && mouseY <= y + 32) gui.drawHoverString(name, x, y + 10); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false, xRot, yRot, zRot); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate, 0, 0, 0); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/c0d85da8b8d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/c0d85da8b8d000141b65e2fc7f94332d new file mode 100644 index 0000000..2db2bff --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/c0d85da8b8d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/d052a15084c600141066cb38d875561a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/d052a15084c600141066cb38d875561a new file mode 100644 index 0000000..135537a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/d052a15084c600141066cb38d875561a @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.PlayerUtils; + +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); + // 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(); + } + } + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + {} + + @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, "Jewelrycraft"); + if (jewelry instanceof ItemNecklace && pos != -1 && rand.nextInt(2) == 0){ + player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You evaded an attack!")); + 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 * 6F); + // Negative earrings + if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); + } + + @Override + public boolean onPlayerFall(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/50774f8f84c600141066cb38d875561a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/50774f8f84c600141066cb38d875561a new file mode 100644 index 0000000..1d21cfb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/50774f8f84c600141066cb38d875561a @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.PlayerUtils; + +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); + // 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(); + } + } + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + {} + + @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, "Jewelrycraft"); + if (jewelry instanceof ItemNecklace && pos != -1 && rand.nextInt(4) == 0 && 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 * 2F); + // Negative earrings + if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); + } + + @Override + public boolean onPlayerFall(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/2069867dbbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/2069867dbbd000141b65e2fc7f94332d new file mode 100644 index 0000000..77446e3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/2069867dbbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 180, -90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 90, 90, 90); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/30a210a5bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/30a210a5bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..9c9770a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/30a210a5bbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 45, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/f0beebb39ad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/f0beebb39ad000141b65e2fc7f94332d new file mode 100644 index 0000000..2ba8fc2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/f0beebb39ad000141b65e2fc7f94332d @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabModifiers extends GuiTab +{ + int maxPages; + public GuiTabModifiers(int id) + { + super("Modifiers", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.blaze_powder); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all of modifiers that have a use and what they do, in the form of a story/riddle/poem. However different jewellery have different effects for the same modifier."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 2: + text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.blaze_powder), text, 40f); + break; + case 3: + text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Against an arrow you can't compare, so move around, don't just stare. Fire is your enemy and weakness is the penalty."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.feather), text, 40f); + break; + case 4: + text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Items.ender_eye), text, 40f); + break; + } + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return 4; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/60d2e4cf84c600141066cb38d875561a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/60d2e4cf84c600141066cb38d875561a new file mode 100644 index 0000000..de4f1e2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/60d2e4cf84c600141066cb38d875561a @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.PlayerUtils; + +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); + // 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(); + } + } + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + {} + + @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, "Jewelrycraft"); + if (jewelry instanceof ItemNecklace && pos != -1 && rand.nextInt(4) == 0 && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){ + player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage! " + source.damageType)); + 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 * 4F); + // Negative earrings + if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); + } + + @Override + public boolean onPlayerFall(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/60dd45d1a5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/60dd45d1a5ce00141801ff0972626827 new file mode 100644 index 0000000..1493067 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/60dd45d1a5ce00141801ff0972626827 @@ -0,0 +1,448 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + playerInfo.setBoolean("stunned", true); + playerInfo.setInteger("stunTime", 50); + 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 + 1F, 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/63/e00f48f3bdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/e00f48f3bdd000141b65e2fc7f94332d new file mode 100644 index 0000000..bedf20a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/e00f48f3bdd000141b65e2fc7f94332d @@ -0,0 +1,237 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.01F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/e0b3878d7dcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/e0b3878d7dcf00141de78e4a85bb2469 new file mode 100644 index 0000000..69cf5fb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/e0b3878d7dcf00141de78e4a85bb2469 @@ -0,0 +1,223 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.registry.GameData; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.events.EntityEventHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; + +public class JewelrycraftUtil +{ + public static ArrayList objects = new ArrayList(); + public static ArrayList gem = new ArrayList(); + public static ArrayList jewelry = new ArrayList(); + public static ArrayList metal = new ArrayList(); + public static ArrayList ores = new ArrayList(); + public static HashMap oreToIngot = new HashMap(); + public static ArrayList jamcraftPlayers = new ArrayList(); + public static Random rand = new Random(); + + /** + * Adds gems and jewelry to their appropriate list + */ + public static void addStuff() + { + // Jewels + for(int i = 0; i < 16; i++) + gem.add(new ItemStack(ItemList.crystal, 1, i)); + gem.add(new ItemStack(Blocks.redstone_block)); + gem.add(new ItemStack(Blocks.lapis_block)); + gem.add(new ItemStack(Blocks.obsidian)); + gem.add(new ItemStack(Items.diamond)); + gem.add(new ItemStack(Items.emerald)); + gem.add(new ItemStack(Items.ender_pearl)); + gem.add(new ItemStack(Items.nether_star)); + // Jewelry + jewelry.add(new ItemStack(ItemList.ring)); + jewelry.add(new ItemStack(ItemList.necklace)); + jewelry.add(new ItemStack(ItemList.bracelet)); + jewelry.add(new ItemStack(ItemList.earrings)); + for(Object item: GameData.getItemRegistry()){ + ArrayList items = new ArrayList(); + if (((Item)item).getHasSubtypes()) ((Item)item).getSubItems((Item)item, + null, + items); + else objects.add(new ItemStack((Item)item)); + + if (!items.isEmpty()) objects.addAll(items); + } + } + + /** + * Adds curse points to a player + * + * @param player the player to add the points to + * @param points amount of curse points + */ + public static void addCursePoints(EntityPlayer player, int points) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + playerInfo.setInteger("cursePoints", playerInfo.hasKey("cursePoints") ? (playerInfo.getInteger("cursePoints") + points) : points); + playerInfo.setBoolean("playerCursePointsChanged", true); + } + + public static int getCursePoints(EntityPlayer player) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + return playerInfo.getInteger("cursePoints"); + } + + /** + * Adds the UUID's of the jamcrafters in a list + */ + public static void jamcrafters() + { + jamcraftPlayers.add("d3214311-7550-4c9c-a372-d9292c10b8a6"); + jamcraftPlayers.add("a690119f-c4a2-4bd6-a99d-d63679abb328"); + jamcraftPlayers.add("de7c9903-51fa-4a24-88cd-48faf122ca36"); + jamcraftPlayers.add("70aeb298-3a7b-46da-a393-ab10df9359f2"); + jamcraftPlayers.add("6fbe603c-14bf-4085-afdd-abe592c26e7c"); + jamcraftPlayers.add("b0d21306-36bf-4d85-84df-a956d183c45a"); + jamcraftPlayers.add("1733a31f-01f9-4f4d-82aa-7de30ca810d3"); + jamcraftPlayers.add("4833eacf-1d94-49a7-9f89-4cf88d69dcf9"); + jamcraftPlayers.add("718cf671-9084-4e78-b91f-033e80aa11bf"); + jamcraftPlayers.add("bea5e0c4-85c4-454d-a081-e1eaae6895ee"); + jamcraftPlayers.add("7ecf3e2f-fedf-4f7e-8d24-6731d078db4f"); + jamcraftPlayers.add("1b11ad3a-f0ca-4695-a019-2d7e5d83a5fd"); + jamcraftPlayers.add("3ec9ac58-2f1b-4d3f-b4eb-3b875da877ae"); + jamcraftPlayers.add("cf9fa23f-205e-4eed-aba3-9f2848cd6a4d"); + jamcraftPlayers.add("91880caa-b032-48e3-bfe8-c2c7ed31824e"); + jamcraftPlayers.add("8d0b3804-f71c-4219-897b-8c315448ea7c"); + jamcraftPlayers.add("bbb87dbe-690f-4205-bdc5-72ffb8ebc29d"); + } + + /** + * Adds a random amount of modifiers to a list + * + * @param randValue maximum number of modifiers + * @return a list containing the random modifiers + */ + public static ArrayList addRandomModifiers(int randValue) + { + ArrayList list = new ArrayList(); + for(int i = 0; i < 2 + randValue; i++){ + ItemStack item = objects.get(new Random().nextInt(objects.size())); + item.stackSize = 1 + new Random().nextInt(2); + list.add(item); + } + return list; + } + + /** + * Links ores with their appropriate ingot + */ + public static void addMetals() + { + int index = 0; + while (index < OreDictionary.getOreNames().length){ + Iterator i = OreDictionary.getOres(OreDictionary.getOreNames()[index]).iterator(); + while (i.hasNext()){ + ItemStack nextStack = i.next(); + if ((nextStack.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || nextStack.getItem().getUnlocalizedName().toLowerCase().contains("alloy")) && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("powder") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("dust") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("block") && !metal.contains(nextStack)){ + metal.add(nextStack); + if (OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")) != null){ + ores.addAll(OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore"))); + Iterator ores = OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")).iterator(); + while (ores.hasNext()){ + ItemStack ore = ores.next(); + oreToIngot.put(ore.getItem(), nextStack); + } + } + } + } + index++; + } + } + + /** + * Checks to see if the specified item is a gem + * + * @param item ItemStack containing the item + * @return is the item a gem + */ + public static boolean isGem(ItemStack item) + { + Iterator i = gem.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is a metal + * + * @param item ItemStack containing the item + * @return is the item a metal + */ + public static boolean isMetal(ItemStack item) + { + Iterator i = metal.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is a piece of jewelry + * + * @param item ItemStack containing the item + * @return is the item a piece of jewelry + */ + public static boolean isJewelry(ItemStack item) + { + Iterator i = jewelry.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is an ore + * + * @param item ItemStack containing the item + * @return is the item an ore + */ + public static boolean isOre(ItemStack item) + { + Iterator i = ores.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Gets the ingot from the ore + * + * @param ore the ore + * @return the ingot + */ + public static ItemStack getIngotFromOre(Item ore) + { + return oreToIngot.get(ore); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/30a5d74a2f9300141384bdd0ca2744d8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/30a5d74a2f9300141384bdd0ca2744d8 new file mode 100644 index 0000000..65133c2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/30a5d74a2f9300141384bdd0ca2744d8 @@ -0,0 +1,659 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import darkknight.jewelrycraft.item.ItemRing; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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); + if (itemStackData.hasKey("gemNumber")) itemStackData.setInteger("gemNumber", itemStackData.getInteger("gemNumber") + 1); + else itemStackData.setInteger("gemNumber", 1); + int no = itemStackData.getInteger("gemNumber"); + itemStackData.setTag("gem" + no, 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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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 + public static void addGemColor(ItemStack item, int color, int indice) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound colors = new NBTTagCompound(); + colors.setInteger("gemColor" + indice, color); + itemStackData.setTag("gemColors", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + 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; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack gem(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems.get(new Random().nextInt(gems.size())); + } + return null; + } + + public static ArrayList gems(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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 + public static int gemColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()) + { + NBTTagCompound color = (NBTTagCompound) stack.getTagCompound().getTag("gemColors"); + if (stack.getTagCompound().hasKey("gemNumber")) + { + ArrayList colors = new ArrayList(); + int no = stack.getTagCompound().getInteger("gemNumber"); + for (int i = 1; i <= no; i++) + { + int col = color.getInteger("gemColor" + i); + colors.add(col); + } + int prevColor = colors.get(0); + System.out.println(color); + if(new Random().nextInt(1) == 0) prevColor = colors.get(new Random().nextInt(colors.size())); + return prevColor; + } + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/50a406e982d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/50a406e982d000141a1fb02abca5ff55 new file mode 100644 index 0000000..a6fee08 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/50a406e982d000141a1fb02abca5ff55 @@ -0,0 +1,67 @@ +package darkknight.jewelrycraft.effects; + +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.DamageSource; +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 +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1) Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.0F); + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/905e928db7d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/905e928db7d000141b65e2fc7f94332d new file mode 100644 index 0000000..a937672 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/905e928db7d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 20, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/603844c615cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/603844c615cf00141c41f52413db5e31 new file mode 100644 index 0000000..5e901ea --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/603844c615cf00141c41f52413db5e31 @@ -0,0 +1,460 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0 && playerInfo.getBoolean("sendInfo")){ + JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + System.out.println("SendInfo"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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(player.worldObj, player); + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/65/60ae11e56e5f00141b03e33c57c1f917 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/60ae11e56e5f00141b03e33c57c1f917 new file mode 100644 index 0000000..31c0078 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/60ae11e56e5f00141b03e33c57c1f917 @@ -0,0 +1,80 @@ +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); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityShadowEye(); + } + + @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 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); + return true; + } + + @Override + public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) + { + } + + @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 void registerBlockIcons(IIconRegister icon) + { + this.blockIcon = icon.registerIcon("jewelrycraft:shadowEye"); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/80ef4046bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/80ef4046bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..8f31fdf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/80ef4046bbd000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/9039e7ea21cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/9039e7ea21cf00141c41f52413db5e31 new file mode 100644 index 0000000..52599de --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/9039e7ea21cf00141c41f52413db5e31 @@ -0,0 +1,459 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/66/b0813d41f3cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/b0813d41f3cf0014170de422db399e8d new file mode 100644 index 0000000..6f82faf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/b0813d41f3cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); + if (chunkposition != null && chunkposition.chunkPosX != (int)player.posX && chunkposition.chunkPosZ != (int)player.posZ){ + Minecraft.getMinecraft().thePlayer.motionX += 0.01D*Math.signum(player.posX - (double)chunkposition.chunkPosX); + Minecraft.getMinecraft().thePlayer.motionZ += 0.01D*Math.signum(player.posZ - (double)chunkposition.chunkPosZ); + System.out.println(chunkposition.chunkPosX + " " + 0.01D*Math.signum(player.posX - (double)chunkposition.chunkPosX)); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/f0427c9d2f9300141384bdd0ca2744d8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/f0427c9d2f9300141384bdd0ca2744d8 new file mode 100644 index 0000000..ad257ff --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/f0427c9d2f9300141384bdd0ca2744d8 @@ -0,0 +1,660 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import darkknight.jewelrycraft.item.ItemRing; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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); + if (itemStackData.hasKey("gemNumber")) itemStackData.setInteger("gemNumber", itemStackData.getInteger("gemNumber") + 1); + else itemStackData.setInteger("gemNumber", 1); + int no = itemStackData.getInteger("gemNumber"); + itemStackData.setTag("gem" + no, 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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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 + public static void addGemColor(ItemStack item, int color, int indice) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound colors = new NBTTagCompound(); + colors.setInteger("gemColor" + indice, color); +// System.out.println("gemColor" + indice + " Color: " + color); + itemStackData.setTag("gemColors", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + 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; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack gem(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems.get(new Random().nextInt(gems.size())); + } + return null; + } + + public static ArrayList gems(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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 + public static int gemColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()) + { + NBTTagCompound color = (NBTTagCompound) stack.getTagCompound().getTag("gemColors"); + if (stack.getTagCompound().hasKey("gemNumber")) + { + ArrayList colors = new ArrayList(); + int no = stack.getTagCompound().getInteger("gemNumber"); + for (int i = 0; i < no; i++) + { + int col = color.getInteger("gemColor" + i); + colors.add(col); + } + System.out.println(stack.getTagCompound()); + int prevColor = colors.get(0); + if(new Random().nextInt(1) == 0) prevColor = colors.get(new Random().nextInt(colors.size())); + return prevColor; + } + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/00b782eca6ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/00b782eca6ce00141801ff0972626827 new file mode 100644 index 0000000..89d33ca --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/00b782eca6ce00141801ff0972626827 @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + NBTTagCompound enemyData = target.getEntityData(); + if (jewelry instanceof ItemRing && pos != -1){ + if (target instanceof EntityPlayer){ + NBTTagCompound enemyInfo = PlayerUtils.getModPlayerPersistTag((EntityPlayer)target, "Jewelrycraft"); + enemyInfo.setInteger("reAttacked", enemyInfo.getInteger("reAttacked") + 1); + target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); + if (rand.nextInt(2) == 0){ + enemyInfo.setInteger("stunTime", 50); + enemyInfo.setBoolean("stunned", true); + } + }else if (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, "Jewelrycraft"); + 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/f05ddeeb99d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/f05ddeeb99d000141b65e2fc7f94332d new file mode 100644 index 0000000..3ef101b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/f05ddeeb99d000141b65e2fc7f94332d @@ -0,0 +1,79 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabModifiers extends GuiTab +{ + int maxPages; + public GuiTabModifiers(int id) + { + super("Modifiers", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.blaze_powder); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + maxPages = 0; + switch(page) + { + case 1: + text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all of modifiers that have a use and what they do, in the form of a story/riddle/poem. However different jewellery have different effects for the same modifier."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + maxPages++; + break; + case 2: + text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.blaze_powder), text, 40f); + maxPages++; + break; + case 3: + text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Be aware, against an arrow you can't compare. Fire is your enemy and weakness is the penalty."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.feather), text, 40f); + maxPages++; + break; + case 4: + text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.ender_eye), text, 40f); + maxPages++; + break; + } + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return maxPages; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/30a1d335b4d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/30a1d335b4d000141b65e2fc7f94332d new file mode 100644 index 0000000..2e801a7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/30a1d335b4d000141b65e2fc7f94332d @@ -0,0 +1,195 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 5, y + 25, 145, 150, 35, 30); + name.add(item.getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/4034bfb970cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/4034bfb970cf00141de78e4a85bb2469 new file mode 100644 index 0000000..8e653ba --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/4034bfb970cf00141de78e4a85bb2469 @@ -0,0 +1,462 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/6a/50b952462f9300141384bdd0ca2744d8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/50b952462f9300141384bdd0ca2744d8 new file mode 100644 index 0000000..75a14d4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/50b952462f9300141384bdd0ca2744d8 @@ -0,0 +1,659 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import darkknight.jewelrycraft.item.ItemRing; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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); + if (itemStackData.hasKey("gemNumber")) itemStackData.setInteger("gemNumber", itemStackData.getInteger("gemNumber") + 1); + else itemStackData.setInteger("gemNumber", 1); + int no = itemStackData.getInteger("gemNumber"); + itemStackData.setTag("gem" + no, 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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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 + public static void addGemColor(ItemStack item, int color, int indice) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound colors = new NBTTagCompound(); + colors.setInteger("gemColor" + indice, color); + itemStackData.setTag("gemColors", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + 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; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack gem(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems.get(new Random().nextInt(gems.size())); + } + return null; + } + + public static ArrayList gems(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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 + public static int gemColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()) + { + NBTTagCompound color = (NBTTagCompound) stack.getTagCompound().getTag("gemColors"); + if (stack.getTagCompound().hasKey("gemNumber")) + { + ArrayList colors = new ArrayList(); + int no = stack.getTagCompound().getInteger("gemNumber"); + for (int i = 1; i <= no; i++) + { + int col = color.getInteger("gemColor" + i); + colors.add(col); + } + int prevColor = colors.get(0); +// System.out.println(color); + if(new Random().nextInt(1) == 0) prevColor = colors.get(new Random().nextInt(colors.size())); + return prevColor; + } + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/c0058039a3ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/c0058039a3ce00141801ff0972626827 new file mode 100644 index 0000000..f7a6472 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/c0058039a3ce00141801ff0972626827 @@ -0,0 +1,438 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); + entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); + if(entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); + } + if (entity instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)entity; + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0){ + JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + System.out.println("Packet sent"); + } + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/6d/102be67fbbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/102be67fbbd000141b65e2fc7f94332d new file mode 100644 index 0000000..cd8afc8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/102be67fbbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 180, -90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 180, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/20760f8dbbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/20760f8dbbd000141b65e2fc7f94332d new file mode 100644 index 0000000..a19656f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/20760f8dbbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 180, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/d012947f9fce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/d012947f9fce00141801ff0972626827 new file mode 100644 index 0000000..0ce19db --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/d012947f9fce00141801ff0972626827 @@ -0,0 +1,187 @@ +/* + * 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.commands.JewelrycraftCommands; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.container.GuiHandler; +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.lib.Reference; +import darkknight.jewelrycraft.network.PacketClearColorCache; +import darkknight.jewelrycraft.network.PacketKeyPressEvent; +import darkknight.jewelrycraft.network.PacketRequestLiquidData; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; +import darkknight.jewelrycraft.network.PacketSendCurseStats; +import darkknight.jewelrycraft.network.PacketSendLiquidData; +import darkknight.jewelrycraft.network.PacketSendPlayerInfo; +import darkknight.jewelrycraft.recipes.CraftingRecipes; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +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 = Reference.MODID, name = Reference.MODNAME, version = Reference.VERSION) +public class JewelrycraftMod +{ + @Instance (Reference.MODID) + public static JewelrycraftMod instance; + @SidedProxy (clientSide = "darkknight.jewelrycraft.client.ClientProxy", serverSide = "darkknight.jewelrycraft.CommonProxy") + public static CommonProxy proxy; + public static final Logger logger = Logger.getLogger("Jewelrycraft"); + public static File dir; +// public static CreativeTabs jewelrycraft = new CreativeTabs("JewelryCraft"){ +// @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; + public static final int MAX_CURSES = 10; + + /** + * 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, "Jewelrycraft: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("DarkKnight (or sor1n)"); + authorList.add("bspkrs"); + authorList.add("domi1819"); + + dir = e.getModConfigurationDirectory(); + proxy.registerRenderers(); + netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.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); + metadata.autogenerated = false; + metadata.authorList = authorList; + metadata.url = "https://github.com/sor1n/Jewelrycraft"; + + createEntity(EntityHeart.class, "Heart", 0x000000, 0xFF0000, true); + createEntity(EntityHalfHeart.class, "Half-Heart", 0x000000, 0xFF0000, true); + +// 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.addStuff(); + JewelrycraftUtil.jamcrafters(); + EffectsList.postInit(e); + DamageSourceList.postInit(e); + } + + @Mod.EventHandler + public void serverLoad(FMLServerStartingEvent event) + { + event.registerServerCommand(new JewelrycraftCommands()); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/b08cd803bcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/b08cd803bcd000141b65e2fc7f94332d new file mode 100644 index 0000000..9db58c8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/b08cd803bcd000141b65e2fc7f94332d @@ -0,0 +1,236 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.5F, 0F); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/f0b063e3a3ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/f0b063e3a3ce00141801ff0972626827 new file mode 100644 index 0000000..da7c0f8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/f0b063e3a3ce00141801ff0972626827 @@ -0,0 +1,435 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); + entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); + if(entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); + } + if (entity instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)entity; + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/7/105eef10f4cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/105eef10f4cf0014170de422db399e8d new file mode 100644 index 0000000..d3a9455 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/105eef10f4cf0014170de422db399e8d @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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.1D*Math.signum((double)chunkposition.chunkPosX - player.posX); + Minecraft.getMinecraft().thePlayer.motionZ += 0.1D*Math.signum((double)chunkposition.chunkPosZ - player.posZ); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/90e15befbdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/90e15befbdd000141b65e2fc7f94332d new file mode 100644 index 0000000..a659f49 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/90e15befbdd000141b65e2fc7f94332d @@ -0,0 +1,237 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.2F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/d09c58ed23cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/d09c58ed23cf00141c41f52413db5e31 new file mode 100644 index 0000000..1cfd815 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/d09c58ed23cf00141c41f52413db5e31 @@ -0,0 +1,99 @@ +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; + +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("jewelrycraft", "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; + Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); + 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(texture); + 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); + count++; + } + } + 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(4, 4 + (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.glColor4f(1f, 1f, 1f, 1.0f); + mc.renderEngine.bindTexture(hearts); + count = 0; + 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); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/408fefd316cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/408fefd316cf00141c41f52413db5e31 new file mode 100644 index 0000000..44cb917 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/408fefd316cf00141c41f52413db5e31 @@ -0,0 +1,116 @@ +package darkknight.jewelrycraft.curses; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class Curse +{ + protected int id, texturepack; + protected String name, description; + protected Random rand = new Random(); + private static ArrayList curses = new ArrayList(); + public static ArrayList availableCurses = new ArrayList(); + + /** + * @param id the ID of the curse + * @param name the name of the curse + * @param texturepack the ID of the pack the texture is located in + */ + protected Curse(int id, String name, int texturepack) + { + this.id = id; + this.name = name; + this.texturepack = texturepack; + curses.add(this); + availableCurses.add(this); + } + + /** + * @return the name of the curse + */ + public String getName() + { + return name; + } + + /** + * @return the description of the curse + */ + public String getDescription() + { + return description; + } + + public Curse setDescription(String desc) + { + description = desc; + return this; + } + + /** + * @return the curse ID + */ + public int getID() + { + return id; + } + + /** + * @return the texture pack ID + */ + public int getTexturePack() + { + return texturepack; + } + + /** + * @param world + * @param player + */ + public void action(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void deathAction(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void respawnAction(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void attackedAction(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + {} + + public boolean itemToss() + { + return false; + } + + /** + * @return + */ + public static ArrayList getCurseList() + { + return curses; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/5022fbd5b9d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/5022fbd5b9d000141b65e2fc7f94332d new file mode 100644 index 0000000..55b8a50 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/5022fbd5b9d000141b65e2fc7f94332d @@ -0,0 +1,232 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/e09f38179cd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/e09f38179cd000141b65e2fc7f94332d new file mode 100644 index 0000000..08182af --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/e09f38179cd000141b65e2fc7f94332d @@ -0,0 +1,48 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.item.ItemList; + +public class GuiTabIntroduction extends GuiTab +{ + public GuiTabIntroduction(int id) + { + super("Introduction", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(ItemList.ring); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Welcome to Jewelrycraft 2! This mod is about making jewelry that you can modify to your own will. To find out how to create a jewelry, please consult the book and look at the Smelter block. To add modifiers to it you need to perform a ritual. To see how to do that, look at the Cursed Eye"; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 2: + text = "block in the book."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/60317a00bad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/60317a00bad000141b65e2fc7f94332d new file mode 100644 index 0000000..39acace --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/60317a00bad000141b65e2fc7f94332d @@ -0,0 +1,232 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/00e8ece9b6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/00e8ece9b6d000141b65e2fc7f94332d new file mode 100644 index 0000000..2792304 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/00e8ece9b6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 147, 150, 30, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/a00659a981d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/a00659a981d000141a1fb02abca5ff55 new file mode 100644 index 0000000..7a4e63d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/a00659a981d000141a1fb02abca5ff55 @@ -0,0 +1,66 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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)); + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/b01f1983b4d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/b01f1983b4d000141b65e2fc7f94332d new file mode 100644 index 0000000..259e36c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/b01f1983b4d000141b65e2fc7f94332d @@ -0,0 +1,195 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 145, 150, 35, 30); + name.add(item.getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/c0b3c7e9e65300141786a2891bfc8d75 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/c0b3c7e9e65300141786a2891bfc8d75 new file mode 100644 index 0000000..5ca4f8a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/c0b3c7e9e65300141786a2891bfc8d75 @@ -0,0 +1,84 @@ +package darkknight.jewelrycraft.particles; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import org.lwjgl.opengl.GL11; + +public class EntityShadowsFX extends EntityFX +{ + float moteParticleScale; + + public EntityShadowsFX(World world, double x, double y, double z, float size, float red, float green, float blue, float maxAge) + { + super(world, x, y, z, 0D, 0D, 0D); + + particleRed = red; + particleGreen = green; + particleBlue = blue; + particleMaxAge = (int) (28D / (Math.random() * 0.3D + 0.7D) * maxAge); + particleGravity = 0F; + motionX = motionY = motionZ = 0; + particleScale *= size; + moteParticleScale = particleScale; + noClip = true; + setSize(0.01F, 0.01F); + } + + @Override + public void renderParticle(Tessellator tessellator, float partialTicks, float minX, float minY, float minZ, float maxX, float maxZ) + { + tessellator.draw(); + ResourceLocation particle = new ResourceLocation("jewelrycraft", "textures/particle/shadows.png"); + Minecraft.getMinecraft().renderEngine.bindTexture(particle); + GL11.glColor4f(1, 1, 1, 1); + tessellator.startDrawingQuads(); + tessellator.setBrightness(this.getBrightnessForRender(0)); + float scale = 0.1F * particleScale; + float x = (float) (prevPosX + (posX - prevPosX) * partialTicks - interpPosX); + float y = (float) (prevPosY + (posY - prevPosY) * partialTicks - interpPosY); + float z = (float) (prevPosZ + (posZ - prevPosZ) * partialTicks - interpPosZ); + tessellator.setColorRGBA_F(particleRed, particleGreen, particleBlue, 0.5F); + tessellator.addVertexWithUV(x - minX * scale - maxX * scale, y - minY * scale, z - minZ * scale - maxZ * scale, 0, 0); + tessellator.addVertexWithUV(x - minX * scale + maxX * scale, y + minY * scale, z - minZ * scale + maxZ * scale, 1, 0); + tessellator.addVertexWithUV(x + minX * scale + maxX * scale, y + minY * scale, z + minZ * scale + maxZ * scale, 1, 1); + tessellator.addVertexWithUV(x + minX * scale - maxX * scale, y - minY * scale, z + minZ * scale - maxZ * scale, 0, 1); + tessellator.draw(); + tessellator.startDrawingQuads(); + } + + public void onUpdate() + { + super.onUpdate(); + EntityPlayer player = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); + AxisAlignedBB axisalignedbb = this.boundingBox.expand(1.0D, 16.0D, 1.0D); + List list1 = this.worldObj.getEntitiesWithinAABB(Entity.class, axisalignedbb); + if (list1 != null && !list1.isEmpty()) + { + Iterator iterator = list1.iterator(); + + while (iterator.hasNext()) + { + Entity entity = (Entity) iterator.next(); + if (entity != null && this.posX <= entity.posX + 0.5F && this.posX >= entity.posX - 0.5F && this.posZ <= entity.posZ + 0.5F && this.posZ >= entity.posZ - 0.5F) entity.attackEntityFrom(DamageSource.anvil, 100F); + } + } + } + + public int getFXLayer() + { + return 2; + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/f07bc4852f9300141384bdd0ca2744d8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/f07bc4852f9300141384bdd0ca2744d8 new file mode 100644 index 0000000..43b5293 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/f07bc4852f9300141384bdd0ca2744d8 @@ -0,0 +1,659 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import darkknight.jewelrycraft.item.ItemRing; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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); + if (itemStackData.hasKey("gemNumber")) itemStackData.setInteger("gemNumber", itemStackData.getInteger("gemNumber") + 1); + else itemStackData.setInteger("gemNumber", 1); + int no = itemStackData.getInteger("gemNumber"); + itemStackData.setTag("gem" + no, 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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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 + public static void addGemColor(ItemStack item, int color, int indice) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound colors = new NBTTagCompound(); + colors.setInteger("gemColor" + indice, color); + System.out.println("gemColor" + indice + " Color: " + color); + itemStackData.setTag("gemColors", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + 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; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack gem(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems.get(new Random().nextInt(gems.size())); + } + return null; + } + + public static ArrayList gems(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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 + public static int gemColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()) + { + NBTTagCompound color = (NBTTagCompound) stack.getTagCompound().getTag("gemColors"); + if (stack.getTagCompound().hasKey("gemNumber")) + { + ArrayList colors = new ArrayList(); + int no = stack.getTagCompound().getInteger("gemNumber"); + for (int i = 0; i < no; i++) + { + int col = color.getInteger("gemColor" + i); + colors.add(col); + } + int prevColor = colors.get(0); + if(new Random().nextInt(1) == 0) prevColor = colors.get(new Random().nextInt(colors.size())); + return prevColor; + } + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/10c2166623cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/10c2166623cf00141c41f52413db5e31 new file mode 100644 index 0000000..3187d17 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/10c2166623cf00141c41f52413db5e31 @@ -0,0 +1,461 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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; +// System.out.println(event.isCancelable()); + if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ + EntityPlayer player = (EntityPlayer)entity; + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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"}; + System.out.println(event.isCancelable()); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/75/20c0a81e70cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/20c0a81e70cf00141de78e4a85bb2469 new file mode 100644 index 0000000..4063764 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/20c0a81e70cf00141de78e4a85bb2469 @@ -0,0 +1,43 @@ +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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.canAttackWithItem()){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + if(playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if(player.getMaxHealth() >= 3F){ + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + player.setHealth(player.getHealth() - 1.0F); + } + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/b0ea8d2c7ccf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/b0ea8d2c7ccf00141de78e4a85bb2469 new file mode 100644 index 0000000..0732b36 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/b0ea8d2c7ccf00141de78e4a85bb2469 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class GuiTabGemsAndIngots extends GuiTab +{ + + /** + * @param id + */ + public GuiTabGemsAndIngots(int id) + { + super("Gems and ingots", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.emerald); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + for(int i = (page - 1) * 9; i < page * 9; i++) + if (i < JewelrycraftUtil.objects.size()){ + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Gems", gui.getLeft() + xPos + 40, gui.getTop(), 0); + gui.renderItem(JewelrycraftUtil.objects.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f); + gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.objects.get(i).getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + page -= JewelrycraftUtil.gem.size() / 9 + 1; + for(int i = (page - 1) * 9; i < page * 9; i++) + if (i < JewelrycraftUtil.metal.size() && page > 0){ + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ingots", gui.getLeft() + xPos + 40, gui.getTop(), 0); + gui.renderItem(JewelrycraftUtil.metal.get(i).copy(), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f); + gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.metal.get(i).copy().getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return JewelrycraftUtil.objects.size() / 9 + JewelrycraftUtil.metal.size() / 9 + 2; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/9098c35323cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/9098c35323cf00141c41f52413db5e31 new file mode 100644 index 0000000..1b64933 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/9098c35323cf00141c41f52413db5e31 @@ -0,0 +1,461 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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; + System.out.println(event.isCancelable()); + if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ + EntityPlayer player = (EntityPlayer)entity; + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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"}; + System.out.println(event.isCancelable()); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/79/f099510ebed000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/f099510ebed000141b65e2fc7f94332d new file mode 100644 index 0000000..d2e1a90 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/f099510ebed000141b65e2fc7f94332d @@ -0,0 +1,125 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye,1 ,3), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + + case 5: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 5", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 5; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/f0dc16e6bad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/f0dc16e6bad000141b65e2fc7f94332d new file mode 100644 index 0000000..68b527b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/f0dc16e6bad000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/d08754d5a5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/d08754d5a5ce00141801ff0972626827 new file mode 100644 index 0000000..9d8068e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/d08754d5a5ce00141801ff0972626827 @@ -0,0 +1,448 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + playerInfo.setBoolean("stunned", true); + playerInfo.setInteger("stunTime", 50); + 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.75F, 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/7c/a02cf81bf48a00141c1cba3f7039360c b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/a02cf81bf48a00141c1cba3f7039360c new file mode 100644 index 0000000..4cc2f7c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/a02cf81bf48a00141c1cba3f7039360c @@ -0,0 +1,618 @@ +package darkknight.jewelrycraft.util; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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 jewel + * The jewel you want to add on the item + */ + public static void addJewel(ItemStack item, ItemStack jewel) + { + if (jewel != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound jewelNBT = new NBTTagCompound(); + jewel.writeToNBT(jewelNBT); + itemStackData.setTag("jewel", jewelNBT); + } + } + + /** + * + * @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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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); + } + + public static void addJewelColor(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("jewelColor", color); + itemStackData.setTag("jewelColor", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + public static boolean isJewelX(ItemStack stack, ItemStack jewel) + { + if (jewel(stack) != null && jewel(stack).getItem() == jewel.getItem() && jewel(stack).getItemDamage() == jewel.getItemDamage()) return true; + return false; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack jewel(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewel")) + { + NBTTagCompound jewelNBT = (NBTTagCompound) stack.getTagCompound().getTag("jewel"); + ItemStack jewel = new ItemStack(Item.getItemById(0), 0, 0); + jewel.readFromNBT(jewelNBT); + return jewel; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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"); + int[] col = {color, 142323, 213552}; + return col[new Random().nextInt(3)]; + } + return 16777215; + } + + public static int jewelColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewelColor")) + { + NBTTagCompound colors = (NBTTagCompound) stack.getTagCompound().getTag("jewelColor"); + int color = colors.getInteger("jewelColor"); + int[] col = {color, 999900, 119999}; + return col[new Random().nextInt(3)]; + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/408bce2c7ecf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/408bce2c7ecf00141de78e4a85bb2469 new file mode 100644 index 0000000..8a73fc3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/408bce2c7ecf00141de78e4a85bb2469 @@ -0,0 +1,13 @@ +package darkknight.jewelrycraft; + +/** + * The Class CommonProxy. + */ +public class CommonProxy +{ + /** + * Register renderers. + */ +// public void registerRenderers() + {} +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/80a2ccf2b6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/80a2ccf2b6d000141b65e2fc7f94332d new file mode 100644 index 0000000..53cd112 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/80a2ccf2b6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 150, 30, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/c00b3a4e14cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/c00b3a4e14cf00141c41f52413db5e31 new file mode 100644 index 0000000..0616e02 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/c00b3a4e14cf00141c41f52413db5e31 @@ -0,0 +1,113 @@ +package darkknight.jewelrycraft.curses; + +import java.util.ArrayList; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class Curse +{ + protected int id, texturepack; + protected String name, description; + private static ArrayList curses = new ArrayList(); + public static ArrayList availableCurses = new ArrayList(); + + /** + * @param id the ID of the curse + * @param name the name of the curse + * @param texturepack the ID of the pack the texture is located in + */ + protected Curse(int id, String name, int texturepack) + { + this.id = id; + this.name = name; + this.texturepack = texturepack; + curses.add(this); + availableCurses.add(this); + } + + /** + * @return the name of the curse + */ + public String getName() + { + return name; + } + + /** + * @return the description of the curse + */ + public String getDescription() + { + return description; + } + + public Curse setDescription(String desc) + { + description = desc; + return this; + } + + /** + * @return the curse ID + */ + public int getID() + { + return id; + } + + /** + * @return the texture pack ID + */ + public int getTexturePack() + { + return texturepack; + } + + /** + * @param world + * @param player + */ + public void action(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void deathAction(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void respawnAction(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void attackedAction(World world, EntityPlayer player) + {} + + /** + * @param world + * @param player + */ + public void attackedByPlayerAction(World world, EntityPlayer player) + {} + + public boolean itemToss() + { + return false; + } + + /** + * @return + */ + public static ArrayList getCurseList() + { + return curses; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/0063cb09a4ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/0063cb09a4ce00141801ff0972626827 new file mode 100644 index 0000000..32db913 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/0063cb09a4ce00141801ff0972626827 @@ -0,0 +1,435 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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); + } + if (entity.motionX == 0D && entity.motionY == 0D && entity.motionZ == 0D && entity.rotationPitch == entity.prevRotationPitch && entity.rotationYaw == entity.prevRotationYaw) 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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/7e/50b82d4b23cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/50b82d4b23cf00141c41f52413db5e31 new file mode 100644 index 0000000..7a984ad --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/50b82d4b23cf00141c41f52413db5e31 @@ -0,0 +1,461 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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; + System.out.println(event.hasResult() + " " + event.getResult()); + if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){ + EntityPlayer player = (EntityPlayer)entity; + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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"}; + System.out.println(event.hasResult() + " " + event.getResult()); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/7e/90811e76bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/90811e76bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..cd8afc8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/90811e76bbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 180, -90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 180, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/d016443bbad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/d016443bbad000141b65e2fc7f94332d new file mode 100644 index 0000000..e569381 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/d016443bbad000141b65e2fc7f94332d @@ -0,0 +1,232 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e0cadf43f3cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e0cadf43f3cf0014170de422db399e8d new file mode 100644 index 0000000..53fbce6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e0cadf43f3cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); + if (chunkposition != null && chunkposition.chunkPosX != (int)player.posX && chunkposition.chunkPosZ != (int)player.posZ){ + 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); + System.out.println(chunkposition.chunkPosX + " " + 0.01D*Math.signum((double)chunkposition.chunkPosX) - player.posX); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/00b736a77dcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/00b736a77dcf00141de78e4a85bb2469 new file mode 100644 index 0000000..6a6bced --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/00b736a77dcf00141de78e4a85bb2469 @@ -0,0 +1,82 @@ +package darkknight.jewelrycraft.client; + +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.CommonProxy; +import darkknight.jewelrycraft.block.BlockList; +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.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.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.ItemRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +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; + +public class ClientProxy extends CommonProxy +{ + @Override + public void registerRenderers() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation("jewelrycraft", "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation("jewelrycraft", "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(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("jewelrycraft", "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("jewelrycraft", "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + JewelrycraftUtil.addStuff(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/c0c31c6bf2cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/c0c31c6bf2cf0014170de422db399e8d new file mode 100644 index 0000000..4b7e544 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/c0c31c6bf2cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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); + Minecraft.getMinecraft().thePlayer.motionZ -= 0.01D*Math.signum((double)chunkposition.chunkPosZ); + System.out.println((double)chunkposition.chunkPosX + " " + (double)chunkposition.chunkPosZ); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/e05bccf47ecf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/e05bccf47ecf00141de78e4a85bb2469 new file mode 100644 index 0000000..948469f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/e05bccf47ecf00141de78e4a85bb2469 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class GuiTabGemsAndIngots extends GuiTab +{ + + /** + * @param id + */ + public GuiTabGemsAndIngots(int id) + { + super("Gems and ingots", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.emerald); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + for(int i = (page - 1) * 9; i < page * 9; i++) + if (i < JewelrycraftUtil.objects.size()){ + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Gems", gui.getLeft() + xPos + 40, gui.getTop(), 0); + gui.renderItem(JewelrycraftUtil.objects.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f); + gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.objects.get(i).getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + page -= JewelrycraftUtil.objects.size() / 9 + 1; + for(int i = (page - 1) * 9; i < page * 9; i++) + if (i < JewelrycraftUtil.metal.size() && page > 0){ + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ingots", gui.getLeft() + xPos + 40, gui.getTop(), 0); + gui.renderItem(JewelrycraftUtil.metal.get(i).copy(), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f); + gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.metal.get(i).copy().getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return JewelrycraftUtil.objects.size() / 9 + JewelrycraftUtil.metal.size() / 9 + 2; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/60685a7322cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/60685a7322cf00141c41f52413db5e31 new file mode 100644 index 0000000..6a12145 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/60685a7322cf00141c41f52413db5e31 @@ -0,0 +1,463 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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()); + event.setCanceled(true); + player.heal(event.ammount); + }else{ + playerInfo.setFloat("BlueHeart", 0f); + JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); + event.setCanceled(true); + 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()); + event.setCanceled(true); + player.heal(event.ammount); + }else{ + playerInfo.setFloat("BlackHeart", 0f); + JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); + event.setCanceled(true); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/8/b04fbcf8bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/b04fbcf8bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..873cc63 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/b04fbcf8bbd000141b65e2fc7f94332d @@ -0,0 +1,236 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.5F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/406867c2a5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/406867c2a5ce00141801ff0972626827 new file mode 100644 index 0000000..855d5af --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/406867c2a5ce00141801ff0972626827 @@ -0,0 +1,448 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + playerInfo.setBoolean("stunned", true); + playerInfo.setInteger("stunTime", 50); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((ItemBaseJewelry)item.getItem()).action(item, player); + } + if (!player.worldObj.isRemote){ + 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 + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); + } + 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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/80/e0c8a1d614cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e0c8a1d614cf00141c41f52413db5e31 new file mode 100644 index 0000000..632112b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e0c8a1d614cf00141c41f52413db5e31 @@ -0,0 +1,460 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0 && 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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(player.worldObj, player); + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + // if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/82/a027f35412cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/a027f35412cf00141c41f52413db5e31 new file mode 100644 index 0000000..bbb5728 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/a027f35412cf00141c41f52413db5e31 @@ -0,0 +1,447 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); + // int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + 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()); + // if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/83/a05c8663b7d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/a05c8663b7d000141b65e2fc7f94332d new file mode 100644 index 0000000..5abaee0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/a05c8663b7d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 16, 16); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/c023ecaca5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/c023ecaca5ce00141801ff0972626827 new file mode 100644 index 0000000..6243b1d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/c023ecaca5ce00141801ff0972626827 @@ -0,0 +1,448 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((ItemBaseJewelry)item.getItem()).action(item, player); + } + if (!player.worldObj.isRemote){ + playerInfo.setBoolean("stunned", true); + playerInfo.setInteger("stunTime", 50); + 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 + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); + } + 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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/85/20a25d63bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/20a25d63bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..862811c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/20a25d63bbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 180, -90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/20ce4e77a0ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/20ce4e77a0ce00141801ff0972626827 new file mode 100644 index 0000000..e69de29 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/8013b6e1bdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/8013b6e1bdd000141b65e2fc7f94332d new file mode 100644 index 0000000..4bf0be3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/8013b6e1bdd000141b65e2fc7f94332d @@ -0,0 +1,237 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if((Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(-0.2F, 0F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/902f5c8116cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/902f5c8116cf00141c41f52413db5e31 new file mode 100644 index 0000000..d7d8d9b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/902f5c8116cf00141c41f52413db5e31 @@ -0,0 +1,32 @@ +package darkknight.jewelrycraft.curses; + +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player) + { + if (!world.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20f && rand.nextInt(5) == 0) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 2.0F); + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/407ff7ab81d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/407ff7ab81d000141a1fb02abca5ff55 new file mode 100644 index 0000000..2ea2b2d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/407ff7ab81d000141a1fb02abca5ff55 @@ -0,0 +1,67 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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.DamageSource; +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 +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1); + Minecraft.getMinecraft().gameSettings.renderDistanceChunks = 0; + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/0090d02f23cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/0090d02f23cf00141c41f52413db5e31 new file mode 100644 index 0000000..cee1728 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/0090d02f23cf00141c41f52413db5e31 @@ -0,0 +1,460 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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"}; + System.out.println(event.hasResult() + " " + event.getResult()); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/87/108b25f9b6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/108b25f9b6d000141b65e2fc7f94332d new file mode 100644 index 0000000..f3f6d25 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/108b25f9b6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 30, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/902740e1bad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/902740e1bad000141b65e2fc7f94332d new file mode 100644 index 0000000..df04e06 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/902740e1bad000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 75, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/d084e8b4f2cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/d084e8b4f2cf0014170de422db399e8d new file mode 100644 index 0000000..791f19e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/d084e8b4f2cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); + if (chunkposition != null && chunkposition.chunkPosX != player.posX && chunkposition.chunkPosZ != player.posZ){ + Minecraft.getMinecraft().thePlayer.motionX -= 0.01D*Math.signum((double)chunkposition.chunkPosX); + Minecraft.getMinecraft().thePlayer.motionZ -= 0.01D*Math.signum((double)chunkposition.chunkPosZ); + System.out.println(chunkposition.chunkPosX + " " + chunkposition.chunkPosZ); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/1058a217f5cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/1058a217f5cf0014170de422db399e8d new file mode 100644 index 0000000..3363e80 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/1058a217f5cf0014170de422db399e8d @@ -0,0 +1,69 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + if (player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky){ + player.setAIMoveSpeed(20f); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/708b72abbbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/708b72abbbd000141b65e2fc7f94332d new file mode 100644 index 0000000..afd9dd3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/708b72abbbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/109be73121cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/109be73121cf00141c41f52413db5e31 new file mode 100644 index 0000000..c0f720a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/109be73121cf00141c41f52413db5e31 @@ -0,0 +1,36 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +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.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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)){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 2.0F); + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 2.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/20884d44b4d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/20884d44b4d000141b65e2fc7f94332d new file mode 100644 index 0000000..b578e53 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/20884d44b4d000141b65e2fc7f94332d @@ -0,0 +1,195 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 20, 145, 150, 35, 30); + name.add(item.getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/602f81f1b9d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/602f81f1b9d000141b65e2fc7f94332d new file mode 100644 index 0000000..e569381 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/602f81f1b9d000141b65e2fc7f94332d @@ -0,0 +1,232 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/704de242b6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/704de242b6d000141b65e2fc7f94332d new file mode 100644 index 0000000..d817166 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/704de242b6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 145, 150, 35, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft(), gui.getTop()); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/902c91fbf5cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/902c91fbf5cf0014170de422db399e8d new file mode 100644 index 0000000..6c48ef2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/902c91fbf5cf0014170de422db399e8d @@ -0,0 +1,69 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + if (player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky){ + if (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 140, 1)); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/90e4273eb4d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/90e4273eb4d000141b65e2fc7f94332d new file mode 100644 index 0000000..3af779d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/90e4273eb4d000141b65e2fc7f94332d @@ -0,0 +1,195 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 7, y + 20, 145, 150, 35, 30); + name.add(item.getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/b0804ec7bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/b0804ec7bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..afd9dd3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/b0804ec7bbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/00916edebad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/00916edebad000141b65e2fc7f94332d new file mode 100644 index 0000000..18a37bb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/00916edebad000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/40989e4e2f9300141384bdd0ca2744d8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/40989e4e2f9300141384bdd0ca2744d8 new file mode 100644 index 0000000..271bdb6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/40989e4e2f9300141384bdd0ca2744d8 @@ -0,0 +1,659 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import darkknight.jewelrycraft.item.ItemRing; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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); + if (itemStackData.hasKey("gemNumber")) itemStackData.setInteger("gemNumber", itemStackData.getInteger("gemNumber") + 1); + else itemStackData.setInteger("gemNumber", 1); + int no = itemStackData.getInteger("gemNumber"); + itemStackData.setTag("gem" + no, 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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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 + public static void addGemColor(ItemStack item, int color, int indice) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound colors = new NBTTagCompound(); + colors.setInteger("gemColor" + indice, color); + itemStackData.setTag("gemColors", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + 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; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack gem(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems.get(new Random().nextInt(gems.size())); + } + return null; + } + + public static ArrayList gems(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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 + public static int gemColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()) + { + NBTTagCompound color = (NBTTagCompound) stack.getTagCompound().getTag("gemColors"); + if (stack.getTagCompound().hasKey("gemNumber")) + { + ArrayList colors = new ArrayList(); + int no = stack.getTagCompound().getInteger("gemNumber"); + for (int i = 1; i <= no; i++) + { + int col = color.getInteger("gemColor" + i); + colors.add(col); + } + int prevColor = colors.get(0); + System.out.println(colors); + if(new Random().nextInt(1) == 0) prevColor = colors.get(new Random().nextInt(colors.size())); + return prevColor; + } + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/7094473ba5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/7094473ba5ce00141801ff0972626827 new file mode 100644 index 0000000..1d69f07 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/7094473ba5ce00141801ff0972626827 @@ -0,0 +1,436 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/92/0012daebb6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/0012daebb6d000141b65e2fc7f94332d new file mode 100644 index 0000000..53cd112 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/0012daebb6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 150, 30, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/5027d4627dcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/5027d4627dcf00141de78e4a85bb2469 new file mode 100644 index 0000000..b50b132 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/5027d4627dcf00141de78e4a85bb2469 @@ -0,0 +1,221 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.registry.GameData; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.events.EntityEventHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; + +public class JewelrycraftUtil +{ + public static ArrayList objects = new ArrayList(); + public static ArrayList gem = new ArrayList(); + public static ArrayList jewelry = new ArrayList(); + public static ArrayList metal = new ArrayList(); + public static ArrayList ores = new ArrayList(); + public static HashMap oreToIngot = new HashMap(); + public static ArrayList jamcraftPlayers = new ArrayList(); + public static Random rand = new Random(); + + /** + * Adds gems and jewelry to their appropriate list + */ + public static void addStuff() + { + // Jewels + for(int i = 0; i < 16; i++) + gem.add(new ItemStack(ItemList.crystal, 1, i)); + gem.add(new ItemStack(Blocks.redstone_block)); + gem.add(new ItemStack(Blocks.lapis_block)); + gem.add(new ItemStack(Blocks.obsidian)); + gem.add(new ItemStack(Items.diamond)); + gem.add(new ItemStack(Items.emerald)); + gem.add(new ItemStack(Items.ender_pearl)); + gem.add(new ItemStack(Items.nether_star)); + // Jewelry + jewelry.add(new ItemStack(ItemList.ring)); + jewelry.add(new ItemStack(ItemList.necklace)); + jewelry.add(new ItemStack(ItemList.bracelet)); + jewelry.add(new ItemStack(ItemList.earrings)); + for(Object item: GameData.getItemRegistry()){ + ArrayList items = new ArrayList(); + if (((Item)item).getHasSubtypes()) ((Item)item).getSubItems((Item)item, null, items); + else objects.add(new ItemStack((Item)item)); + + if (!items.isEmpty()) objects.addAll(items); + } + } + + /** + * Adds curse points to a player + * + * @param player the player to add the points to + * @param points amount of curse points + */ + public static void addCursePoints(EntityPlayer player, int points) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + playerInfo.setInteger("cursePoints", playerInfo.hasKey("cursePoints") ? (playerInfo.getInteger("cursePoints") + points) : points); + playerInfo.setBoolean("playerCursePointsChanged", true); + } + + public static int getCursePoints(EntityPlayer player) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + return playerInfo.getInteger("cursePoints"); + } + + /** + * Adds the UUID's of the jamcrafters in a list + */ + public static void jamcrafters() + { + jamcraftPlayers.add("d3214311-7550-4c9c-a372-d9292c10b8a6"); + jamcraftPlayers.add("a690119f-c4a2-4bd6-a99d-d63679abb328"); + jamcraftPlayers.add("de7c9903-51fa-4a24-88cd-48faf122ca36"); + jamcraftPlayers.add("70aeb298-3a7b-46da-a393-ab10df9359f2"); + jamcraftPlayers.add("6fbe603c-14bf-4085-afdd-abe592c26e7c"); + jamcraftPlayers.add("b0d21306-36bf-4d85-84df-a956d183c45a"); + jamcraftPlayers.add("1733a31f-01f9-4f4d-82aa-7de30ca810d3"); + jamcraftPlayers.add("4833eacf-1d94-49a7-9f89-4cf88d69dcf9"); + jamcraftPlayers.add("718cf671-9084-4e78-b91f-033e80aa11bf"); + jamcraftPlayers.add("bea5e0c4-85c4-454d-a081-e1eaae6895ee"); + jamcraftPlayers.add("7ecf3e2f-fedf-4f7e-8d24-6731d078db4f"); + jamcraftPlayers.add("1b11ad3a-f0ca-4695-a019-2d7e5d83a5fd"); + jamcraftPlayers.add("3ec9ac58-2f1b-4d3f-b4eb-3b875da877ae"); + jamcraftPlayers.add("cf9fa23f-205e-4eed-aba3-9f2848cd6a4d"); + jamcraftPlayers.add("91880caa-b032-48e3-bfe8-c2c7ed31824e"); + jamcraftPlayers.add("8d0b3804-f71c-4219-897b-8c315448ea7c"); + jamcraftPlayers.add("bbb87dbe-690f-4205-bdc5-72ffb8ebc29d"); + } + + /** + * Adds a random amount of modifiers to a list + * + * @param randValue maximum number of modifiers + * @return a list containing the random modifiers + */ + public static ArrayList addRandomModifiers(int randValue) + { + ArrayList list = new ArrayList(); + for(int i = 0; i < 2 + randValue; i++){ + ItemStack item = objects.get(new Random().nextInt(objects.size())); + item.stackSize = 1 + new Random().nextInt(2); + list.add(item); + } + return list; + } + + /** + * Links ores with their appropriate ingot + */ + public static void addMetals() + { + int index = 0; + while (index < OreDictionary.getOreNames().length){ + Iterator i = OreDictionary.getOres(OreDictionary.getOreNames()[index]).iterator(); + while (i.hasNext()){ + ItemStack nextStack = i.next(); + if ((nextStack.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || nextStack.getItem().getUnlocalizedName().toLowerCase().contains("alloy")) && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("powder") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("dust") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("block") && !metal.contains(nextStack)){ + metal.add(nextStack); + if (OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")) != null){ + ores.addAll(OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore"))); + Iterator ores = OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")).iterator(); + while (ores.hasNext()){ + ItemStack ore = ores.next(); + oreToIngot.put(ore.getItem(), nextStack); + } + } + } + } + index++; + } + } + + /** + * Checks to see if the specified item is a gem + * + * @param item ItemStack containing the item + * @return is the item a gem + */ + public static boolean isGem(ItemStack item) + { + Iterator i = gem.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is a metal + * + * @param item ItemStack containing the item + * @return is the item a metal + */ + public static boolean isMetal(ItemStack item) + { + Iterator i = metal.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is a piece of jewelry + * + * @param item ItemStack containing the item + * @return is the item a piece of jewelry + */ + public static boolean isJewelry(ItemStack item) + { + Iterator i = jewelry.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is an ore + * + * @param item ItemStack containing the item + * @return is the item an ore + */ + public static boolean isOre(ItemStack item) + { + Iterator i = ores.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Gets the ingot from the ore + * + * @param ore the ore + * @return the ingot + */ + public static ItemStack getIngotFromOre(Item ore) + { + return oreToIngot.get(ore); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/309bb5e59bd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/309bb5e59bd000141b65e2fc7f94332d new file mode 100644 index 0000000..265bccf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/309bb5e59bd000141b65e2fc7f94332d @@ -0,0 +1,44 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.item.ItemList; + +public class GuiTabIntroduction extends GuiTab +{ + public GuiTabIntroduction(int id) + { + super("Introduction", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(ItemList.ring); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Welcome to Jewelrycraft 2! This mod"; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/5050fcc811cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/5050fcc811cf00141c41f52413db5e31 new file mode 100644 index 0000000..aa51a8b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/5050fcc811cf00141c41f52413db5e31 @@ -0,0 +1,30 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void action(World world, EntityPlayer player) + { + } + + @Override + public boolean itemToss() + { + return true; + } + + public String getDescription() + { + return "You might need that later"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/101de9f4bad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/101de9f4bad000141b65e2fc7f94332d new file mode 100644 index 0000000..2b60405 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/101de9f4bad000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/808d7bfff2cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/808d7bfff2cf0014170de422db399e8d new file mode 100644 index 0000000..f8aa647 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/808d7bfff2cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); + if (chunkposition != null && chunkposition.chunkPosX != (int)player.posX && chunkposition.chunkPosZ != (int)player.posZ){ + Minecraft.getMinecraft().thePlayer.motionX += 0.01D*Math.signum((double)chunkposition.chunkPosX); + Minecraft.getMinecraft().thePlayer.motionZ += 0.01D*Math.signum((double)chunkposition.chunkPosZ); + System.out.println(chunkposition.chunkPosX + " " + player.chunkCoordX); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/20fefcf5f6cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/20fefcf5f6cf0014170de422db399e8d new file mode 100644 index 0000000..3353bd7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/20fefcf5f6cf0014170de422db399e8d @@ -0,0 +1,66 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote && rand.nextInt(200) == 0) player.setPositionAndUpdate(player.posX + rand.nextInt(30)*(rand.nextBoolean()?-1:1), player.posY, player.posZ + rand.nextInt(30)*(rand.nextBoolean()?-1:1)); + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/30e2d9ce70cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/30e2d9ce70cf00141de78e4a85bb2469 new file mode 100644 index 0000000..aa815f7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/30e2d9ce70cf00141de78e4a85bb2469 @@ -0,0 +1,41 @@ +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (rand.nextInt(5) == 0 && !world.isRemote && !(target instanceof EntityMob) && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && target.canAttackWithItem()){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if (player.getMaxHealth() >= 3F){ + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + player.setHealth(player.getHealth() - 1.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/50e131a6a5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/50e131a6a5ce00141801ff0972626827 new file mode 100644 index 0000000..f5ee061 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/50e131a6a5ce00141801ff0972626827 @@ -0,0 +1,447 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((ItemBaseJewelry)item.getItem()).action(item, player); + } + if (!player.worldObj.isRemote){ + 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 + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); + } + playerInfo.setBoolean("stunned", true); + 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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/9a/e0a4fd13b7d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/e0a4fd13b7d000141b65e2fc7f94332d new file mode 100644 index 0000000..bf91c81 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/e0a4fd13b7d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 15, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/b08e70da15cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/b08e70da15cf00141c41f52413db5e31 new file mode 100644 index 0000000..9196314 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/b08e70da15cf00141c41f52413db5e31 @@ -0,0 +1,460 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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()); + System.out.println("SendInfo"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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(player.worldObj, player); + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/9c/40075a7e83d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/40075a7e83d000141a1fb02abca5ff55 new file mode 100644 index 0000000..897fa1b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/40075a7e83d000141a1fb02abca5ff55 @@ -0,0 +1,76 @@ +package darkknight.jewelrycraft.effects; + +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.DamageSource; +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) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1){ + if(!originalVD){ + originalViewDistance = Minecraft.getMinecraft().gameSettings.getOptionFloatValue(Options.RENDER_DISTANCE); + originalVD = true; + } + Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, originalViewDistance); + Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.0F); + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/a07e323e82d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/a07e323e82d000141a1fb02abca5ff55 new file mode 100644 index 0000000..372010e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/a07e323e82d000141a1fb02abca5ff55 @@ -0,0 +1,67 @@ +package darkknight.jewelrycraft.effects; + +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.DamageSource; +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 +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1) Minecraft.getMinecraft().gameSettings.setOptionValue(Options.RENDER_DISTANCE, 4); + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/e0dd554e24cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/e0dd554e24cf00141c41f52413db5e31 new file mode 100644 index 0000000..51d2036 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/e0dd554e24cf00141c41f52413db5e31 @@ -0,0 +1,460 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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"}; + System.out.println(event.isCancelable()); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/9e/009246eabcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/009246eabcd000141b65e2fc7f94332d new file mode 100644 index 0000000..65d92b8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/009246eabcd000141b65e2fc7f94332d @@ -0,0 +1,244 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHT1); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT1); + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/106b3f3e7ecf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/106b3f3e7ecf00141de78e4a85bb2469 new file mode 100644 index 0000000..8f277f8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/106b3f3e7ecf00141de78e4a85bb2469 @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.client; + +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.CommonProxy; +import darkknight.jewelrycraft.block.BlockList; +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.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.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.ItemRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +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; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation("jewelrycraft", "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation("jewelrycraft", "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(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("jewelrycraft", "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("jewelrycraft", "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/20478b38b4d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/20478b38b4d000141b65e2fc7f94332d new file mode 100644 index 0000000..2b702e6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/20478b38b4d000141b65e2fc7f94332d @@ -0,0 +1,195 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 5, y + 20, 145, 150, 35, 30); + name.add(item.getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/20c9f6e114cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/20c9f6e114cf00141c41f52413db5e31 new file mode 100644 index 0000000..b8f0135 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/20c9f6e114cf00141c41f52413db5e31 @@ -0,0 +1,459 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0 && 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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(player.worldObj, player); + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/9f/20d9a4a46eae0014128c87a7399fc341 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/20d9a4a46eae0014128c87a7399fc341 new file mode 100644 index 0000000..f1a12e9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/20d9a4a46eae0014128c87a7399fc341 @@ -0,0 +1,269 @@ +package darkknight.jewelrycraft.tileentity; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +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 net.minecraft.world.World; +import cpw.mods.fml.common.registry.GameData; +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; + +public class TileEntityShadowEye extends TileEntity +{ + public int opening, timer, t = 20; + public boolean active; + public int field_145926_a; + public float field_145933_i; + public float field_145931_j; + public float field_145930_m; + public float field_145927_n; + public ArrayList pedestalItems = new ArrayList(); + + public TileEntityShadowEye() + { + this.opening = 1; + this.timer = 20; + this.active = false; + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + nbt.setInteger("opening", opening); + nbt.setInteger("timer", timer); + nbt.setBoolean("active", active); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + this.opening = nbt.getInteger("opening"); + this.timer = nbt.getInteger("timer"); + this.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 = this.worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 7F); + if (player1 != null) + { + NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player1, "Jewelrycraft"); + 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)); + + 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 = this.worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 6F); + if (player != null) + { + NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + persistTag.setBoolean("nearStartedRitual", true); + } + } + } + + 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; + } + + 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)); + } + + 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.setHeldItemStack(null); + pedestal.isDirty = true; + } + } + + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound); + } + + @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/00a993b822cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/00a993b822cf00141c41f52413db5e31 new file mode 100644 index 0000000..2313b4d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/00a993b822cf00141c41f52413db5e31 @@ -0,0 +1,460 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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() <= 0) event.setCanceled(true); + if (player.getHealth() != player.prevHealth || player.getHealth() <= 0){ + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/a1/10a3c349bad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/10a3c349bad000141b65e2fc7f94332d new file mode 100644 index 0000000..edf3c5f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/10a3c349bad000141b65e2fc7f94332d @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class GuiTabGemsAndIngots extends GuiTab +{ + + /** + * @param id + */ + public GuiTabGemsAndIngots(int id) + { + super("Gems and ingots", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.emerald); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + for(int i = (page - 1) * 9; i < page * 9; i++) + if (i < JewelrycraftUtil.gem.size()){ + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Gems", gui.getLeft() + xPos + 40, gui.getTop(), 0); + gui.renderItem(JewelrycraftUtil.gem.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f, true); + gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.gem.get(i).getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + page -= JewelrycraftUtil.gem.size() / 9 + 1; + for(int i = (page - 1) * 9; i < page * 9; i++) + if (i < JewelrycraftUtil.metal.size() && page > 0){ + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ingots", gui.getLeft() + xPos + 40, gui.getTop(), 0); + gui.renderItem(JewelrycraftUtil.metal.get(i).copy(), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f, true); + gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.metal.get(i).copy().getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return JewelrycraftUtil.gem.size() / 9 + JewelrycraftUtil.metal.size() / 9 + 2; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/50356899bcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/50356899bcd000141b65e2fc7f94332d new file mode 100644 index 0000000..ce16bc2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/50356899bcd000141b65e2fc7f94332d @@ -0,0 +1,244 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + GL11.glEnable(GL11.GL_LIGHT1); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/90065c70f48a00141c1cba3f7039360c b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/90065c70f48a00141c1cba3f7039360c new file mode 100644 index 0000000..5629b1c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/90065c70f48a00141c1cba3f7039360c @@ -0,0 +1,617 @@ +package darkknight.jewelrycraft.util; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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 jewel + * The jewel you want to add on the item + */ + public static void addJewel(ItemStack item, ItemStack jewel) + { + if (jewel != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound jewelNBT = new NBTTagCompound(); + jewel.writeToNBT(jewelNBT); + itemStackData.setTag("jewel", jewelNBT); + } + } + + /** + * + * @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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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); + } + + public static void addJewelColor(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("jewelColor", color); + itemStackData.setTag("jewelColor", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + public static boolean isJewelX(ItemStack stack, ItemStack jewel) + { + if (jewel(stack) != null && jewel(stack).getItem() == jewel.getItem() && jewel(stack).getItemDamage() == jewel.getItemDamage()) return true; + return false; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack jewel(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewel")) + { + NBTTagCompound jewelNBT = (NBTTagCompound) stack.getTagCompound().getTag("jewel"); + ItemStack jewel = new ItemStack(Item.getItemById(0), 0, 0); + jewel.readFromNBT(jewelNBT); + return jewel; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static int jewelColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewelColor")) + { + NBTTagCompound colors = (NBTTagCompound) stack.getTagCompound().getTag("jewelColor"); + int color = colors.getInteger("jewelColor"); + int[] col = {color, 15532663, 1914319}; + return col[new Random().nextInt(3)]; + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/c0592c612f9300141384bdd0ca2744d8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/c0592c612f9300141384bdd0ca2744d8 new file mode 100644 index 0000000..a059a19 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/c0592c612f9300141384bdd0ca2744d8 @@ -0,0 +1,659 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import darkknight.jewelrycraft.item.ItemRing; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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); + if (itemStackData.hasKey("gemNumber")) itemStackData.setInteger("gemNumber", itemStackData.getInteger("gemNumber") + 1); + else itemStackData.setInteger("gemNumber", 1); + int no = itemStackData.getInteger("gemNumber"); + itemStackData.setTag("gem" + no, 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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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 + public static void addGemColor(ItemStack item, int color, int indice) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound colors = new NBTTagCompound(); + colors.setInteger("gemColor" + indice, color); + System.out.println(color); + itemStackData.setTag("gemColors", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + 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; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack gem(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems.get(new Random().nextInt(gems.size())); + } + return null; + } + + public static ArrayList gems(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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 + public static int gemColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()) + { + NBTTagCompound color = (NBTTagCompound) stack.getTagCompound().getTag("gemColors"); + if (stack.getTagCompound().hasKey("gemNumber")) + { + ArrayList colors = new ArrayList(); + int no = stack.getTagCompound().getInteger("gemNumber"); + for (int i = 1; i <= no; i++) + { + int col = color.getInteger("gemColor" + i); + colors.add(col); + } + int prevColor = colors.get(0); + if(new Random().nextInt(1) == 0) prevColor = colors.get(new Random().nextInt(colors.size())); + return prevColor; + } + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/90d73160f48a00141c1cba3f7039360c b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/90d73160f48a00141c1cba3f7039360c new file mode 100644 index 0000000..e10e186 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/90d73160f48a00141c1cba3f7039360c @@ -0,0 +1,617 @@ +package darkknight.jewelrycraft.util; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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 jewel + * The jewel you want to add on the item + */ + public static void addJewel(ItemStack item, ItemStack jewel) + { + if (jewel != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound jewelNBT = new NBTTagCompound(); + jewel.writeToNBT(jewelNBT); + itemStackData.setTag("jewel", jewelNBT); + } + } + + /** + * + * @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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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); + } + + public static void addJewelColor(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("jewelColor", color); + itemStackData.setTag("jewelColor", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + public static boolean isJewelX(ItemStack stack, ItemStack jewel) + { + if (jewel(stack) != null && jewel(stack).getItem() == jewel.getItem() && jewel(stack).getItemDamage() == jewel.getItemDamage()) return true; + return false; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack jewel(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewel")) + { + NBTTagCompound jewelNBT = (NBTTagCompound) stack.getTagCompound().getTag("jewel"); + ItemStack jewel = new ItemStack(Item.getItemById(0), 0, 0); + jewel.readFromNBT(jewelNBT); + return jewel; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static int jewelColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewelColor")) + { + NBTTagCompound colors = (NBTTagCompound) stack.getTagCompound().getTag("jewelColor"); + int color = colors.getInteger("jewelColor"); + int[] col = {color, 15532663, 1194432999}; + return col[new Random().nextInt(3)]; + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/f0aba030bdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/f0aba030bdd000141b65e2fc7f94332d new file mode 100644 index 0000000..99ce541 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/f0aba030bdd000141b65e2fc7f94332d @@ -0,0 +1,125 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + + case 5: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 1), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/70560814bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/70560814bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..80b0ef5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/70560814bbd000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/900b847d70cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/900b847d70cf00141de78e4a85bb2469 new file mode 100644 index 0000000..f33978f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/900b847d70cf00141de78e4a85bb2469 @@ -0,0 +1,23 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class CurseFlamingSoul extends Curse +{ + public CurseFlamingSoul(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void action(World world, EntityPlayer player) + { + if (!player.isBurning() && rand.nextInt(20) == 0) player.setFire(20); + } + + public String getDescription() + { + return "Is it me or is it getting hot in here?"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/b0489a1082d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/b0489a1082d000141a1fb02abca5ff55 new file mode 100644 index 0000000..3a91ddf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/b0489a1082d000141a1fb02abca5ff55 @@ -0,0 +1,67 @@ +package darkknight.jewelrycraft.effects; + +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.DamageSource; +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 +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1) Minecraft.getMinecraft().gameSettings.setOptionValue(Options.RENDER_DISTANCE, 0); + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/80a5a26aa4ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/80a5a26aa4ce00141801ff0972626827 new file mode 100644 index 0000000..fc65fd9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/80a5a26aa4ce00141801ff0972626827 @@ -0,0 +1,435 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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); + } + if (entity.motionX == 0D && entity.motionY == 0D && entity.motionZ == 0D) 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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/a4/b0b5ffe4bcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/b0b5ffe4bcd000141b65e2fc7f94332d new file mode 100644 index 0000000..e5ed8ce --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/b0b5ffe4bcd000141b65e2fc7f94332d @@ -0,0 +1,246 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHT1); + GL11.glDisable(GL11.GL_LIGHT2); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT1); + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/c0b377522f9300141384bdd0ca2744d8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/c0b377522f9300141384bdd0ca2744d8 new file mode 100644 index 0000000..65133c2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/c0b377522f9300141384bdd0ca2744d8 @@ -0,0 +1,659 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import darkknight.jewelrycraft.item.ItemRing; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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); + if (itemStackData.hasKey("gemNumber")) itemStackData.setInteger("gemNumber", itemStackData.getInteger("gemNumber") + 1); + else itemStackData.setInteger("gemNumber", 1); + int no = itemStackData.getInteger("gemNumber"); + itemStackData.setTag("gem" + no, 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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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 + public static void addGemColor(ItemStack item, int color, int indice) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound colors = new NBTTagCompound(); + colors.setInteger("gemColor" + indice, color); + itemStackData.setTag("gemColors", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + 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; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack gem(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems.get(new Random().nextInt(gems.size())); + } + return null; + } + + public static ArrayList gems(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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 + public static int gemColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()) + { + NBTTagCompound color = (NBTTagCompound) stack.getTagCompound().getTag("gemColors"); + if (stack.getTagCompound().hasKey("gemNumber")) + { + ArrayList colors = new ArrayList(); + int no = stack.getTagCompound().getInteger("gemNumber"); + for (int i = 1; i <= no; i++) + { + int col = color.getInteger("gemColor" + i); + colors.add(col); + } + int prevColor = colors.get(0); + System.out.println(color); + if(new Random().nextInt(1) == 0) prevColor = colors.get(new Random().nextInt(colors.size())); + return prevColor; + } + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/609c1e85a3d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/609c1e85a3d000141b65e2fc7f94332d new file mode 100644 index 0000000..d85620a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/609c1e85a3d000141b65e2fc7f94332d @@ -0,0 +1,68 @@ +package darkknight.jewelrycraft.events; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +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.lib.Reference; +import darkknight.jewelrycraft.model.ModelMask; +import darkknight.jewelrycraft.tileentity.renders.MaskRender; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class PlayerRenderHandler +{ + ModelMask maskModel = new ModelMask(); + MaskRender mask = new MaskRender(); + + public static String[] infamyCache = new String[] {}; + + @SubscribeEvent + public void renderScreen(RenderPlayerEvent.Specials.Post event) + { + if (infamyCache != null) + { + Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); + + while(players.hasNext()) + { + EntityPlayer player = players.next(); + 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(); + } + } + } + } + + /** + * @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/a6/908c46b1bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/908c46b1bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..cf731eb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/908c46b1bbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 130, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/104e81bcbbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/104e81bcbbd000141b65e2fc7f94332d new file mode 100644 index 0000000..0f3e06a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/104e81bcbbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 270, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/5091d7a47dcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/5091d7a47dcf00141de78e4a85bb2469 new file mode 100644 index 0000000..cddddfd --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/5091d7a47dcf00141de78e4a85bb2469 @@ -0,0 +1,223 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.registry.GameData; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.events.EntityEventHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; + +public class JewelrycraftUtil +{ + public static ArrayList objects = new ArrayList(); + public static ArrayList gem = new ArrayList(); + public static ArrayList jewelry = new ArrayList(); + public static ArrayList metal = new ArrayList(); + public static ArrayList ores = new ArrayList(); + public static HashMap oreToIngot = new HashMap(); + public static ArrayList jamcraftPlayers = new ArrayList(); + public static Random rand = new Random(); + + /** + * Adds gems and jewelry to their appropriate list + */ + public static void addStuff() + { + // Jewels + for(int i = 0; i < 16; i++) + gem.add(new ItemStack(ItemList.crystal, 1, i)); + gem.add(new ItemStack(Blocks.redstone_block)); + gem.add(new ItemStack(Blocks.lapis_block)); + gem.add(new ItemStack(Blocks.obsidian)); + gem.add(new ItemStack(Items.diamond)); + gem.add(new ItemStack(Items.emerald)); + gem.add(new ItemStack(Items.ender_pearl)); + gem.add(new ItemStack(Items.nether_star)); + // Jewelry + jewelry.add(new ItemStack(ItemList.ring)); + jewelry.add(new ItemStack(ItemList.necklace)); + jewelry.add(new ItemStack(ItemList.bracelet)); + jewelry.add(new ItemStack(ItemList.earrings)); + for(Object item: GameData.getItemRegistry()){ + ArrayList items = new ArrayList(); + if (item != null && ((Item)item).getHasSubtypes()) ((Item)item).getSubItems((Item)item, + null, + items); + else objects.add(new ItemStack((Item)item)); + + if (!items.isEmpty()) objects.addAll(items); + } + } + + /** + * Adds curse points to a player + * + * @param player the player to add the points to + * @param points amount of curse points + */ + public static void addCursePoints(EntityPlayer player, int points) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + playerInfo.setInteger("cursePoints", playerInfo.hasKey("cursePoints") ? (playerInfo.getInteger("cursePoints") + points) : points); + playerInfo.setBoolean("playerCursePointsChanged", true); + } + + public static int getCursePoints(EntityPlayer player) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + return playerInfo.getInteger("cursePoints"); + } + + /** + * Adds the UUID's of the jamcrafters in a list + */ + public static void jamcrafters() + { + jamcraftPlayers.add("d3214311-7550-4c9c-a372-d9292c10b8a6"); + jamcraftPlayers.add("a690119f-c4a2-4bd6-a99d-d63679abb328"); + jamcraftPlayers.add("de7c9903-51fa-4a24-88cd-48faf122ca36"); + jamcraftPlayers.add("70aeb298-3a7b-46da-a393-ab10df9359f2"); + jamcraftPlayers.add("6fbe603c-14bf-4085-afdd-abe592c26e7c"); + jamcraftPlayers.add("b0d21306-36bf-4d85-84df-a956d183c45a"); + jamcraftPlayers.add("1733a31f-01f9-4f4d-82aa-7de30ca810d3"); + jamcraftPlayers.add("4833eacf-1d94-49a7-9f89-4cf88d69dcf9"); + jamcraftPlayers.add("718cf671-9084-4e78-b91f-033e80aa11bf"); + jamcraftPlayers.add("bea5e0c4-85c4-454d-a081-e1eaae6895ee"); + jamcraftPlayers.add("7ecf3e2f-fedf-4f7e-8d24-6731d078db4f"); + jamcraftPlayers.add("1b11ad3a-f0ca-4695-a019-2d7e5d83a5fd"); + jamcraftPlayers.add("3ec9ac58-2f1b-4d3f-b4eb-3b875da877ae"); + jamcraftPlayers.add("cf9fa23f-205e-4eed-aba3-9f2848cd6a4d"); + jamcraftPlayers.add("91880caa-b032-48e3-bfe8-c2c7ed31824e"); + jamcraftPlayers.add("8d0b3804-f71c-4219-897b-8c315448ea7c"); + jamcraftPlayers.add("bbb87dbe-690f-4205-bdc5-72ffb8ebc29d"); + } + + /** + * Adds a random amount of modifiers to a list + * + * @param randValue maximum number of modifiers + * @return a list containing the random modifiers + */ + public static ArrayList addRandomModifiers(int randValue) + { + ArrayList list = new ArrayList(); + for(int i = 0; i < 2 + randValue; i++){ + ItemStack item = objects.get(new Random().nextInt(objects.size())); + item.stackSize = 1 + new Random().nextInt(2); + list.add(item); + } + return list; + } + + /** + * Links ores with their appropriate ingot + */ + public static void addMetals() + { + int index = 0; + while (index < OreDictionary.getOreNames().length){ + Iterator i = OreDictionary.getOres(OreDictionary.getOreNames()[index]).iterator(); + while (i.hasNext()){ + ItemStack nextStack = i.next(); + if ((nextStack.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || nextStack.getItem().getUnlocalizedName().toLowerCase().contains("alloy")) && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("powder") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("dust") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("block") && !metal.contains(nextStack)){ + metal.add(nextStack); + if (OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")) != null){ + ores.addAll(OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore"))); + Iterator ores = OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")).iterator(); + while (ores.hasNext()){ + ItemStack ore = ores.next(); + oreToIngot.put(ore.getItem(), nextStack); + } + } + } + } + index++; + } + } + + /** + * Checks to see if the specified item is a gem + * + * @param item ItemStack containing the item + * @return is the item a gem + */ + public static boolean isGem(ItemStack item) + { + Iterator i = gem.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is a metal + * + * @param item ItemStack containing the item + * @return is the item a metal + */ + public static boolean isMetal(ItemStack item) + { + Iterator i = metal.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is a piece of jewelry + * + * @param item ItemStack containing the item + * @return is the item a piece of jewelry + */ + public static boolean isJewelry(ItemStack item) + { + Iterator i = jewelry.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is an ore + * + * @param item ItemStack containing the item + * @return is the item an ore + */ + public static boolean isOre(ItemStack item) + { + Iterator i = ores.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Gets the ingot from the ore + * + * @param ore the ore + * @return the ingot + */ + public static ItemStack getIngotFromOre(Item ore) + { + return oreToIngot.get(ore); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/b0e9a94b82d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/b0e9a94b82d000141a1fb02abca5ff55 new file mode 100644 index 0000000..b558ba7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/b0e9a94b82d000141a1fb02abca5ff55 @@ -0,0 +1,67 @@ +package darkknight.jewelrycraft.effects; + +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.DamageSource; +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 +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1) Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 4.0F); + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/702aada322cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/702aada322cf00141c41f52413db5e31 new file mode 100644 index 0000000..28e5300 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/702aada322cf00141c41f52413db5e31 @@ -0,0 +1,460 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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 || player.getHealth() == 0){ + 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)); + } + } + event.setCanceled(true); + } + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/a9/d0cb2f4b7ecf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/d0cb2f4b7ecf00141de78e4a85bb2469 new file mode 100644 index 0000000..fb7b38f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/d0cb2f4b7ecf00141de78e4a85bb2469 @@ -0,0 +1,87 @@ +package darkknight.jewelrycraft.client; + +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.CommonProxy; +import darkknight.jewelrycraft.block.BlockList; +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.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.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.ItemRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +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; + +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation("jewelrycraft", "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation("jewelrycraft", "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(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("jewelrycraft", "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("jewelrycraft", "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } + + @Override + public void postInit() + { + + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/00c84d88bed000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/00c84d88bed000141b65e2fc7f94332d new file mode 100644 index 0000000..673ca0f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/00c84d88bed000141b65e2fc7f94332d @@ -0,0 +1,241 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))){ + GL11.glScalef(1.2F, 1.2F, 1.2F); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0F, 0.1F, 0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + // GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if (xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if (Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/30b09a9679cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/30b09a9679cf00141de78e4a85bb2469 new file mode 100644 index 0000000..d3cb52d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/30b09a9679cf00141de78e4a85bb2469 @@ -0,0 +1,99 @@ +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; + +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("jewelrycraft", "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(texture); + 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); + count++; + } + } + 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(4, 4 + (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.glColor4f(1f, 1f, 1f, 1.0f); + mc.renderEngine.bindTexture(hearts); + count = 0; + 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); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/6017c8e9b5d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/6017c8e9b5d000141b65e2fc7f94332d new file mode 100644 index 0000000..d0816ec --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/6017c8e9b5d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 145, 150, 35, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/50048858e65300141786a2891bfc8d75 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/50048858e65300141786a2891bfc8d75 new file mode 100644 index 0000000..448fc78 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/50048858e65300141786a2891bfc8d75 @@ -0,0 +1,89 @@ +package darkknight.jewelrycraft.particles; + +import static org.lwjgl.opengl.GL11.GL_BLEND; +import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA; +import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA; +import static org.lwjgl.opengl.GL11.glBlendFunc; +import static org.lwjgl.opengl.GL11.glEnable; + +import java.util.Iterator; +import java.util.List; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class EntityShadowsFX extends EntityFX +{ + float moteParticleScale; + + public EntityShadowsFX(World world, double x, double y, double z, float size, float red, float green, float blue, float maxAge) + { + super(world, x, y, z, 0D, 0D, 0D); + + particleRed = red; + particleGreen = green; + particleBlue = blue; + particleMaxAge = (int) (28D / (Math.random() * 0.3D + 0.7D) * maxAge); + particleGravity = 0F; + motionX = motionY = motionZ = 0; + particleScale *= size; + moteParticleScale = particleScale; + noClip = true; + setSize(0.01F, 0.01F); + } + + @Override + public void renderParticle(Tessellator tessellator, float partialTicks, float minX, float minY, float minZ, float maxX, float maxZ) + { + tessellator.draw(); + ResourceLocation particle = new ResourceLocation("jewelrycraft", "textures/particle/shadows.png"); + Minecraft.getMinecraft().renderEngine.bindTexture(particle); + GL11.glColor4f(1, 1, 1, 1); + tessellator.startDrawingQuads(); + tessellator.setBrightness(this.getBrightnessForRender(0)); + float scale = 0.1F * particleScale; + float x = (float) (prevPosX + (posX - prevPosX) * partialTicks - interpPosX); + float y = (float) (prevPosY + (posY - prevPosY) * partialTicks - interpPosY); + float z = (float) (prevPosZ + (posZ - prevPosZ) * partialTicks - interpPosZ); + tessellator.setColorRGBA_F(particleRed, particleGreen, particleBlue, 0.5F); + tessellator.addVertexWithUV(x - minX * scale - maxX * scale, y - minY * scale, z - minZ * scale - maxZ * scale, 0, 0); + tessellator.addVertexWithUV(x - minX * scale + maxX * scale, y + minY * scale, z - minZ * scale + maxZ * scale, 1, 0); + tessellator.addVertexWithUV(x + minX * scale + maxX * scale, y + minY * scale, z + minZ * scale + maxZ * scale, 1, 1); + tessellator.addVertexWithUV(x + minX * scale - maxX * scale, y - minY * scale, z + minZ * scale - maxZ * scale, 0, 1); + tessellator.draw(); + tessellator.startDrawingQuads(); + } + + public void onUpdate() + { + super.onUpdate(); + EntityPlayer player = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); + AxisAlignedBB axisalignedbb = this.boundingBox.expand(1.0D, 16.0D, 1.0D); + List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + if (list1 != null && !list1.isEmpty()) + { + Iterator iterator = list1.iterator(); + + while (iterator.hasNext()) + { + EntityLivingBase entitylivingbase = (EntityLivingBase) iterator.next(); + if (entitylivingbase != null && this.posX <= entitylivingbase.posX + 0.5F && this.posX >= entitylivingbase.posX - 0.5F && this.posZ <= entitylivingbase.posZ + 0.5F && this.posZ >= entitylivingbase.posZ - 0.5F) entitylivingbase.attackEntityFrom(DamageSource.anvil, 100F); + } + } + } + + public int getFXLayer() + { + return 2; + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/50346c7da0ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/50346c7da0ce00141801ff0972626827 new file mode 100644 index 0000000..1e2260a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/50346c7da0ce00141801ff0972626827 @@ -0,0 +1,12 @@ +/** + * + */ +package darkknight.jewelrycraft.curses; + +/** + * @author Sorin + * + */ +public class CurseInfamy +{ +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/70b9cd197acf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/70b9cd197acf00141de78e4a85bb2469 new file mode 100644 index 0000000..0fa9519 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/70b9cd197acf00141de78e4a85bb2469 @@ -0,0 +1,104 @@ +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; + +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("jewelrycraft", "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(texture); + 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); + count++; + } + } + 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(4, 4 + (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.glColor4f(1f, 1f, 1f, 1.0f); +// GL11.glDisable(GL11.GL_LIGHTING); +// GL11.glScalef(0.5f, 0.5f, 0.0f); + GL11.glPushMatrix(); + 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/ad/400a697183d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/400a697183d000141a1fb02abca5ff55 new file mode 100644 index 0000000..f54664e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/400a697183d000141a1fb02abca5ff55 @@ -0,0 +1,76 @@ +package darkknight.jewelrycraft.effects; + +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.DamageSource; +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) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1){ + if(!originalVD){ + originalViewDistance = Minecraft.getMinecraft().gameSettings.getOptionFloatValue(Options.RENDER_DISTANCE); + originalVD = true; + } + Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.0F); + Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, originalViewDistance); + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/901e9340bcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/901e9340bcd000141b65e2fc7f94332d new file mode 100644 index 0000000..ae07eef --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/901e9340bcd000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate, 0, 0, 0); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate, 0, 0, 0); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate, 0, 0, 0); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate, 0, 0, 0); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate, 0, 0, 0); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item, float xRot, float yRot, float zRot) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 21 && mouseY >= y + 20 && mouseY <= y + 31) gui.drawHoverString(name, x, y + 10); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false, xRot, yRot, zRot); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate, 0, 0, 0); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0ba0cecf2cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0ba0cecf2cf0014170de422db399e8d new file mode 100644 index 0000000..576d27a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0ba0cecf2cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); + if (chunkposition != null && chunkposition.chunkPosX != (int)player.posX && chunkposition.chunkPosZ != (int)player.posZ){ + Minecraft.getMinecraft().thePlayer.motionX -= 0.01D*Math.signum((double)chunkposition.chunkPosX); + Minecraft.getMinecraft().thePlayer.motionZ -= 0.01D*Math.signum((double)chunkposition.chunkPosZ); + System.out.println(chunkposition.chunkPosX + " " + player.chunkCoordX); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0ca0d9da5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0ca0d9da5ce00141801ff0972626827 new file mode 100644 index 0000000..d9be141 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0ca0d9da5ce00141801ff0972626827 @@ -0,0 +1,102 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/b/b04e0c6083d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/b04e0c6083d000141a1fb02abca5ff55 new file mode 100644 index 0000000..1c798a7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/b04e0c6083d000141a1fb02abca5ff55 @@ -0,0 +1,80 @@ +package darkknight.jewelrycraft.effects; + +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.DamageSource; +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) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1){ + if(!originalVD){ + originalViewDistance = Minecraft.getMinecraft().gameSettings.getOptionFloatValue(Options.RENDER_DISTANCE); + originalVD = true; + } + Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.0F); + if(originalVD){ + Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, originalViewDistance); + System.out.println(originalViewDistance); + originalVD = false; + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/f079b2e06fcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/f079b2e06fcf00141de78e4a85bb2469 new file mode 100644 index 0000000..acfd005 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/f079b2e06fcf00141de78e4a85bb2469 @@ -0,0 +1,43 @@ +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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.canAttackWithItem()){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + if(playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if(player.getMaxHealth() >= 3F){ + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + player.setHealth(player.getHealth() - 2.0F); + } + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/805eed72bed000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/805eed72bed000141b65e2fc7f94332d new file mode 100644 index 0000000..70c76ee --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/805eed72bed000141b65e2fc7f94332d @@ -0,0 +1,240 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))){ + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0F, 0.2F, 0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + // GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if (xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if (Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/00a0532bbbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/00a0532bbbd000141b65e2fc7f94332d new file mode 100644 index 0000000..6494f00 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/00a0532bbbd000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/60e65c7684c600141066cb38d875561a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/60e65c7684c600141066cb38d875561a new file mode 100644 index 0000000..2bb29a9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/60e65c7684c600141066cb38d875561a @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.PlayerUtils; + +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); + // 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(); + } + } + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + {} + + @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, "Jewelrycraft"); + if (jewelry instanceof ItemNecklace && pos != -1 && rand.nextInt(4) == 0 && (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 * 6F); + // Negative earrings + if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); + } + + @Override + public boolean onPlayerFall(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/106fae7312cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/106fae7312cf00141c41f52413db5e31 new file mode 100644 index 0000000..e8d7512 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/106fae7312cf00141c41f52413db5e31 @@ -0,0 +1,94 @@ +package darkknight.jewelrycraft.curses; + +import java.util.ArrayList; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class Curse +{ + protected int id, texturepack; + protected String name, description; + private static ArrayList curses = new ArrayList(); + public static ArrayList availableCurses = new ArrayList(); + + /** + * @param id the ID of the curse + * @param name the name of the curse + * @param texturepack the ID of the pack the texture is located in + */ + protected Curse(int id, String name, int texturepack) + { + this.id = id; + this.name = name; + this.texturepack = texturepack; + curses.add(this); + availableCurses.add(this); + } + + /** + * @return the name of the curse + */ + public String getName() + { + return name; + } + + /** + * @return the description of the curse + */ + public String getDescription() + { + return description; + } + + public Curse setDescription(String desc) + { + description = desc; + return this; + } + + /** + * @return the curse ID + */ + public int getID() + { + return id; + } + + /** + * @return the texture pack ID + */ + public int getTexturePack() + { + return texturepack; + } + + /** + * @param world + * @param player + */ + public void action(World world, EntityPlayer player) + {} + + public void deathAction(World world, EntityPlayer player) + {} + + public void respawnAction(World world, EntityPlayer player) + {} + + public void attackedAction(World world, EntityPlayer player) + {} + + public boolean itemToss() + { + return false; + } + + /** + * @return + */ + public static ArrayList getCurseList() + { + return curses; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/306a41c76fcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/306a41c76fcf00141de78e4a85bb2469 new file mode 100644 index 0000000..8b4ea2a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/306a41c76fcf00141de78e4a85bb2469 @@ -0,0 +1,43 @@ +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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.canAttackWithItem()){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + if(playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if(player.getMaxHealth() >= 3F){ + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + player.attackEntityFrom(DamageSourceList.weak, 1.0F); + } + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/606b4ad414cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/606b4ad414cf00141c41f52413db5e31 new file mode 100644 index 0000000..ec363f6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/606b4ad414cf00141c41f52413db5e31 @@ -0,0 +1,458 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0 && 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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(player.worldObj, player); + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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); + // int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + 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()); + // if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/b6/60a49035e75300141786a2891bfc8d75 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/60a49035e75300141786a2891bfc8d75 new file mode 100644 index 0000000..0b7daf8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/60a49035e75300141786a2891bfc8d75 @@ -0,0 +1,85 @@ +package darkknight.jewelrycraft.particles; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import org.lwjgl.opengl.GL11; + +public class EntityShadowsFX extends EntityFX +{ + float moteParticleScale; + + public EntityShadowsFX(World world, double x, double y, double z, float size, float red, float green, float blue, float maxAge) + { + super(world, x, y, z, 0D, 0D, 0D); + + particleRed = red; + particleGreen = green; + particleBlue = blue; + particleMaxAge = (int) (28D / (Math.random() * 0.3D + 0.7D) * maxAge); + particleGravity = 0F; + motionX = motionY = motionZ = 0; + particleScale *= size; + moteParticleScale = particleScale; + noClip = true; + setSize(0.01F, 0.01F); + } + + @Override + public void renderParticle(Tessellator tessellator, float partialTicks, float minX, float minY, float minZ, float maxX, float maxZ) + { + tessellator.draw(); + ResourceLocation particle = new ResourceLocation("jewelrycraft", "textures/particle/shadows.png"); + Minecraft.getMinecraft().renderEngine.bindTexture(particle); + GL11.glColor4f(1, 1, 1, 1); + tessellator.startDrawingQuads(); + tessellator.setBrightness(this.getBrightnessForRender(0)); + float scale = 0.1F * particleScale; + float x = (float) (prevPosX + (posX - prevPosX) * partialTicks - interpPosX); + float y = (float) (prevPosY + (posY - prevPosY) * partialTicks - interpPosY); + float z = (float) (prevPosZ + (posZ - prevPosZ) * partialTicks - interpPosZ); + tessellator.setColorRGBA_F(particleRed, particleGreen, particleBlue, 0.5F); + tessellator.addVertexWithUV(x - minX * scale - maxX * scale, y - minY * scale, z - minZ * scale - maxZ * scale, 0, 0); + tessellator.addVertexWithUV(x - minX * scale + maxX * scale, y + minY * scale, z - minZ * scale + maxZ * scale, 1, 0); + tessellator.addVertexWithUV(x + minX * scale + maxX * scale, y + minY * scale, z + minZ * scale + maxZ * scale, 1, 1); + tessellator.addVertexWithUV(x + minX * scale - maxX * scale, y - minY * scale, z + minZ * scale - maxZ * scale, 0, 1); + tessellator.draw(); + tessellator.startDrawingQuads(); + } + + public void onUpdate() + { + super.onUpdate(); + AxisAlignedBB axisalignedbb = this.boundingBox.expand(1.0D, 16.0D, 1.0D); + List list1 = this.worldObj.getEntitiesWithinAABB(Entity.class, axisalignedbb); + if (list1 != null && !list1.isEmpty()) + { + Iterator iterator = list1.iterator(); + + while (iterator.hasNext()) + { + Entity entity = (Entity) iterator.next(); + if (entity != null && this.posX <= entity.posX + 0.5F && this.posX >= entity.posX - 0.5F && this.posZ <= entity.posZ + 0.5F && this.posZ >= entity.posZ - 0.5F) entity.attackEntityFrom(DamageSource.anvil, 100F); + if (entity instanceof EntityThrowable){ + ((EntityThrowable)entity).setDead(); + } + } + } + } + + public int getFXLayer() + { + return 2; + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/506e1ce570cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/506e1ce570cf00141de78e4a85bb2469 new file mode 100644 index 0000000..a59d8d2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/506e1ce570cf00141de78e4a85bb2469 @@ -0,0 +1,463 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + playerInfo.setFloat("BlueHeart", 0f); + playerInfo.setFloat("BlackHeart", 0f); + playerInfo.setFloat("WhiteHeart", 0f); + JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/b04a00579cd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/b04a00579cd000141b65e2fc7f94332d new file mode 100644 index 0000000..b58d01a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/b04a00579cd000141b65e2fc7f94332d @@ -0,0 +1,48 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.item.ItemList; + +public class GuiTabIntroduction extends GuiTab +{ + public GuiTabIntroduction(int id) + { + super("Introduction", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(ItemList.ring); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Welcome to Jewelrycraft 2! This mod is about making jewelry that you can modify to your own will. To find out how to create a jewelry, please consult the book and look at the Smelter block. To add modifiers to it you need to perform a ritual. To see how to do that, look at the Cursed Eye"; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 2: + text = "block in this giude."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/b0804930bcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/b0804930bcd000141b65e2fc7f94332d new file mode 100644 index 0000000..13180bf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/b0804930bcd000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate, 0, 0, 0); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate, 0, 0, 0); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate, 0, 0, 0); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate, 0, 0, 0); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate, 0, 0, 0); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item, float xRot, float yRot, float zRot) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, x, y + 10); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false, xRot, yRot, zRot); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate, 0, 0, 0); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/f0e12b0e9cd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/f0e12b0e9cd000141b65e2fc7f94332d new file mode 100644 index 0000000..2da7b57 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/f0e12b0e9cd000141b65e2fc7f94332d @@ -0,0 +1,48 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.item.ItemList; + +public class GuiTabIntroduction extends GuiTab +{ + public GuiTabIntroduction(int id) + { + super("Introduction", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(ItemList.ring); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Welcome to Jewelrycraft 2! This mod is about making jewelry that you can modify to your own will. To find out how to create a jewelry, please consult the book and look at the Smelter block. To add modifiers to it you need to perform a ritual. To see how to do that, look at the Cursed Eye block"; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 2: + text = "in the book."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/10f70a8cbed000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/10f70a8cbed000141b65e2fc7f94332d new file mode 100644 index 0000000..2d4f40b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/10f70a8cbed000141b65e2fc7f94332d @@ -0,0 +1,241 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))){ + GL11.glScalef(1.2F, 1.2F, 1.2F); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); +// GL11.glTranslatef(0F, 0.1F, 0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + // GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if (xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if (Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e03e7349a6ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e03e7349a6ce00141801ff0972626827 new file mode 100644 index 0000000..f7f5ea0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e03e7349a6ce00141801ff0972626827 @@ -0,0 +1,104 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + 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); + playerInfo.setBoolean("stunned", true); + playerInfo.setInteger("stunTime", 50); + } + 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, "Jewelrycraft"); + 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/b8/e0b1d7d7b6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e0b1d7d7b6d000141b65e2fc7f94332d new file mode 100644 index 0000000..a1b8dfc --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e0b1d7d7b6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 145, 150, 35, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/309ab103b0d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/309ab103b0d000141b65e2fc7f94332d new file mode 100644 index 0000000..9117357 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/309ab103b0d000141b65e2fc7f94332d @@ -0,0 +1,246 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + if(ItemStack.areItemStacksEqual(item, new ItemStack(Blocks.light_weighted_pressure_plate, 1, 0)))GL11.glRotatef(25.0F, -1.0F, 0.0F, 0.0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + RenderHelper.disableStandardItemLighting(); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/c0efc084a5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/c0efc084a5ce00141801ff0972626827 new file mode 100644 index 0000000..fd23486 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/c0efc084a5ce00141801ff0972626827 @@ -0,0 +1,103 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + 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); + playerInfo.setBoolean("stunned", 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, "Jewelrycraft"); + 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/b9/d024d91417cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/d024d91417cf00141c41f52413db5e31 new file mode 100644 index 0000000..144deed --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/d024d91417cf00141c41f52413db5e31 @@ -0,0 +1,32 @@ +package darkknight.jewelrycraft.curses; + +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player) + { + if (!world.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20f && rand.nextInt(5) == 0) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/20f3e540b4d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/20f3e540b4d000141b65e2fc7f94332d new file mode 100644 index 0000000..17e060d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/20f3e540b4d000141b65e2fc7f94332d @@ -0,0 +1,195 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 8, y + 20, 145, 150, 35, 30); + name.add(item.getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/601f11c4f38a00141c1cba3f7039360c b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/601f11c4f38a00141c1cba3f7039360c new file mode 100644 index 0000000..11ffc83 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/601f11c4f38a00141c1cba3f7039360c @@ -0,0 +1,616 @@ +package darkknight.jewelrycraft.util; + +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.init.Blocks; +import net.minecraft.init.Items; +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 jewel + * The jewel you want to add on the item + */ + public static void addJewel(ItemStack item, ItemStack jewel) + { + if (jewel != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound jewelNBT = new NBTTagCompound(); + jewel.writeToNBT(jewelNBT); + itemStackData.setTag("jewel", jewelNBT); + } + } + + /** + * + * @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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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); + } + + public static void addJewelColor(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("jewelColor", color); + itemStackData.setTag("jewelColor", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + public static boolean isJewelX(ItemStack stack, ItemStack jewel) + { + if (jewel(stack) != null && jewel(stack).getItem() == jewel.getItem() && jewel(stack).getItemDamage() == jewel.getItemDamage()) return true; + return false; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack jewel(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewel")) + { + NBTTagCompound jewelNBT = (NBTTagCompound) stack.getTagCompound().getTag("jewel"); + ItemStack jewel = new ItemStack(Item.getItemById(0), 0, 0); + jewel.readFromNBT(jewelNBT); + return jewel; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static int jewelColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewelColor")) + { + NBTTagCompound colors = (NBTTagCompound) stack.getTagCompound().getTag("jewelColor"); + int color = colors.getInteger("jewelColor"); + return color; + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/8033e6be23cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/8033e6be23cf00141c41f52413db5e31 new file mode 100644 index 0000000..1cfd815 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/8033e6be23cf00141c41f52413db5e31 @@ -0,0 +1,99 @@ +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; + +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("jewelrycraft", "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; + Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000); + 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(texture); + 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); + count++; + } + } + 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(4, 4 + (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.glColor4f(1f, 1f, 1f, 1.0f); + mc.renderEngine.bindTexture(hearts); + count = 0; + 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); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/60c1a1249fce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/60c1a1249fce00141801ff0972626827 new file mode 100644 index 0000000..aaad87d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/60c1a1249fce00141801ff0972626827 @@ -0,0 +1,71 @@ +/** + * + */ +package darkknight.jewelrycraft.network; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import io.netty.buffer.ByteBuf; +import cpw.mods.fml.common.network.ByteBufUtils; +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.events.PlayerRenderHandler; +import darkknight.jewelrycraft.lib.Reference; +import darkknight.jewelrycraft.util.PlayerUtils; + +/** + * @author Sorin + * + */ +public class PacketSendCurseStats implements IMessage, IMessageHandler +{ + public PacketSendCurseStats() + { + + } + + /** + * @param message + * @param ctx + * @return + */ + @Override + public IMessage onMessage(PacketSendCurseStats message, MessageContext ctx) + { + return null; + } + + /** + * @param buf + */ + @Override + public void fromBytes(ByteBuf buf) + { + String temp = ByteBufUtils.readUTF8String(buf); + if (temp != "") + PlayerRenderHandler.greedCache = temp.split(";"); + else + PlayerRenderHandler.greedCache = new String[] { }; + } + + /** + * @param buf + */ + @Override + public void toBytes(ByteBuf buf) + { + Iterator players = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator(); + String greedPlayers = ""; + while (players.hasNext()) + { + EntityPlayer current = players.next(); + if(PlayerUtils.getModPlayerPersistTag(current, "Jewelrycraft").getInteger(Reference.MODNAME + ":" + "Infamy") > 0) + greedPlayers = greedPlayers + (greedPlayers == "" ? "" : ";") + current.getDisplayName(); + } + ByteBufUtils.writeUTF8String(buf, greedPlayers); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/d05049b984c600141066cb38d875561a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/d05049b984c600141066cb38d875561a new file mode 100644 index 0000000..c8973fc --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/d05049b984c600141066cb38d875561a @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.PlayerUtils; + +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); + // 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(); + } + } + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + {} + + @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, "Jewelrycraft"); + if (jewelry instanceof ItemNecklace && pos != -1 && rand.nextInt(4) == 0 && 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 * 4F); + // Negative earrings + if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); + } + + @Override + public boolean onPlayerFall(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/f0b55b69bad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/f0b55b69bad000141b65e2fc7f94332d new file mode 100644 index 0000000..e6c65f2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/f0b55b69bad000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, x, y + 10); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/70917207bed000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/70917207bed000141b65e2fc7f94332d new file mode 100644 index 0000000..eed8072 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/70917207bed000141b65e2fc7f94332d @@ -0,0 +1,125 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + + case 5: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 5", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 5; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/10212e1abbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/10212e1abbd000141b65e2fc7f94332d new file mode 100644 index 0000000..0f5e172 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/10212e1abbd000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/4032699bb8d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/4032699bb8d000141b65e2fc7f94332d new file mode 100644 index 0000000..f3ba846 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/4032699bb8d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() + x, gui.getTop() + y); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/f01d11859ad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/f01d11859ad000141b65e2fc7f94332d new file mode 100644 index 0000000..e158ba9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/f01d11859ad000141b65e2fc7f94332d @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabModifiers extends GuiTab +{ + int maxPages; + public GuiTabModifiers(int id) + { + super("Modifiers", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.blaze_powder); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all of modifiers that have a use and what they do, in the form of a story/riddle/poem. However different jewellery have different effects for the same modifier."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 2: + text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.blaze_powder), text, 40f); + break; + case 3: + text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Be aware, against an arrow you can't compare. Fire is your enemy and weakness is the penalty."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.feather), text, 40f); + break; + case 4: + text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.ender_eye), text, 40f); + break; + } + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return 4; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/f0af8c117acf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/f0af8c117acf00141de78e4a85bb2469 new file mode 100644 index 0000000..b3a4f19 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/f0af8c117acf00141de78e4a85bb2469 @@ -0,0 +1,101 @@ +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; + +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("jewelrycraft", "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(texture); + 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); + count++; + } + } + 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(4, 4 + (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.glColor4f(1f, 1f, 1f, 1.0f); + GL11.glPushMatrix(); + mc.renderEngine.bindTexture(hearts); + count = 0; + 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/c4/40367889a5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40367889a5ce00141801ff0972626827 new file mode 100644 index 0000000..11f3e6f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40367889a5ce00141801ff0972626827 @@ -0,0 +1,446 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((ItemBaseJewelry)item.getItem()).action(item, player); + } + if (!player.worldObj.isRemote){ + 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 + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); + } + 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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/c4/b048e39fb8d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/b048e39fb8d000141b65e2fc7f94332d new file mode 100644 index 0000000..ffcbc88 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/b048e39fb8d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, x, y); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/7013ae1e85d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/7013ae1e85d000141a1fb02abca5ff55 new file mode 100644 index 0000000..f13988b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/7013ae1e85d000141a1fb02abca5ff55 @@ -0,0 +1,79 @@ +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) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && rand.nextInt(500) == 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) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/e0433f2d7dcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/e0433f2d7dcf00141de78e4a85bb2469 new file mode 100644 index 0000000..c823133 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/e0433f2d7dcf00141de78e4a85bb2469 @@ -0,0 +1,221 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.registry.GameData; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.events.EntityEventHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; + +public class JewelrycraftUtil +{ + public static ArrayList objects = new ArrayList(); + public static ArrayList gem = new ArrayList(); + public static ArrayList jewelry = new ArrayList(); + public static ArrayList metal = new ArrayList(); + public static ArrayList ores = new ArrayList(); + public static HashMap oreToIngot = new HashMap(); + public static ArrayList jamcraftPlayers = new ArrayList(); + public static Random rand = new Random(); + + /** + * Adds gems and jewelry to their appropriate list + */ +// public static void addStuff() + { + // Jewels + for(int i = 0; i < 16; i++) + gem.add(new ItemStack(ItemList.crystal, 1, i)); + gem.add(new ItemStack(Blocks.redstone_block)); + gem.add(new ItemStack(Blocks.lapis_block)); + gem.add(new ItemStack(Blocks.obsidian)); + gem.add(new ItemStack(Items.diamond)); + gem.add(new ItemStack(Items.emerald)); + gem.add(new ItemStack(Items.ender_pearl)); + gem.add(new ItemStack(Items.nether_star)); + // Jewelry + jewelry.add(new ItemStack(ItemList.ring)); + jewelry.add(new ItemStack(ItemList.necklace)); + jewelry.add(new ItemStack(ItemList.bracelet)); + jewelry.add(new ItemStack(ItemList.earrings)); + for(Object item: GameData.getItemRegistry()){ + ArrayList items = new ArrayList(); + if (((Item)item).getHasSubtypes()) ((Item)item).getSubItems((Item)item, null, items); + else objects.add(new ItemStack((Item)item)); + + if (!items.isEmpty()) objects.addAll(items); + } + } + + /** + * Adds curse points to a player + * + * @param player the player to add the points to + * @param points amount of curse points + */ + public static void addCursePoints(EntityPlayer player, int points) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + playerInfo.setInteger("cursePoints", playerInfo.hasKey("cursePoints") ? (playerInfo.getInteger("cursePoints") + points) : points); + playerInfo.setBoolean("playerCursePointsChanged", true); + } + + public static int getCursePoints(EntityPlayer player) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + return playerInfo.getInteger("cursePoints"); + } + + /** + * Adds the UUID's of the jamcrafters in a list + */ + public static void jamcrafters() + { + jamcraftPlayers.add("d3214311-7550-4c9c-a372-d9292c10b8a6"); + jamcraftPlayers.add("a690119f-c4a2-4bd6-a99d-d63679abb328"); + jamcraftPlayers.add("de7c9903-51fa-4a24-88cd-48faf122ca36"); + jamcraftPlayers.add("70aeb298-3a7b-46da-a393-ab10df9359f2"); + jamcraftPlayers.add("6fbe603c-14bf-4085-afdd-abe592c26e7c"); + jamcraftPlayers.add("b0d21306-36bf-4d85-84df-a956d183c45a"); + jamcraftPlayers.add("1733a31f-01f9-4f4d-82aa-7de30ca810d3"); + jamcraftPlayers.add("4833eacf-1d94-49a7-9f89-4cf88d69dcf9"); + jamcraftPlayers.add("718cf671-9084-4e78-b91f-033e80aa11bf"); + jamcraftPlayers.add("bea5e0c4-85c4-454d-a081-e1eaae6895ee"); + jamcraftPlayers.add("7ecf3e2f-fedf-4f7e-8d24-6731d078db4f"); + jamcraftPlayers.add("1b11ad3a-f0ca-4695-a019-2d7e5d83a5fd"); + jamcraftPlayers.add("3ec9ac58-2f1b-4d3f-b4eb-3b875da877ae"); + jamcraftPlayers.add("cf9fa23f-205e-4eed-aba3-9f2848cd6a4d"); + jamcraftPlayers.add("91880caa-b032-48e3-bfe8-c2c7ed31824e"); + jamcraftPlayers.add("8d0b3804-f71c-4219-897b-8c315448ea7c"); + jamcraftPlayers.add("bbb87dbe-690f-4205-bdc5-72ffb8ebc29d"); + } + + /** + * Adds a random amount of modifiers to a list + * + * @param randValue maximum number of modifiers + * @return a list containing the random modifiers + */ + public static ArrayList addRandomModifiers(int randValue) + { + ArrayList list = new ArrayList(); + for(int i = 0; i < 2 + randValue; i++){ + ItemStack item = objects.get(new Random().nextInt(objects.size())); + item.stackSize = 1 + new Random().nextInt(2); + list.add(item); + } + return list; + } + + /** + * Links ores with their appropriate ingot + */ + public static void addMetals() + { + int index = 0; + while (index < OreDictionary.getOreNames().length){ + Iterator i = OreDictionary.getOres(OreDictionary.getOreNames()[index]).iterator(); + while (i.hasNext()){ + ItemStack nextStack = i.next(); + if ((nextStack.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || nextStack.getItem().getUnlocalizedName().toLowerCase().contains("alloy")) && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("powder") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("dust") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("block") && !metal.contains(nextStack)){ + metal.add(nextStack); + if (OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")) != null){ + ores.addAll(OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore"))); + Iterator ores = OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")).iterator(); + while (ores.hasNext()){ + ItemStack ore = ores.next(); + oreToIngot.put(ore.getItem(), nextStack); + } + } + } + } + index++; + } + } + + /** + * Checks to see if the specified item is a gem + * + * @param item ItemStack containing the item + * @return is the item a gem + */ + public static boolean isGem(ItemStack item) + { + Iterator i = gem.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is a metal + * + * @param item ItemStack containing the item + * @return is the item a metal + */ + public static boolean isMetal(ItemStack item) + { + Iterator i = metal.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is a piece of jewelry + * + * @param item ItemStack containing the item + * @return is the item a piece of jewelry + */ + public static boolean isJewelry(ItemStack item) + { + Iterator i = jewelry.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is an ore + * + * @param item ItemStack containing the item + * @return is the item an ore + */ + public static boolean isOre(ItemStack item) + { + Iterator i = ores.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Gets the ingot from the ore + * + * @param ore the ore + * @return the ingot + */ + public static ItemStack getIngotFromOre(Item ore) + { + return oreToIngot.get(ore); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/10dc615fbed000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/10dc615fbed000141b65e2fc7f94332d new file mode 100644 index 0000000..ad31253 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/10dc615fbed000141b65e2fc7f94332d @@ -0,0 +1,240 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + // GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if (xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if (Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/70f09d1c7acf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/70f09d1c7acf00141de78e4a85bb2469 new file mode 100644 index 0000000..9e5b9eb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/70f09d1c7acf00141de78e4a85bb2469 @@ -0,0 +1,102 @@ +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; + +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("jewelrycraft", "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(texture); + 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); + count++; + } + } + 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(4, 4 + (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.glColor4f(1f, 1f, 1f, 1.0f); + GL11.glPushMatrix(); + 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/c7/802694e3b6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/802694e3b6d000141b65e2fc7f94332d new file mode 100644 index 0000000..ea68151 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/802694e3b6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 140, 150, 30, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/d0ba6178bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/d0ba6178bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..407f05b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/d0ba6178bbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 180, -90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 90, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/0088d4467ecf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/0088d4467ecf00141de78e4a85bb2469 new file mode 100644 index 0000000..40ca209 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/0088d4467ecf00141de78e4a85bb2469 @@ -0,0 +1,187 @@ +/* + * 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.commands.JewelrycraftCommands; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.container.GuiHandler; +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.lib.Reference; +import darkknight.jewelrycraft.network.PacketClearColorCache; +import darkknight.jewelrycraft.network.PacketKeyPressEvent; +import darkknight.jewelrycraft.network.PacketRequestLiquidData; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; +import darkknight.jewelrycraft.network.PacketSendCurseStats; +import darkknight.jewelrycraft.network.PacketSendLiquidData; +import darkknight.jewelrycraft.network.PacketSendPlayerInfo; +import darkknight.jewelrycraft.recipes.CraftingRecipes; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +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 = Reference.MODID, name = Reference.MODNAME, version = Reference.VERSION) +public class JewelrycraftMod +{ + @Instance (Reference.MODID) + public static JewelrycraftMod instance; + @SidedProxy (clientSide = "darkknight.jewelrycraft.client.ClientProxy", serverSide = "darkknight.jewelrycraft.CommonProxy") + public static CommonProxy proxy; + public static final Logger logger = Logger.getLogger("Jewelrycraft"); + public static File dir; + public static CreativeTabs jewelrycraft = new CreativeTabs("JewelryCraft"){ + @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; + public static final int MAX_CURSES = 10; + + /** + * 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, "Jewelrycraft: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("DarkKnight (or sor1n)"); + authorList.add("bspkrs"); + authorList.add("domi1819"); + + dir = e.getModConfigurationDirectory(); + proxy.preInit(); + netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.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); + metadata.autogenerated = false; + metadata.authorList = authorList; + metadata.url = "https://github.com/sor1n/Jewelrycraft"; + + createEntity(EntityHeart.class, "Heart", 0x000000, 0xFF0000, true); + createEntity(EntityHalfHeart.class, "Half-Heart", 0x000000, 0xFF0000, true); + +// 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.addStuff(); + JewelrycraftUtil.jamcrafters(); + EffectsList.postInit(e); + DamageSourceList.postInit(e); + } + + @Mod.EventHandler + public void serverLoad(FMLServerStartingEvent event) + { + event.registerServerCommand(new JewelrycraftCommands()); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/10b07e76a4ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/10b07e76a4ce00141801ff0972626827 new file mode 100644 index 0000000..ff9bdb5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/10b07e76a4ce00141801ff0972626827 @@ -0,0 +1,436 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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); + } + System.out.println(entity); + if (entity.motionX == 0D && entity.motionY == 0D && entity.motionZ == 0D) 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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/c9/f0711f27a7ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/f0711f27a7ce00141801ff0972626827 new file mode 100644 index 0000000..9150146 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/f0711f27a7ce00141801ff0972626827 @@ -0,0 +1,111 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + NBTTagCompound enemyData = target.getEntityData(); + if (jewelry instanceof ItemRing && pos != -1){ + target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F); + if (target instanceof EntityPlayer){ + NBTTagCompound enemyInfo = PlayerUtils.getModPlayerPersistTag((EntityPlayer)target, "Jewelrycraft"); + enemyInfo.setInteger("reAttacked", enemyInfo.getInteger("reAttacked") + 1); + if (rand.nextInt(2) == 0){ + enemyInfo.setInteger("stunTime", 50); + enemyInfo.setBoolean("stunned", true); + } + }else if (enemyData.getInteger("reAttacked") == 0){ + enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1); + 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, "Jewelrycraft"); + 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/ca/509abef6f38a00141c1cba3f7039360c b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/509abef6f38a00141c1cba3f7039360c new file mode 100644 index 0000000..f085488 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/509abef6f38a00141c1cba3f7039360c @@ -0,0 +1,617 @@ +package darkknight.jewelrycraft.util; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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 jewel + * The jewel you want to add on the item + */ + public static void addJewel(ItemStack item, ItemStack jewel) + { + if (jewel != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound jewelNBT = new NBTTagCompound(); + jewel.writeToNBT(jewelNBT); + itemStackData.setTag("jewel", jewelNBT); + } + } + + /** + * + * @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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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); + } + + public static void addJewelColor(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("jewelColor", color); + itemStackData.setTag("jewelColor", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + public static boolean isJewelX(ItemStack stack, ItemStack jewel) + { + if (jewel(stack) != null && jewel(stack).getItem() == jewel.getItem() && jewel(stack).getItemDamage() == jewel.getItemDamage()) return true; + return false; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack jewel(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewel")) + { + NBTTagCompound jewelNBT = (NBTTagCompound) stack.getTagCompound().getTag("jewel"); + ItemStack jewel = new ItemStack(Item.getItemById(0), 0, 0); + jewel.readFromNBT(jewelNBT); + return jewel; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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"); + int[] col = {color, 142323, 213552}; + return col[new Random().nextInt(3)]; + } + return 16777215; + } + + public static int jewelColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewelColor")) + { + NBTTagCompound colors = (NBTTagCompound) stack.getTagCompound().getTag("jewelColor"); + int color = colors.getInteger("jewelColor"); + return color; + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/f037376012cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/f037376012cf00141c41f52413db5e31 new file mode 100644 index 0000000..008410a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/f037376012cf00141c41f52413db5e31 @@ -0,0 +1,88 @@ +package darkknight.jewelrycraft.curses; + +import java.util.ArrayList; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class Curse +{ + protected int id, texturepack; + protected String name, description; + private static ArrayList curses = new ArrayList(); + public static ArrayList availableCurses = new ArrayList(); + + /** + * @param id the ID of the curse + * @param name the name of the curse + * @param texturepack the ID of the pack the texture is located in + */ + protected Curse(int id, String name, int texturepack) + { + this.id = id; + this.name = name; + this.texturepack = texturepack; + curses.add(this); + availableCurses.add(this); + } + + /** + * @return the name of the curse + */ + public String getName() + { + return name; + } + + /** + * @return the description of the curse + */ + public String getDescription() + { + return description; + } + + public Curse setDescription(String desc) + { + description = desc; + return this; + } + + /** + * @return the curse ID + */ + public int getID() + { + return id; + } + + /** + * @return the texture pack ID + */ + public int getTexturePack() + { + return texturepack; + } + + /** + * @param world + * @param player + */ + public void action(World world, EntityPlayer player) + {} + + public void deathAction(World world, EntityPlayer player) + {} + + public boolean itemToss() + { + return false; + } + + /** + * @return + */ + public static ArrayList getCurseList() + { + return curses; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/c0eb4d77b9d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/c0eb4d77b9d000141b65e2fc7f94332d new file mode 100644 index 0000000..c32655f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/c0eb4d77b9d000141b65e2fc7f94332d @@ -0,0 +1,233 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(25.0F, -1.0F, 0.0F, 0.0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/10c08f90b7d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/10c08f90b7d000141b65e2fc7f94332d new file mode 100644 index 0000000..1c7c5be --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/10c08f90b7d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 25, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/600bf435bdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/600bf435bdd000141b65e2fc7f94332d new file mode 100644 index 0000000..df50bb3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/600bf435bdd000141b65e2fc7f94332d @@ -0,0 +1,125 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + + case 5: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 1), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + break; + } + } + + @Override + public int getMaxPages() + { + return 5; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/80d5ff84bed000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/80d5ff84bed000141b65e2fc7f94332d new file mode 100644 index 0000000..3226599 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/80d5ff84bed000141b65e2fc7f94332d @@ -0,0 +1,241 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))){ + GL11.glScalef(0.2F, 0.2F, 0.2F); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0F, 0.1F, 0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + // GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if (xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if (Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/b0a79825a3ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/b0a79825a3ce00141801ff0972626827 new file mode 100644 index 0000000..da7c0f8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/b0a79825a3ce00141801ff0972626827 @@ -0,0 +1,435 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D); + entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1); + if(entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false); + } + if (entity instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)entity; + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/ce/70b3113c6fcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/70b3113c6fcf00141de78e4a85bb2469 new file mode 100644 index 0000000..bf94dc6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/70b3113c6fcf00141de78e4a85bb2469 @@ -0,0 +1,39 @@ +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.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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)){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + if(playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if(player.getMaxHealth() >= 3F) player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/802d6c7d12cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/802d6c7d12cf00141c41f52413db5e31 new file mode 100644 index 0000000..73e8701 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/802d6c7d12cf00141c41f52413db5e31 @@ -0,0 +1,97 @@ +package darkknight.jewelrycraft.curses; + +import java.util.ArrayList; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class Curse +{ + protected int id, texturepack; + protected String name, description; + private static ArrayList curses = new ArrayList(); + public static ArrayList availableCurses = new ArrayList(); + + /** + * @param id the ID of the curse + * @param name the name of the curse + * @param texturepack the ID of the pack the texture is located in + */ + protected Curse(int id, String name, int texturepack) + { + this.id = id; + this.name = name; + this.texturepack = texturepack; + curses.add(this); + availableCurses.add(this); + } + + /** + * @return the name of the curse + */ + public String getName() + { + return name; + } + + /** + * @return the description of the curse + */ + public String getDescription() + { + return description; + } + + public Curse setDescription(String desc) + { + description = desc; + return this; + } + + /** + * @return the curse ID + */ + public int getID() + { + return id; + } + + /** + * @return the texture pack ID + */ + public int getTexturePack() + { + return texturepack; + } + + /** + * @param world + * @param player + */ + public void action(World world, EntityPlayer player) + {} + + public void deathAction(World world, EntityPlayer player) + {} + + public void respawnAction(World world, EntityPlayer player) + {} + + public void attackedAction(World world, EntityPlayer player) + {} + + public void attackedByPlayerAction(World world, EntityPlayer player) + {} + + public boolean itemToss() + { + return false; + } + + /** + * @return + */ + public static ArrayList getCurseList() + { + return curses; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/e02d96277ecf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/e02d96277ecf00141de78e4a85bb2469 new file mode 100644 index 0000000..ff732a4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/e02d96277ecf00141de78e4a85bb2469 @@ -0,0 +1,187 @@ +/* + * 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.commands.JewelrycraftCommands; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.container.GuiHandler; +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.lib.Reference; +import darkknight.jewelrycraft.network.PacketClearColorCache; +import darkknight.jewelrycraft.network.PacketKeyPressEvent; +import darkknight.jewelrycraft.network.PacketRequestLiquidData; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; +import darkknight.jewelrycraft.network.PacketSendCurseStats; +import darkknight.jewelrycraft.network.PacketSendLiquidData; +import darkknight.jewelrycraft.network.PacketSendPlayerInfo; +import darkknight.jewelrycraft.recipes.CraftingRecipes; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +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 = Reference.MODID, name = Reference.MODNAME, version = Reference.VERSION) +public class JewelrycraftMod +{ + @Instance (Reference.MODID) + public static JewelrycraftMod instance; + @SidedProxy (clientSide = "darkknight.jewelrycraft.client.ClientProxy", serverSide = "darkknight.jewelrycraft.CommonProxy") + public static CommonProxy proxy; + public static final Logger logger = Logger.getLogger("Jewelrycraft"); + public static File dir; + public static CreativeTabs jewelrycraft = new CreativeTabs("JewelryCraft"){ + @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; + public static final int MAX_CURSES = 10; + + /** + * 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, "Jewelrycraft: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("DarkKnight (or sor1n)"); + authorList.add("bspkrs"); + authorList.add("domi1819"); + + dir = e.getModConfigurationDirectory(); + proxy.registerRenderers(); + netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.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); + metadata.autogenerated = false; + metadata.authorList = authorList; + metadata.url = "https://github.com/sor1n/Jewelrycraft"; + + createEntity(EntityHeart.class, "Heart", 0x000000, 0xFF0000, true); + createEntity(EntityHalfHeart.class, "Half-Heart", 0x000000, 0xFF0000, true); + +// 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.addStuff(); + JewelrycraftUtil.jamcrafters(); + EffectsList.postInit(e); + DamageSourceList.postInit(e); + } + + @Mod.EventHandler + public void serverLoad(FMLServerStartingEvent event) + { + event.registerServerCommand(new JewelrycraftCommands()); + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/20ce60e681d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/20ce60e681d000141a1fb02abca5ff55 new file mode 100644 index 0000000..387e18f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/20ce60e681d000141a1fb02abca5ff55 @@ -0,0 +1,66 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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.DamageSource; +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 +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1) Minecraft.getMinecraft().gameSettings.renderDistanceChunks = 0; + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/406be580bed000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/406be580bed000141b65e2fc7f94332d new file mode 100644 index 0000000..f7a4b53 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/406be580bed000141b65e2fc7f94332d @@ -0,0 +1,240 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))){ + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0F, 0.1F, 0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + // GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if (xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if (Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/306fef1113cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/306fef1113cf00141c41f52413db5e31 new file mode 100644 index 0000000..4975634 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/306fef1113cf00141c41f52413db5e31 @@ -0,0 +1,235 @@ +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 ItemBaseJewelry extends Item +{ + public ItemBaseJewelry() + { + super(); + setMaxStackSize(1); + setCreativeTab(JewelrycraftMod.jewelrycraft); + } + + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly (Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + try{ + return color(stack, pass); + } + catch(IOException e){ + e.printStackTrace(); + } + return 16777215; + } + + /** + * @param stack + * @param pass + * @return + * @throws IOException + */ + public static int color(ItemStack stack, int pass) throws IOException + { + IResourceManager rm = Minecraft.getMinecraft().getResourceManager(); + BufferedImage icon; + if (pass == 0 && stack != null && JewelryNBT.ingot(stack) != null && Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) > 0 && JewelryNBT.ingot(stack).getIconIndex() != null && JewelryNBT.ingotColor(stack) == 16777215){ + ItemStack ingot = JewelryNBT.ingot(stack); + icon = ImageIO.read(rm.getResource(getLocation(ingot, stack, true)).getInputStream()); + int height = icon.getHeight(); + int width = icon.getWidth(); + Map m = new HashMap(); + for(int i = 0; i < width; i++) + for(int j = 0; j < height; j++){ + int rgb = icon.getRGB(i, j); + int red = rgb >> 16 & 0xff; + int green = rgb >> 8 & 0xff; + int blue = rgb & 0xff; + int[] rgbArr = {red, green, blue}; + int Cmax = Math.max(red, Math.max(green, blue)); + int Cmin = Math.min(red, Math.min(green, blue)); + if (!isGray(rgbArr)) m.put(rgb, (Cmax + Cmin) / 2); + } + int color = getMostCommonColour(m); + if (JewelryNBT.ingot(stack) != null && JewelryNBT.ingot(stack).getItem().getColorFromItemStack(JewelryNBT.ingot(stack), 1) != 16777215) JewelryNBT.addIngotColor(stack, JewelryNBT.ingot(stack).getItem().getColorFromItemStack(JewelryNBT.ingot(stack), 1)); + else JewelryNBT.addIngotColor(stack, color); + }else if (pass == 1 && stack != null && JewelryNBT.gem(stack) != null && JewelryNBT.gem(stack).getIconIndex() != null && JewelryNBT.gem(stack) != null){ + ItemStack gem = JewelryNBT.gem(stack); + icon = ImageIO.read(rm.getResource(getLocation(gem, stack, true)).getInputStream()); + int height = icon.getHeight(); + int width = icon.getWidth(); + Map m = new HashMap(); + for(int i = 0; i < width; i++) + for(int j = 0; j < height; j++){ + int rgb = icon.getRGB(i, j); + int red = rgb >> 16 & 0xff; + int green = rgb >> 8 & 0xff; + int blue = rgb & 0xff; + int[] rgbArr = {red, green, blue}; + int Cmax = Math.max(red, Math.max(green, blue)); + int Cmin = Math.min(red, Math.min(green, blue)); + if (!isGray(rgbArr)) m.put(rgb, (Cmax + Cmin) / 2); + } + int color = getMostCommonColour(m); + if (JewelryNBT.gem(stack).getItem().getColorFromItemStack(JewelryNBT.gem(stack), 1) == 16777215) JewelryNBT.addGemColor(stack, color); + else JewelryNBT.addGemColor(stack, JewelryNBT.gem(stack).getItem().getColorFromItemStack(JewelryNBT.gem(stack), 1)); + } + if (pass == 0 && JewelryNBT.ingot(stack) != null) return JewelryNBT.ingotColor(stack); + if (pass == 1 && JewelryNBT.gem(stack) != null) return JewelryNBT.gemColor(stack); + else if (JewelryNBT.ingot(stack) != null) return JewelryNBT.ingotColor(stack); + return 16777215; + } + + /** + * @param item + * @param stack + * @param changeMeta + * @return + */ + public static ResourceLocation getLocation(ItemStack item, ItemStack stack, boolean changeMeta) + { + String domain = ""; + String texture; + if (changeMeta && (Item.getIdFromItem(item.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(item.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(item.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(item.getItem()) == Block.getIdFromBlock(Blocks.carpet))) item.setItemDamage(15 - item.getItemDamage()); + IIcon itemIcon = item.getItem().getIcon(item, 0); + String iconName = itemIcon.getIconName(); + if (iconName.substring(0, iconName.indexOf(":") + 1) != "") domain = iconName.substring(0, iconName.indexOf(":") + 1).replace(":", " ").trim(); + else domain = "minecraft"; + texture = iconName.substring(iconName.lastIndexOf(":") + 1) + ".png"; + ResourceLocation textureLocation = null; + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); + if (texturemanager.getResourceLocation(item.getItemSpriteNumber()).toString().contains("items")) textureLocation = new ResourceLocation(domain.toLowerCase(), "textures/items/" + texture); + else textureLocation = new ResourceLocation(domain.toLowerCase(), "textures/blocks/" + texture); + return textureLocation; + } + + /** + * @param map + * @return + */ + public static int getMostCommonColour(Map map) + { + List list = new LinkedList(map.entrySet()); + Collections.sort(list, new Comparator(){ + public int compare(Object o1, Object o2) + { + return ((Comparable)((Map.Entry)o1).getValue()).compareTo(((Map.Entry)o2).getValue()); + } + }); + Map.Entry me = (Map.Entry)list.get(list.size() - 1); + for(int i = 0; i < list.size(); i++){ + float alpha = Float.valueOf(list.get(i).toString().split("=")[1]); + if (alpha < 180) me = (Map.Entry)list.get(i); + } + int rgb = (Integer)me.getKey(); + return rgb; + } + + /** + * @param rgbArr + * @return + */ + public static boolean isGray(int[] rgbArr) + { + int rgbSum = rgbArr[0] + rgbArr[1] + rgbArr[2]; + if (rgbSum > 0 && rgbSum < 256 * 3) return false; + return true; + } + + /** + * @param stack + * @return + */ + 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(); + } + + /** + * allows items to add custom lines of information to the mouseover description. + * + * @param stack + * @param player + * @param list + * @param par4 + */ + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if (stack.hasTagCompound() && par4){ + ItemStack ingot = JewelryNBT.ingot(stack); + if (ingot != null && Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) > 0) list.add("Ingot: " + EnumChatFormatting.YELLOW + ingot.getDisplayName()); + ItemStack gem = JewelryNBT.gem(stack); + if (gem != null) list.add("Gem: " + EnumChatFormatting.BLUE + gem.getDisplayName()); + ArrayList modifier = JewelryNBT.modifier(stack); + if (!modifier.isEmpty()) list.add("Modifiers: "); + for(int i = 0; i < modifier.size(); i++) + list.add(EnumChatFormatting.DARK_PURPLE + modifier.get(i).getDisplayName() + " x" + modifier.get(i).stackSize); + } + } + + /** + * @param stack + * @param player + */ + public void action(ItemStack stack, EntityPlayer player) + { + for(ModifierEffects mod: ModifierEffects.getEffects()) + mod.action(stack, player, this); + } + + /** + * @param item + * @param player + * @param source + * @return + */ + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, float amount) + { + for(ModifierEffects mod: ModifierEffects.getEffects()) mod.onPlayerAttacked(item, player, source, this, amount); + } + + /** + * @param item + * @param player + * @param target + * @return + */ + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, float amount) + { + for(ModifierEffects mod: ModifierEffects.getEffects()) mod.onEntityAttacked(item, player, target, this, amount); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/c001ded384d000141a1fb02abca5ff55 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/c001ded384d000141a1fb02abca5ff55 new file mode 100644 index 0000000..40654fd --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/c001ded384d000141a1fb02abca5ff55 @@ -0,0 +1,79 @@ +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) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && !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 && pos != -1 && rand.nextInt(50) == 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 ore around you.")); + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/40e36e70b9d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/40e36e70b9d000141b65e2fc7f94332d new file mode 100644 index 0000000..23f0f27 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/40e36e70b9d000141b65e2fc7f94332d @@ -0,0 +1,233 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + if(ItemStack.areItemStacksEqual(item, new ItemStack(Blocks.light_weighted_pressure_plate, 1, 0)))GL11.glRotatef(25.0F, -1.0F, 0.0F, 0.0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/80bf6f449bd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/80bf6f449bd000141b65e2fc7f94332d new file mode 100644 index 0000000..eef17bf --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/80bf6f449bd000141b65e2fc7f94332d @@ -0,0 +1,12 @@ +/** + * + */ +package darkknight.jewelrycraft.container; + +/** + * @author Sorin + * + */ +public class GuiTabIntroduction +{ +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/c054e7fab5d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/c054e7fab5d000141b65e2fc7f94332d new file mode 100644 index 0000000..9bf6158 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/c054e7fab5d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 145, 150, 35, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 9 && mouseX <= x + 19 && mouseY >= y + 19 && mouseY <= y + 30) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/60ad6fa0bcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/60ad6fa0bcd000141b65e2fc7f94332d new file mode 100644 index 0000000..b9cb84c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/60ad6fa0bcd000141b65e2fc7f94332d @@ -0,0 +1,245 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + GL11.glEnable(GL11.GL_LIGHT1); + RenderHelper.disableStandardItemLighting(); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/d07706722f9300141384bdd0ca2744d8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/d07706722f9300141384bdd0ca2744d8 new file mode 100644 index 0000000..4156b12 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/d07706722f9300141384bdd0ca2744d8 @@ -0,0 +1,659 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import darkknight.jewelrycraft.item.ItemRing; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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); + if (itemStackData.hasKey("gemNumber")) itemStackData.setInteger("gemNumber", itemStackData.getInteger("gemNumber") + 1); + else itemStackData.setInteger("gemNumber", 1); + int no = itemStackData.getInteger("gemNumber"); + itemStackData.setTag("gem" + no, 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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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 + public static void addGemColor(ItemStack item, int color, int indice) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound colors = new NBTTagCompound(); + colors.setInteger("gemColor" + indice, color); + System.out.println("gemColor" + indice + " Color: " + color); + itemStackData.setTag("gemColors", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + 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; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack gem(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems.get(new Random().nextInt(gems.size())); + } + return null; + } + + public static ArrayList gems(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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 + public static int gemColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()) + { + NBTTagCompound color = (NBTTagCompound) stack.getTagCompound().getTag("gemColors"); + if (stack.getTagCompound().hasKey("gemNumber")) + { + ArrayList colors = new ArrayList(); + int no = stack.getTagCompound().getInteger("gemNumber"); + for (int i = 1; i <= no; i++) + { + int col = color.getInteger("gemColor" + i); + colors.add(col); + } + int prevColor = colors.get(0); + if(new Random().nextInt(1) == 0) prevColor = colors.get(new Random().nextInt(colors.size())); + return prevColor; + } + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/d0b060aabcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/d0b060aabcd000141b65e2fc7f94332d new file mode 100644 index 0000000..bce53b6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/d0b060aabcd000141b65e2fc7f94332d @@ -0,0 +1,246 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + GL11.glEnable(GL11.GL_LIGHT1); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHT1); + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/303797fd70cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/303797fd70cf00141de78e4a85bb2469 new file mode 100644 index 0000000..776a6e8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/303797fd70cf00141de78e4a85bb2469 @@ -0,0 +1,41 @@ +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (rand.nextInt(5) == 0 && !world.isRemote && !(target instanceof EntityMob) && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && target.canAttackWithItem()){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if (player.getMaxHealth() >= 3F){ + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + player.setHealth(player.getHealth() - 2.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/a098cba6bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/a098cba6bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..1e2ce65 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/a098cba6bbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/8057ba46b6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/8057ba46b6d000141b65e2fc7f94332d new file mode 100644 index 0000000..221db97 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/8057ba46b6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 145, 150, 35, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 10, gui.getTop() + 20); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f0ef569c3fcf001411138789b9e67617 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f0ef569c3fcf001411138789b9e67617 new file mode 100644 index 0000000..6845bba --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f0ef569c3fcf001411138789b9e67617 @@ -0,0 +1,74 @@ +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.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; + +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 + player.extinguish(); + + //Negative for necklace + if (player.isInWater()) player.attackEntityFrom(DamageSource.drown, 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; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/40e71d74a5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/40e71d74a5ce00141801ff0972626827 new file mode 100644 index 0000000..1943439 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/40e71d74a5ce00141801ff0972626827 @@ -0,0 +1,446 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + 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 + entity.height, 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/d9/10f9057570cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/10f9057570cf00141de78e4a85bb2469 new file mode 100644 index 0000000..3eabae1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/10f9057570cf00141de78e4a85bb2469 @@ -0,0 +1,23 @@ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class CurseFlamingSoul extends Curse +{ + public CurseFlamingSoul(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void action(World world, EntityPlayer player) + { + if (!player.isBurning() && rand.nextInt(20) == 0) player.setFire(60); + } + + public String getDescription() + { + return "Is it me or is it getting hot in here?"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/20879a0e7ccf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/20879a0e7ccf00141de78e4a85bb2469 new file mode 100644 index 0000000..8754e8f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/20879a0e7ccf00141de78e4a85bb2469 @@ -0,0 +1,78 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class GuiTabGemsAndIngots extends GuiTab +{ + + /** + * @param id + */ + public GuiTabGemsAndIngots(int id) + { + super("Gems and ingots", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.emerald); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + for(int i = (page - 1) * 9; i < page * 9; i++) + if (i < JewelrycraftUtil.objects.size()){ + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Gems", gui.getLeft() + xPos + 40, gui.getTop(), 0); + gui.renderItem(JewelrycraftUtil.gem.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f); + gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.gem.get(i).getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + page -= JewelrycraftUtil.gem.size() / 9 + 1; + for(int i = (page - 1) * 9; i < page * 9; i++) + if (i < JewelrycraftUtil.metal.size() && page > 0){ + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ingots", gui.getLeft() + xPos + 40, gui.getTop(), 0); + gui.renderItem(JewelrycraftUtil.metal.get(i).copy(), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f); + gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.metal.get(i).copy().getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return JewelrycraftUtil.objects.size() / 9 + JewelrycraftUtil.metal.size() / 9 + 2; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/30ea349dbbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/30ea349dbbd000141b65e2fc7f94332d new file mode 100644 index 0000000..afd9dd3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/30ea349dbbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/80e1e997f2cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/80e1e997f2cf0014170de422db399e8d new file mode 100644 index 0000000..770960c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/80e1e997f2cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); + if (chunkposition != null && chunkposition.chunkPosX != player.posX && chunkposition.chunkPosZ != player.posZ){ + Minecraft.getMinecraft().thePlayer.motionX -= 0.01D*Math.signum((double)chunkposition.chunkPosX); + Minecraft.getMinecraft().thePlayer.motionZ -= 0.01D*Math.signum((double)chunkposition.chunkPosZ); + System.out.println(chunkposition.chunkPosX + " " + player.posX); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/80c6ef06b6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/80c6ef06b6d000141b65e2fc7f94332d new file mode 100644 index 0000000..a1b1a49 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/80c6ef06b6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 145, 150, 35, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 30 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/7040acbf14cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/7040acbf14cf00141c41f52413db5e31 new file mode 100644 index 0000000..0d6e167 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/7040acbf14cf00141c41f52413db5e31 @@ -0,0 +1,453 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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(player.worldObj, player); + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + 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); + // int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + 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()); + // if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/de/007d82c399d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/007d82c399d000141b65e2fc7f94332d new file mode 100644 index 0000000..dd6da36 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/007d82c399d000141b65e2fc7f94332d @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabModifiers extends GuiTab +{ + int maxPages; + public GuiTabModifiers(int id) + { + super("Modifiers", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.blaze_powder); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + maxPages = 0; + switch(page) + { + case 1: + text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all of modifiers that have a use and what they do, in the form of a story/riddle/poem. However different jewellery have different effects for the same modifier."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + maxPages++; + break; + case 2: + text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.blaze_powder), text, 40f); + maxPages++; + break; + case 3: + text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Be aware, against an arrow you can't compare. Fire is your enemy and weakness is the penalty."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.feather), text, 40f); + maxPages++; + break; + } + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return maxPages; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/307fa52624cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/307fa52624cf00141c41f52413db5e31 new file mode 100644 index 0000000..f869530 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/307fa52624cf00141c41f52413db5e31 @@ -0,0 +1,99 @@ +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; + +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("jewelrycraft", "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(texture); + 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); + count++; + } + } + 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(4, 4 + (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.glColor4f(1f, 1f, 1f, 1.0f); + mc.renderEngine.bindTexture(hearts); + count = 0; + 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); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/4010cd0b71cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/4010cd0b71cf00141de78e4a85bb2469 new file mode 100644 index 0000000..f46605a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/4010cd0b71cf00141de78e4a85bb2469 @@ -0,0 +1,41 @@ +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (rand.nextInt(3) == 0 && !world.isRemote && !(target instanceof EntityMob) && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && target.canAttackWithItem()){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if (player.getMaxHealth() >= 3F){ + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + player.setHealth(player.getHealth() - 1.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/d0e62fdca5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/d0e62fdca5ce00141801ff0972626827 new file mode 100644 index 0000000..9e8ca39 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/d0e62fdca5ce00141801ff0972626827 @@ -0,0 +1,448 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + playerInfo.setBoolean("stunned", true); + playerInfo.setInteger("stunTime", 50); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/e4/a0630cfe22cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/a0630cfe22cf00141c41f52413db5e31 new file mode 100644 index 0000000..52599de --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/a0630cfe22cf00141c41f52413db5e31 @@ -0,0 +1,459 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/e5/c04fd795a3d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/c04fd795a3d000141b65e2fc7f94332d new file mode 100644 index 0000000..992d88e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/c04fd795a3d000141b65e2fc7f94332d @@ -0,0 +1,68 @@ +package darkknight.jewelrycraft.events; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +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.lib.Reference; +import darkknight.jewelrycraft.model.ModelMask; +import darkknight.jewelrycraft.tileentity.renders.MaskRender; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class PlayerRenderHandler +{ + ModelMask maskModel = new ModelMask(); + public static MaskRender mask = new MaskRender(); + + public static String[] infamyCache = new String[] {}; + + @SubscribeEvent + public void renderScreen(RenderPlayerEvent.Specials.Post event) + { + if (infamyCache != null) + { + Iterator players = event.entityPlayer.worldObj.playerEntities.iterator(); + + while(players.hasNext()) + { + EntityPlayer player = players.next(); + 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(); + } + } + } + } + + /** + * @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/e7/50b3265a70cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/50b3265a70cf00141de78e4a85bb2469 new file mode 100644 index 0000000..48140ea --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/50b3265a70cf00141de78e4a85bb2469 @@ -0,0 +1,463 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + playerInfo.setFloat("BlueHeart", 0f); + playerInfo.setFloat("BlackHeart", 0f); + playerInfo.setFloat("WhiteHeart", 0f); + JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/e7/600fcefeb6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/600fcefeb6d000141b65e2fc7f94332d new file mode 100644 index 0000000..aee8381 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/600fcefeb6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 10, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/3080ffd383c600141066cb38d875561a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/3080ffd383c600141066cb38d875561a new file mode 100644 index 0000000..b65f8b4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/3080ffd383c600141066cb38d875561a @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.PlayerUtils; + +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); + // 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(); + } + } + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + {} + + @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, "Jewelrycraft"); + if (jewelry instanceof ItemNecklace && pos != -1 && rand.nextInt(4) == 0){ + player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You evaded an attack!")); + 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 * 6F); + // Negative earrings + if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); + } + + @Override + public boolean onPlayerFall(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/7006558fa4ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/7006558fa4ce00141801ff0972626827 new file mode 100644 index 0000000..62ed599 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/7006558fa4ce00141801ff0972626827 @@ -0,0 +1,436 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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); + System.out.println(entity); + } + if (entity.motionX == 0D && entity.motionY == 0D && entity.motionZ == 0D) 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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/ea/d02f62a6b8d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/d02f62a6b8d000141b65e2fc7f94332d new file mode 100644 index 0000000..b010b1a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/d02f62a6b8d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, x, y - 20); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/104b1fe0b6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/104b1fe0b6d000141b65e2fc7f94332d new file mode 100644 index 0000000..abfc4a1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/104b1fe0b6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 145, 150, 30, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/20010f43a5ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/20010f43a5ce00141801ff0972626827 new file mode 100644 index 0000000..d9be141 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/20010f43a5ce00141801ff0972626827 @@ -0,0 +1,102 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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; + +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, "Jewelrycraft"); + // 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.setAIMoveSpeed(player.getAIMoveSpeed() / 2); + player.fallDistance = 0F; + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/ec/103c252f6a8700141aabd4ca4d39309b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/103c252f6a8700141aabd4ca4d39309b new file mode 100644 index 0000000..cbb36e9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/103c252f6a8700141aabd4ca4d39309b @@ -0,0 +1,248 @@ +package darkknight.jewelrycraft.tileentity; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +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 net.minecraft.world.World; +import darkknight.jewelrycraft.block.BlockHandPedestal; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.particles.EntityShadowsFX; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class TileEntityShadowEye extends TileEntity +{ + public int opening, timer, t = 20; + public boolean active; + public int field_145926_a; + public float field_145933_i; + public float field_145931_j; + public float field_145930_m; + public float field_145927_n; + public Map pedestalItems = new HashMap(); + + public TileEntityShadowEye() + { + this.opening = 1; + this.timer = 20; + this.active = false; + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + nbt.setInteger("opening", opening); + nbt.setInteger("timer", timer); + nbt.setBoolean("active", active); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + this.opening = nbt.getInteger("opening"); + this.timer = nbt.getInteger("timer"); + this.active = nbt.getBoolean("active"); + } + + @Override + public void updateEntity() + { + super.updateEntity(); + boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata); + if (active) timer--; + addData(worldObj, xCoord, yCoord, zCoord); + try + { + for(String l:pedestalItems.keySet()) + { + String[] loc = l.split("/"); + ItemStack obj = ((TileEntityHandPedestal)worldObj.getTileEntity(Integer.valueOf(loc[0]), Integer.valueOf(loc[1]), Integer.valueOf(loc[2]))).object.copy(); + System.out.println(" " + pedestalItems.get(l)); + } + } + catch(Exception e) + { + //System.out.println(e); + } + if (opening == 4 && timer <= 0) active = false; + if (!active && timer <= 0 && opening != 1) + { + if (t > 0) t--; + if (t <= 0){ + opening--; + t = 20; + } + } + if (active && timer <= 0) + { + if (opening < 4) + { + opening++; + timer = 20; + } + if (valid && opening == 4) timer = 200; + else if(!valid){ + active = false; + timer = -1; + } + } + EntityPlayer player1 = this.worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 7F); + if (player1 != null) + { + NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player1, "Jewelrycraft"); + 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, 1.0F, 1.0F, 0.0F, 0.04F - 0.01F * i)); + + 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 = this.worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 6F); + if (player != null) + { + NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + persistTag.setBoolean("nearStartedRitual", true); + } + } + } + + 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; + } + + public void addData(World world, int x, int y, int z) + { + pedestalItems.clear(); + addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z)); + 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)); + } + + public void addPedestalInfo(TileEntityHandPedestal pedestal) + { + ItemStack object = new ItemStack(Item.getItemById(2), 0, 0); + object = pedestal.object; + if(pedestal != null) pedestalItems.put((pedestal.xCoord + "/" + pedestal.yCoord + "/" + pedestal.zCoord).toString(), object); + } + + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound); + } + + @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/ec/20d3910bbdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/20d3910bbdd000141b65e2fc7f94332d new file mode 100644 index 0000000..e45417c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/20d3910bbdd000141b65e2fc7f94332d @@ -0,0 +1,242 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/e0847d256fcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/e0847d256fcf00141de78e4a85bb2469 new file mode 100644 index 0000000..549f956 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/e0847d256fcf00141de78e4a85bb2469 @@ -0,0 +1,37 @@ +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.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.PlayerUtils; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(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){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (rand.nextInt(2) == 0){ + if(playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if(player.getMaxHealth() >= 3F) player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + } + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/508104ffb9d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/508104ffb9d000141b65e2fc7f94332d new file mode 100644 index 0000000..e569381 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/508104ffb9d000141b65e2fc7f94332d @@ -0,0 +1,232 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/90284a44bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/90284a44bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..39f2329 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/90284a44bbd000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/d0e63671bcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/d0e63671bcd000141b65e2fc7f94332d new file mode 100644 index 0000000..349eb74 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/d0e63671bcd000141b65e2fc7f94332d @@ -0,0 +1,238 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/90de6b157dcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/90de6b157dcf00141de78e4a85bb2469 new file mode 100644 index 0000000..b50b132 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/90de6b157dcf00141de78e4a85bb2469 @@ -0,0 +1,221 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.registry.GameData; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.events.EntityEventHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; + +public class JewelrycraftUtil +{ + public static ArrayList objects = new ArrayList(); + public static ArrayList gem = new ArrayList(); + public static ArrayList jewelry = new ArrayList(); + public static ArrayList metal = new ArrayList(); + public static ArrayList ores = new ArrayList(); + public static HashMap oreToIngot = new HashMap(); + public static ArrayList jamcraftPlayers = new ArrayList(); + public static Random rand = new Random(); + + /** + * Adds gems and jewelry to their appropriate list + */ + public static void addStuff() + { + // Jewels + for(int i = 0; i < 16; i++) + gem.add(new ItemStack(ItemList.crystal, 1, i)); + gem.add(new ItemStack(Blocks.redstone_block)); + gem.add(new ItemStack(Blocks.lapis_block)); + gem.add(new ItemStack(Blocks.obsidian)); + gem.add(new ItemStack(Items.diamond)); + gem.add(new ItemStack(Items.emerald)); + gem.add(new ItemStack(Items.ender_pearl)); + gem.add(new ItemStack(Items.nether_star)); + // Jewelry + jewelry.add(new ItemStack(ItemList.ring)); + jewelry.add(new ItemStack(ItemList.necklace)); + jewelry.add(new ItemStack(ItemList.bracelet)); + jewelry.add(new ItemStack(ItemList.earrings)); + for(Object item: GameData.getItemRegistry()){ + ArrayList items = new ArrayList(); + if (((Item)item).getHasSubtypes()) ((Item)item).getSubItems((Item)item, null, items); + else objects.add(new ItemStack((Item)item)); + + if (!items.isEmpty()) objects.addAll(items); + } + } + + /** + * Adds curse points to a player + * + * @param player the player to add the points to + * @param points amount of curse points + */ + public static void addCursePoints(EntityPlayer player, int points) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + playerInfo.setInteger("cursePoints", playerInfo.hasKey("cursePoints") ? (playerInfo.getInteger("cursePoints") + points) : points); + playerInfo.setBoolean("playerCursePointsChanged", true); + } + + public static int getCursePoints(EntityPlayer player) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + return playerInfo.getInteger("cursePoints"); + } + + /** + * Adds the UUID's of the jamcrafters in a list + */ + public static void jamcrafters() + { + jamcraftPlayers.add("d3214311-7550-4c9c-a372-d9292c10b8a6"); + jamcraftPlayers.add("a690119f-c4a2-4bd6-a99d-d63679abb328"); + jamcraftPlayers.add("de7c9903-51fa-4a24-88cd-48faf122ca36"); + jamcraftPlayers.add("70aeb298-3a7b-46da-a393-ab10df9359f2"); + jamcraftPlayers.add("6fbe603c-14bf-4085-afdd-abe592c26e7c"); + jamcraftPlayers.add("b0d21306-36bf-4d85-84df-a956d183c45a"); + jamcraftPlayers.add("1733a31f-01f9-4f4d-82aa-7de30ca810d3"); + jamcraftPlayers.add("4833eacf-1d94-49a7-9f89-4cf88d69dcf9"); + jamcraftPlayers.add("718cf671-9084-4e78-b91f-033e80aa11bf"); + jamcraftPlayers.add("bea5e0c4-85c4-454d-a081-e1eaae6895ee"); + jamcraftPlayers.add("7ecf3e2f-fedf-4f7e-8d24-6731d078db4f"); + jamcraftPlayers.add("1b11ad3a-f0ca-4695-a019-2d7e5d83a5fd"); + jamcraftPlayers.add("3ec9ac58-2f1b-4d3f-b4eb-3b875da877ae"); + jamcraftPlayers.add("cf9fa23f-205e-4eed-aba3-9f2848cd6a4d"); + jamcraftPlayers.add("91880caa-b032-48e3-bfe8-c2c7ed31824e"); + jamcraftPlayers.add("8d0b3804-f71c-4219-897b-8c315448ea7c"); + jamcraftPlayers.add("bbb87dbe-690f-4205-bdc5-72ffb8ebc29d"); + } + + /** + * Adds a random amount of modifiers to a list + * + * @param randValue maximum number of modifiers + * @return a list containing the random modifiers + */ + public static ArrayList addRandomModifiers(int randValue) + { + ArrayList list = new ArrayList(); + for(int i = 0; i < 2 + randValue; i++){ + ItemStack item = objects.get(new Random().nextInt(objects.size())); + item.stackSize = 1 + new Random().nextInt(2); + list.add(item); + } + return list; + } + + /** + * Links ores with their appropriate ingot + */ + public static void addMetals() + { + int index = 0; + while (index < OreDictionary.getOreNames().length){ + Iterator i = OreDictionary.getOres(OreDictionary.getOreNames()[index]).iterator(); + while (i.hasNext()){ + ItemStack nextStack = i.next(); + if ((nextStack.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || nextStack.getItem().getUnlocalizedName().toLowerCase().contains("alloy")) && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("powder") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("dust") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("block") && !metal.contains(nextStack)){ + metal.add(nextStack); + if (OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")) != null){ + ores.addAll(OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore"))); + Iterator ores = OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")).iterator(); + while (ores.hasNext()){ + ItemStack ore = ores.next(); + oreToIngot.put(ore.getItem(), nextStack); + } + } + } + } + index++; + } + } + + /** + * Checks to see if the specified item is a gem + * + * @param item ItemStack containing the item + * @return is the item a gem + */ + public static boolean isGem(ItemStack item) + { + Iterator i = gem.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is a metal + * + * @param item ItemStack containing the item + * @return is the item a metal + */ + public static boolean isMetal(ItemStack item) + { + Iterator i = metal.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is a piece of jewelry + * + * @param item ItemStack containing the item + * @return is the item a piece of jewelry + */ + public static boolean isJewelry(ItemStack item) + { + Iterator i = jewelry.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is an ore + * + * @param item ItemStack containing the item + * @return is the item an ore + */ + public static boolean isOre(ItemStack item) + { + Iterator i = ores.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Gets the ingot from the ore + * + * @param ore the ore + * @return the ingot + */ + public static ItemStack getIngotFromOre(Item ore) + { + return oreToIngot.get(ore); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/d0c544f1bdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/d0c544f1bdd000141b65e2fc7f94332d new file mode 100644 index 0000000..dd63fd1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/d0c544f1bdd000141b65e2fc7f94332d @@ -0,0 +1,237 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.1F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/208abec412cf00141c41f52413db5e31 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/208abec412cf00141c41f52413db5e31 new file mode 100644 index 0000000..8ee0c9b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/208abec412cf00141c41f52413db5e31 @@ -0,0 +1,57 @@ +package darkknight.jewelrycraft.effects; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; + +public abstract class ModifierEffects +{ + protected ItemStack modifier; + protected Random rand = new Random(); + protected static ArrayList effects = new ArrayList(); + + /** + * @param modifier + */ + public ModifierEffects(ItemStack modifier) + { + this.modifier = modifier; + effects.add(this); + } + + /** + * @return + */ + public static ArrayList getEffects() + { + return effects; + } + + /** + * @param item + * @param player + * @param jewelry + */ + public abstract void action(ItemStack item, EntityPlayer player, Item jewelry); + /** + * @param item + * @param player + * @param target + * @param jewelry + * @return + */ + public abstract void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount); + + /** + * @param item + * @param player + * @param source + * @param jewelry + * @return + */ + public abstract void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount); +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/10a6e789b7d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/10a6e789b7d000141b65e2fc7f94332d new file mode 100644 index 0000000..cd0101c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/10a6e789b7d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f08cc33785c600141066cb38d875561a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f08cc33785c600141066cb38d875561a new file mode 100644 index 0000000..59376e0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f08cc33785c600141066cb38d875561a @@ -0,0 +1,86 @@ +package darkknight.jewelrycraft.effects; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +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.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.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.PlayerUtils; + +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); + // 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(); + } + } + } + } + + @Override + public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } + + @Override + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) + {} + + @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, "Jewelrycraft"); + 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! " + source.damageType)); + 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 * 4F); + // Negative earrings + if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F); + } + + @Override + public boolean onPlayerFall(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + return false; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f0d537e7bdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f0d537e7bdd000141b65e2fc7f94332d new file mode 100644 index 0000000..1f59387 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f0d537e7bdd000141b65e2fc7f94332d @@ -0,0 +1,237 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(-0.2F, 0F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/70f21455bdd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/70f21455bdd000141b65e2fc7f94332d new file mode 100644 index 0000000..1cf2647 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/70f21455bdd000141b65e2fc7f94332d @@ -0,0 +1,125 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + + case 5: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 5; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/f043f225a4ce00141801ff0972626827 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/f043f225a4ce00141801ff0972626827 new file mode 100644 index 0000000..5e2818b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/f043f225a4ce00141801ff0972626827 @@ -0,0 +1,435 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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); + } + } + + /** + * @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); +// } + if (entity.motionX == 0D && entity.motionY == 0D && entity.motionZ == 0D && entity.rotationPitch == entity.prevRotationPitch && entity.rotationYaw == entity.prevRotationYaw) 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, "Jewelrycraft"); + playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender); + for(int i = 0; i < 18; i++) + if (playerInfo.hasKey("ext" + i)){ + NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i); + ItemStack item = ItemStack.loadItemStackFromNBT(nbt); + ((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 <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) 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.getInteger(Reference.MODNAME + ":" + "Infamy") > 0) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + // 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, "Jewelrycraft"); + 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)); + } + } + } + }else if (event.source.getEntity() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.source.getEntity(); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + 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); + } + } + } + + /** + * @param event + */ + @SubscribeEvent + public void onPlayerRespawn(PlayerEvent.Clone event) + { + EntityPlayer player = event.entityPlayer; + if (!player.worldObj.isRemote){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++) + if (points > (i - 1) * 750) addCurse(player, playerInfo, i); + if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){ + playerInfo.setInteger("curseTime", 23000); + playerInfo.setBoolean("reselectCurses", false); + } + } + } + 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); +// int grade = 1 + player.worldObj.rand.nextInt(2); + playerInfo.setInteger(cur.getName(), 1); + Curse.availableCurses.remove(cur); + } + } + + 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); + } + } + + @SubscribeEvent + public void itemToss(ItemTossEvent event) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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()); + } + } + if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo()); +// if (!entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats()); + } + + /** + * @param event + */ + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) + { + if (!event.world.isRemote){ + new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/f3/00fc7df4b6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/00fc7df4b6d000141b65e2fc7f94332d new file mode 100644 index 0000000..07d0b63 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/00fc7df4b6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 155, 30, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/1004bc969bd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/1004bc969bd000141b65e2fc7f94332d new file mode 100644 index 0000000..97bba20 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/1004bc969bd000141b65e2fc7f94332d @@ -0,0 +1,44 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.item.ItemList; + +public class GuiTabIntroduction extends GuiTab +{ + public GuiTabIntroduction(int id) + { + super("Introduction", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(ItemList.ring); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Welcome to jewelrycraft!\nThis mod"; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/20259783bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/20259783bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..f319394 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/20259783bbd000141b65e2fc7f94332d @@ -0,0 +1,114 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 180, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/e09bcee7b6d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/e09bcee7b6d000141b65e2fc7f94332d new file mode 100644 index 0000000..72b6cde --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/e09bcee7b6d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 150, 150, 30, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/9037e8d8f2cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/9037e8d8f2cf0014170de422db399e8d new file mode 100644 index 0000000..1819aa0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/9037e8d8f2cf0014170de422db399e8d @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !player.worldObj.isRemote){ + ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); + if (chunkposition != null && chunkposition.chunkPosX != (int)player.posX && chunkposition.chunkPosZ != (int)player.posZ){ + Minecraft.getMinecraft().thePlayer.motionX -= 0.01D*Math.signum((double)chunkposition.chunkPosX); + Minecraft.getMinecraft().thePlayer.motionZ -= 0.01D*Math.signum((double)chunkposition.chunkPosZ); + System.out.println(chunkposition.chunkPosX + " " + chunkposition.chunkPosZ); +// player.addChatMessage(new ChatComponentText("You hear a faint whisper telling you: \"You are getting closer, just " + (int)player.getDistance((double)chunkposition.chunkPosX, (double)chunkposition.chunkPosY, (double)chunkposition.chunkPosZ) + " more blocks to go.\"")); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/c04a3dbcbcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/c04a3dbcbcd000141b65e2fc7f94332d new file mode 100644 index 0000000..ccb4bea --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/c04a3dbcbcd000141b65e2fc7f94332d @@ -0,0 +1,246 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + GL11.glEnable(GL11.GL_LIGHT1); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT1); + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + RenderHelper.enableStandardItemLighting(); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/7014dc552f9300141384bdd0ca2744d8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/7014dc552f9300141384bdd0ca2744d8 new file mode 100644 index 0000000..ff66288 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/7014dc552f9300141384bdd0ca2744d8 @@ -0,0 +1,658 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import darkknight.jewelrycraft.item.ItemRing; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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); + if (itemStackData.hasKey("gemNumber")) itemStackData.setInteger("gemNumber", itemStackData.getInteger("gemNumber") + 1); + else itemStackData.setInteger("gemNumber", 1); + int no = itemStackData.getInteger("gemNumber"); + itemStackData.setTag("gem" + no, 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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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 + public static void addGemColor(ItemStack item, int color, int indice) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound colors = new NBTTagCompound(); + colors.setInteger("gemColor" + indice, color); + itemStackData.setTag("gemColors", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + 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; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack gem(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems.get(new Random().nextInt(gems.size())); + } + return null; + } + + public static ArrayList gems(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) + { + int no = stack.getTagCompound().getInteger("gemNumber"); + ArrayList gems = new ArrayList(); + for (int i = 1; i <= no; i++) + { + NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); + ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); + gem.readFromNBT(gemNBT); + gems.add(gem); + } + return gems; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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 + public static int gemColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()) + { + NBTTagCompound color = (NBTTagCompound) stack.getTagCompound().getTag("gemColors"); + if (stack.getTagCompound().hasKey("gemNumber")) + { + ArrayList colors = new ArrayList(); + int no = stack.getTagCompound().getInteger("gemNumber"); + for (int i = 1; i <= no; i++) + { + int col = color.getInteger("gemColor" + i); + colors.add(col); + } + int prevColor = colors.get(0); + if(new Random().nextInt(1) == 0) prevColor = colors.get(new Random().nextInt(colors.size())); + return prevColor; + } + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/80d09401b7d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/80d09401b7d000141b65e2fc7f94332d new file mode 100644 index 0000000..7534d78 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/80d09401b7d000141b65e2fc7f94332d @@ -0,0 +1,197 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 30); + if(item.getItem() != null){ + name.add(item.getDisplayName()); + if (mouseX >= x + 10 && mouseX <= x + 25 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, gui.getLeft() - 20, gui.getTop() + 15); + name.removeAll(name); + } + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + if(item.getItem() != null) gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/10660ab09ad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/10660ab09ad000141b65e2fc7f94332d new file mode 100644 index 0000000..ac47a51 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/10660ab09ad000141b65e2fc7f94332d @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabModifiers extends GuiTab +{ + int maxPages; + public GuiTabModifiers(int id) + { + super("Modifiers", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(Items.blaze_powder); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all of modifiers that have a use and what they do, in the form of a story/riddle/poem. However different jewellery have different effects for the same modifier."; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + case 2: + text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.blaze_powder), text, 40f); + break; + case 3: + text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Against an arrow you can't compare, so move around, don't just stare. Fire is your enemy and weakness is the penalty."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.feather), text, 40f); + break; + case 4: + text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere."; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.ender_eye), text, 40f); + break; + } + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return 4; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/106b4a6bf48a00141c1cba3f7039360c b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/106b4a6bf48a00141c1cba3f7039360c new file mode 100644 index 0000000..b00d94c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/106b4a6bf48a00141c1cba3f7039360c @@ -0,0 +1,617 @@ +package darkknight.jewelrycraft.util; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +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.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 jewel + * The jewel you want to add on the item + */ + public static void addJewel(ItemStack item, ItemStack jewel) + { + if (jewel != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound jewelNBT = new NBTTagCompound(); + jewel.writeToNBT(jewelNBT); + itemStackData.setTag("jewel", jewelNBT); + } + } + + /** + * + * @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 addModifier(ItemStack item, ItemStack modifier) + { + if (modifier != null) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound modifierNBT = new NBTTagCompound(); + modifier.writeToNBT(modifierNBT); + itemStackData.setTag("modifier", modifierNBT); + } + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } + + 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()); + } + + 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); + } + + public static void addJewelColor(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("jewelColor", color); + itemStackData.setTag("jewelColor", colors); + } + + @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 + 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); + } + + public static void removeEntity(ItemStack item) + { + JewelryNBT.removeNBT(item, "entityID"); + JewelryNBT.removeNBT(item, "entity"); + JewelryNBT.removeNBT(item, "ench"); + } + + 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 + 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; + } + + public static boolean isJewelX(ItemStack stack, ItemStack jewel) + { + if (jewel(stack) != null && jewel(stack).getItem() == jewel.getItem() && jewel(stack).getItemDamage() == jewel.getItemDamage()) return true; + return false; + } + + public static boolean isModifierX(ItemStack stack, ItemStack modifier) + { + if (modifier(stack) != null && modifier(stack).getItem() == modifier.getItem() && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; + return false; + } + + public static boolean isModifierEffectType(ItemStack stack) + { + if (modifier(stack) != null && (isModifierX(stack, new ItemStack(Items.blaze_powder)) || isModifierX(stack, new ItemStack(Items.sugar)) || isModifierX(stack, new ItemStack(Items.iron_pickaxe)) || isModifierX(stack, new ItemStack(Items.feather)) || isModifierX(stack, new ItemStack(Items.potionitem, 1, 8270)))) return true; + return false; + } + + 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; + } + + public static boolean isModeX(ItemStack stack, String modeN) + { + if (modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + + 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; + } + + public static boolean isDimNameX(ItemStack stack, String dimName) + { + if (ingot(stack) != null && dimName(stack).equals(dimName)) return true; + return false; + } + + 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 + + public static ItemStack jewel(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewel")) + { + NBTTagCompound jewelNBT = (NBTTagCompound) stack.getTagCompound().getTag("jewel"); + ItemStack jewel = new ItemStack(Item.getItemById(0), 0, 0); + jewel.readFromNBT(jewelNBT); + return jewel; + } + return null; + } + + public static ItemStack modifier(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) + { + NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); + ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); + modifier.readFromNBT(modifierNBT); + return modifier; + } + return null; + } + + 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; + } + + 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; + } + + 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) TileEntity.createAndLoadEntity(tileNBT); + if (tile != null && tile instanceof TileEntity) + { + tile.readFromNBT(tileNBT); + return tile; + } + else return null; + } + return null; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static int jewelColor(ItemStack stack) + { + if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewelColor")) + { + NBTTagCompound colors = (NBTTagCompound) stack.getTagCompound().getTag("jewelColor"); + int color = colors.getInteger("jewelColor"); + int[] col = {color, 15532663, 1114319}; + return col[new Random().nextInt(3)]; + } + return 16777215; + } + + @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 i = 0; i < entityID.length; i++) + { + entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); + list.add(entity); + } + return list; + } + return null; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/9082ae46b4d000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/9082ae46b4d000141b65e2fc7f94332d new file mode 100644 index 0000000..f0a34e0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/9082ae46b4d000141b65e2fc7f94332d @@ -0,0 +1,195 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png"); + + /** + * @param gui + * @param x + * @param y + * @param isSmall + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + ArrayList name = new ArrayList(); + if (isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate); + for(int i = 1; i <= 4; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 2 * 22; + int posY = y + 26 + (i - 1) / 2 * 22; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 25); + }else{ + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); + gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate); + for(int i = 1; i <= 9; i++) + if (items.length > i && items[i] != null){ + int posX = x + 8 + (i - 1) % 3 * 19; + int posY = y + 22 + (i - 1) / 3 * 17; + gui.renderItem(items[i], posX, posY, 30f, rotate); + name.add(items[i].getDisplayName()); + if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + drawText(gui, text, x, y + 32); + GL11.glColor4f(1, 1, 1, 1); + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + * @param mouseX + * @param mouseY + * @param items + */ + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items) + { + ArrayList name = new ArrayList(); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52); + gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate); + name.add(items[0].getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate); + drawText(gui, text, x, y + 30); + GL11.glColor4f(1, 1, 1, 1); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13, y + 18, size, rotate); + drawText(gui, text, x - 2, y - (int)(250 / size)); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item) + { + ArrayList name = new ArrayList(); + GL11.glColor4f(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + gui.drawTexturedModalRect(x + 9, y + 21, 145, 150, 35, 30); + name.add(item.getDisplayName()); + if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 20, y + 18 + 10, 40f, false); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param item + * @param text + * @param size + * @param txtX + * @param txtY + * @param showName + * @param imgX + * @param imgY + */ + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate) + { + y += 5; + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0); + GL11.glColor4f(1, 1, 1, 1); + gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @param gui + * @param x + * @param y + * @param text + */ + public static void addTextPage(GuiGuide gui, int x, int y, String text) + { + y -= 25; + drawText(gui, text, x, y); + GL11.glColor4f(1, 1, 1, 1); + } + + /** + * @param gui + * @param text + * @param x + * @param y + */ + public static void drawText(GuiGuide gui, String text, int x, int y) + { + String[] s = text.split(" "); + String displayText = ""; + ArrayList textLines = new ArrayList(); + for(String element: s) + if ((displayText + element + " ").length() <= 24) displayText += element + " "; + else{ + textLines.add(displayText.trim()); + displayText = element + " "; + } + textLines.add(displayText.trim()); + for(int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/f00bc4107ecf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/f00bc4107ecf00141de78e4a85bb2469 new file mode 100644 index 0000000..623aca8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/f00bc4107ecf00141de78e4a85bb2469 @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.client; + +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.CommonProxy; +import darkknight.jewelrycraft.block.BlockList; +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.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.TileEntityMolder; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; +import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import darkknight.jewelrycraft.tileentity.renders.ItemRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender; +import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender; +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; + +public class ClientProxy extends CommonProxy +{ + @Override + public void registerRenderers() + { + ResourceLocation pedestalResourceLocation = new ResourceLocation("jewelrycraft", "textures/tileentities/BricksPedestal.png"); + TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation); + ResourceLocation shadowResourceLocation = new ResourceLocation("jewelrycraft", "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(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("jewelrycraft", "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("jewelrycraft", "textures/gui/curses.png"); + MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/10304e6cbcd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/10304e6cbcd000141b65e2fc7f94332d new file mode 100644 index 0000000..9e5a035 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/10304e6cbcd000141b65e2fc7f94332d @@ -0,0 +1,236 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/30327f097dcf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/30327f097dcf00141de78e4a85bb2469 new file mode 100644 index 0000000..a7e7f48 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/30327f097dcf00141de78e4a85bb2469 @@ -0,0 +1,222 @@ +package darkknight.jewelrycraft.util; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.registry.GameData; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.events.EntityEventHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; + +public class JewelrycraftUtil +{ + public static ArrayList objects = new ArrayList(); + public static ArrayList gem = new ArrayList(); + public static ArrayList jewelry = new ArrayList(); + public static ArrayList metal = new ArrayList(); + public static ArrayList ores = new ArrayList(); + public static HashMap oreToIngot = new HashMap(); + public static ArrayList jamcraftPlayers = new ArrayList(); + public static Random rand = new Random(); + + /** + * Adds gems and jewelry to their appropriate list + */ + public static void addStuff() + { + // Jewels + for(int i = 0; i < 16; i++) + gem.add(new ItemStack(ItemList.crystal, 1, i)); + gem.add(new ItemStack(Blocks.redstone_block)); + gem.add(new ItemStack(Blocks.lapis_block)); + gem.add(new ItemStack(Blocks.obsidian)); + gem.add(new ItemStack(Items.diamond)); + gem.add(new ItemStack(Items.emerald)); + gem.add(new ItemStack(Items.ender_pearl)); + gem.add(new ItemStack(Items.nether_star)); + // Jewelry + jewelry.add(new ItemStack(ItemList.ring)); + jewelry.add(new ItemStack(ItemList.necklace)); + jewelry.add(new ItemStack(ItemList.bracelet)); + jewelry.add(new ItemStack(ItemList.earrings)); + for(Object item: GameData.getItemRegistry()){ + ArrayList items = new ArrayList(); + if (((Item)item).getHasSubtypes()){ + for(int i = 0; i < ((Item)item).getMaxDamage(); i++) + items.add(new ItemStack((Item)item, 1, i)); + }else objects.add(new ItemStack((Item)item)); + if (!items.isEmpty()) objects.addAll(items); + } + } + + /** + * Adds curse points to a player + * + * @param player the player to add the points to + * @param points amount of curse points + */ + public static void addCursePoints(EntityPlayer player, int points) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + playerInfo.setInteger("cursePoints", playerInfo.hasKey("cursePoints") ? (playerInfo.getInteger("cursePoints") + points) : points); + playerInfo.setBoolean("playerCursePointsChanged", true); + } + + public static int getCursePoints(EntityPlayer player) + { + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + return playerInfo.getInteger("cursePoints"); + } + + /** + * Adds the UUID's of the jamcrafters in a list + */ + public static void jamcrafters() + { + jamcraftPlayers.add("d3214311-7550-4c9c-a372-d9292c10b8a6"); + jamcraftPlayers.add("a690119f-c4a2-4bd6-a99d-d63679abb328"); + jamcraftPlayers.add("de7c9903-51fa-4a24-88cd-48faf122ca36"); + jamcraftPlayers.add("70aeb298-3a7b-46da-a393-ab10df9359f2"); + jamcraftPlayers.add("6fbe603c-14bf-4085-afdd-abe592c26e7c"); + jamcraftPlayers.add("b0d21306-36bf-4d85-84df-a956d183c45a"); + jamcraftPlayers.add("1733a31f-01f9-4f4d-82aa-7de30ca810d3"); + jamcraftPlayers.add("4833eacf-1d94-49a7-9f89-4cf88d69dcf9"); + jamcraftPlayers.add("718cf671-9084-4e78-b91f-033e80aa11bf"); + jamcraftPlayers.add("bea5e0c4-85c4-454d-a081-e1eaae6895ee"); + jamcraftPlayers.add("7ecf3e2f-fedf-4f7e-8d24-6731d078db4f"); + jamcraftPlayers.add("1b11ad3a-f0ca-4695-a019-2d7e5d83a5fd"); + jamcraftPlayers.add("3ec9ac58-2f1b-4d3f-b4eb-3b875da877ae"); + jamcraftPlayers.add("cf9fa23f-205e-4eed-aba3-9f2848cd6a4d"); + jamcraftPlayers.add("91880caa-b032-48e3-bfe8-c2c7ed31824e"); + jamcraftPlayers.add("8d0b3804-f71c-4219-897b-8c315448ea7c"); + jamcraftPlayers.add("bbb87dbe-690f-4205-bdc5-72ffb8ebc29d"); + } + + /** + * Adds a random amount of modifiers to a list + * + * @param randValue maximum number of modifiers + * @return a list containing the random modifiers + */ + public static ArrayList addRandomModifiers(int randValue) + { + ArrayList list = new ArrayList(); + for(int i = 0; i < 2 + randValue; i++){ + ItemStack item = objects.get(new Random().nextInt(objects.size())); + item.stackSize = 1 + new Random().nextInt(2); + list.add(item); + } + return list; + } + + /** + * Links ores with their appropriate ingot + */ + public static void addMetals() + { + int index = 0; + while (index < OreDictionary.getOreNames().length){ + Iterator i = OreDictionary.getOres(OreDictionary.getOreNames()[index]).iterator(); + while (i.hasNext()){ + ItemStack nextStack = i.next(); + if ((nextStack.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || nextStack.getItem().getUnlocalizedName().toLowerCase().contains("alloy")) && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("powder") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("dust") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("block") && !metal.contains(nextStack)){ + metal.add(nextStack); + if (OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")) != null){ + ores.addAll(OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore"))); + Iterator ores = OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")).iterator(); + while (ores.hasNext()){ + ItemStack ore = ores.next(); + oreToIngot.put(ore.getItem(), nextStack); + } + } + } + } + index++; + } + } + + /** + * Checks to see if the specified item is a gem + * + * @param item ItemStack containing the item + * @return is the item a gem + */ + public static boolean isGem(ItemStack item) + { + Iterator i = gem.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is a metal + * + * @param item ItemStack containing the item + * @return is the item a metal + */ + public static boolean isMetal(ItemStack item) + { + Iterator i = metal.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is a piece of jewelry + * + * @param item ItemStack containing the item + * @return is the item a piece of jewelry + */ + public static boolean isJewelry(ItemStack item) + { + Iterator i = jewelry.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Checks to see if the specified item is an ore + * + * @param item ItemStack containing the item + * @return is the item an ore + */ + public static boolean isOre(ItemStack item) + { + Iterator i = ores.iterator(); + while (i.hasNext()){ + ItemStack temp = i.next(); + if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true; + } + return false; + } + + /** + * Gets the ingot from the ore + * + * @param ore the ore + * @return the ingot + */ + public static ItemStack getIngotFromOre(Item ore) + { + return oreToIngot.get(ore); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/80f0e254bed000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/80f0e254bed000141b65e2fc7f94332d new file mode 100644 index 0000000..c16c5be --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/80f0e254bed000141b65e2fc7f94332d @@ -0,0 +1,237 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.block.BlockShadowEye; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + if(xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); + if(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/602b84f79bd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/602b84f79bd000141b65e2fc7f94332d new file mode 100644 index 0000000..d4f56cb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/602b84f79bd000141b65e2fc7f94332d @@ -0,0 +1,44 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.item.ItemList; + +public class GuiTabIntroduction extends GuiTab +{ + public GuiTabIntroduction(int id) + { + super("Introduction", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(ItemList.ring); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + String text = ""; + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + text = "Welcome to Jewelrycraft 2! This mod is about making jewelry that you can modify to your own will. To find out how to create a jewelry, please consult the book and look at the Smelter block. To add modifiers to it you need to perform a ritual. To see how to do that"; + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/9020325670cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/9020325670cf00141de78e4a85bb2469 new file mode 100644 index 0000000..6a786a0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/9020325670cf00141de78e4a85bb2469 @@ -0,0 +1,459 @@ +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.lib.Reference; +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; + +/** + * 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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); + ((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 <= JewelrycraftMod.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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){ + int points = playerInfo.getInteger("cursePoints"); + for(int i = 1; i <= JewelrycraftMod.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); + 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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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 + "Jewelrycraft").mkdirs(); + JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "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, "Jewelrycraft"); + 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, "Jewelrycraft"); + 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/fb/906294ac70cf00141de78e4a85bb2469 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/906294ac70cf00141de78e4a85bb2469 new file mode 100644 index 0000000..f48cc4a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/906294ac70cf00141de78e4a85bb2469 @@ -0,0 +1,42 @@ +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; + +public class CurseInfamy extends Curse +{ + public CurseInfamy(int id, String name, int text) + { + super(id, name, text); + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if (rand.nextInt(5) == 0 && !world.isRemote && !(target instanceof EntityMob) && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && target.canAttackWithItem()){ + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); + if (playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); + if (player.getMaxHealth() >= 3F){ + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + player.setHealth(player.getHealth() - 1.0F); + } + player.setHealth(player.getHealth() - 1.0F); + JewelrycraftUtil.addCursePoints(player, 10); + } + } + + public String getDescription() + { + return "What have you done?!"; + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/00facaebbad000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/00facaebbad000141b65e2fc7f94332d new file mode 100644 index 0000000..a5ea8af --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/00facaebbad000141b65e2fc7f94332d @@ -0,0 +1,112 @@ +package darkknight.jewelrycraft.container; + +import org.lwjgl.opengl.GL11; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.GuiGuide; + +public class GuiTabRitual extends GuiTab +{ + public GuiTabRitual(int id) + { + super("Ritual", id); + } + + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.handPedestal); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + switch(page) + { + case 1: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + //Top + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0); + + //Left + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + //Bottom + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + //Right + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 2: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 3: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0); + + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0); + break; + + case 4: + Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30); + for(int i = -1; i < 10; i++) + for(int j = 0; j < 11; j++) + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 0, 0); + break; + } + } + + @Override + public int getMaxPages() + { + return 4; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/a0e56af6bbd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/a0e56af6bbd000141b65e2fc7f94332d new file mode 100644 index 0000000..ea40ffd --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/a0e56af6bbd000141b65e2fc7f94332d @@ -0,0 +1,235 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ +// GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + GL11.glRotatef(xRot, 1, 0, 0); + GL11.glRotatef(yRot, 0, 1, 0); + GL11.glRotatef(zRot, 0, 0, 1); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/40a89923f4cf0014170de422db399e8d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/40a89923f4cf0014170de422db399e8d new file mode 100644 index 0000000..339dd64 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/40a89923f4cf0014170de422db399e8d @@ -0,0 +1,62 @@ +package darkknight.jewelrycraft.effects; + +import net.minecraft.client.Minecraft; +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 cpw.mods.fml.relauncher.ReflectionHelper; +import darkknight.jewelrycraft.item.ItemEarrings; +import darkknight.jewelrycraft.item.ItemNecklace; +import darkknight.jewelrycraft.util.JewelryNBT; + +public class EffectEnderEye extends ModifierEffects +{ + public EffectEnderEye() + { + super(new ItemStack(Items.ender_eye)); + } + + @Override + public void action(ItemStack item, EntityPlayer player, Item jewelry) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); + if (jewelry instanceof ItemEarrings && pos != -1 && !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 && pos != -1 && !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); + } + } + } + + @Override + public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount) + { + int pos = JewelryNBT.doesModifierExist(item, modifier); +// if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/a0f1a1f6afd000141b65e2fc7f94332d b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/a0f1a1f6afd000141b65e2fc7f94332d new file mode 100644 index 0000000..8b62f5d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/a0f1a1f6afd000141b65e2fc7f94332d @@ -0,0 +1,244 @@ +package darkknight.jewelrycraft.client; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.container.GuiRectangle; +import darkknight.jewelrycraft.container.GuiTab; +import darkknight.jewelrycraft.container.GuiTabBlocks; +import darkknight.jewelrycraft.container.GuiTabGemsAndIngots; +import darkknight.jewelrycraft.container.GuiTabIntroduction; +import darkknight.jewelrycraft.container.GuiTabItems; +import darkknight.jewelrycraft.container.GuiTabModifiers; +import darkknight.jewelrycraft.container.GuiTabRitual; + +public class GuiGuide extends GuiContainer +{ + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; + + /** + * @param container + * @param world + * @param pageTex + * @param flipPageTex + */ + public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) + { + super(container); + page = 1; + rot = 0; + del = 0; + this.world = world; + tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)}; + activeTab = tabs[0]; + pageTexture = pageTex; + flippedPageTexture = flipPageTex; + } + + /** + * @param f + * @param i + * @param j + */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + { + nextHover = false; + prevHover = false; + if (del == 0) rot++; + del++; + if (del >= 2) del = 0; + Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180); + Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180); + for(GuiRectangle tab: tabs){ + int srcX = 24; + int sizeX = 19; + if (tab == activeTab){ + srcX += 38; + sizeX += 3; + }else if (tab.inRect(this, i, j)) srcX += 19; + tab.draw(this, srcX, 180, sizeX, 18); + } + if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){ + drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14); + nextHover = true; + } + if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){ + drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14); + prevHover = true; + } + activeTab.drawBackground(this, i, j, page); + activeTab.drawBackground(this, i, j, page + 1); + ArrayList text = new ArrayList(); + text.add(Integer.toString(page)); + drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + text.remove(Integer.toString(page)); + text.add(Integer.toString(page + 1)); + drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj); + for(int tab = 0; tab < tabs.length; tab++) + renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon()); + } + + /** + * @param x + * @param y + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) + { + activeTab.drawForeground(this, x, y, page); + activeTab.drawForeground(this, x, y, page + 1); + for(GuiTab tab: tabs) + tab.drawString(this, x, y, tab.getName()); + } + + /** + * @param x + * @param y + * @param button + */ + @Override + protected void mouseClicked(int x, int y, int button) + { + if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2; + else if (prevHover && page > 1) page -= 2; + activeTab.mouseClick(this, x, y, button); + for(GuiTab tab: tabs) + if (activeTab != tab) if (tab.inRect(this, x, y)){ + activeTab = tab; + page = 1; + break; + } + } + + /** + * @param item + * @param x + * @param y + * @param activeIcon + */ + public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) + { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4; + GL11.glTranslatef(x, y, 100); + float scale = 30F; + GL11.glScalef(-scale, scale, scale); + if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0); + if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){ + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + GL11.glRotatef(180F, 0F, 1F, 0F); + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + /** + * @param item + * @param x + * @param y + * @param scale + */ + public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate) + { + GL11.glPushMatrix(); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + entityitem.hoverStart = 0.0F; + GL11.glTranslatef(x, y, 100); + GL11.glScalef(-scale, scale, scale); + GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F); + if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); + else{ + GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0); + if(ItemStack.areItemStacksEqual(item, new ItemStack(Blocks.light_weighted_pressure_plate, 1, 0)))GL11.glRotatef(25.0F, -1.0F, 0.0F, 0.0F); + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + } + if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + else{ + RenderManager.instance.options.fancyGraphics = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.options.fancyGraphics = false; + } + if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)){ + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHTING); + } + GL11.glPopMatrix(); + } + + /** + * @return + */ + public int getLeft() + { + return guiLeft; + } + + /** + * @return + */ + public int getTop() + { + return guiTop; + } + + /** + * @return + */ + public FontRenderer getFont() + { + return fontRendererObj; + } + + /** + * @param lst + * @param x + * @param y + */ + @SuppressWarnings ("rawtypes") + public void drawHoverString(List lst, int x, int y) + { + drawHoveringText(lst, x, y, fontRendererObj); + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.location b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.location new file mode 100644 index 0000000..e2f3e5e Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.location differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.markers.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.markers.snap new file mode 100644 index 0000000..91d6c54 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.markers.snap differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.syncinfo.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.syncinfo.snap new file mode 100644 index 0000000..91d6c54 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.syncinfo.snap 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 new file mode 100644 index 0000000..f712cf9 Binary files /dev/null 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 new file mode 100644 index 0000000..17bcb2d Binary files /dev/null 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/2e/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/2e/history.index new file mode 100644 index 0000000..8340ff2 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/2e/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..caf21e6 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/7f/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/7f/history.index new file mode 100644 index 0000000..042f9cd Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/7f/history.index 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 new file mode 100644 index 0000000..523af06 Binary files /dev/null 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/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..f3b0bf8 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 new file mode 100644 index 0000000..8bca368 Binary files /dev/null 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/fe/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/fe/history.index new file mode 100644 index 0000000..9a49138 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/7d/96/fe/history.index 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 new file mode 100644 index 0000000..6f69b92 Binary files /dev/null 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/.location b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.location new file mode 100644 index 0000000..815f590 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.location 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 new file mode 100644 index 0000000..bbc6768 Binary files /dev/null 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/.markers.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers.snap new file mode 100644 index 0000000..91d6c54 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers.snap differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.syncinfo.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.syncinfo.snap new file mode 100644 index 0000000..91d6c54 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.syncinfo.snap 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 new file mode 100644 index 0000000..b90196e Binary files /dev/null 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/.indexes/history.version b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version new file mode 100644 index 0000000..25cb955 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index new file mode 100644 index 0000000..249d41a Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version new file mode 100644 index 0000000..6b2aaa7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap new file mode 100644 index 0000000..91d6c54 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/36.tree b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/36.tree new file mode 100644 index 0000000..d58b006 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/36.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 new file mode 100644 index 0000000..2daefb8 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/36.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/36.snap new file mode 100644 index 0000000..05fd643 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/36.snap differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/net.sf.jautodoc.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/net.sf.jautodoc.prefs new file mode 100644 index 0000000..2893eb0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/net.sf.jautodoc.prefs @@ -0,0 +1,8 @@ +add_todo=false +create_dummy_doc=false +eclipse.preferences.version=1 +filter_fields=false +filter_types=false +replacements=\n\n\nGets the\nSets the\nAdds the\nEdits the\nRemoves the\nInits the\nParses the\nCreates the\nBuilds the\nChecks if is\nPrints the\nChecks for\n\n\n +single_line_comment=false +use_internal_formatter=true diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.net.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.net.prefs new file mode 100644 index 0000000..2774420 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.net.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.core.net.hasMigrated=true 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 new file mode 100644 index 0000000..466d7f9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +#Sun Jun 05 18:58:07 CEST 2011 +version=1 +eclipse.preferences.version=1 +refresh.enabled=true diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.core.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.core.prefs new file mode 100644 index 0000000..9cbc3a1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.debug.core.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE=false diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs new file mode 100644 index 0000000..c068046 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs @@ -0,0 +1,12 @@ +Console.highWaterMark=88000 +Console.limitConsoleOutput=false +StringVariablePreferencePage=130,107,107,86, +eclipse.preferences.version=1 +org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=\r\n\r\n +org.eclipse.debug.ui.UseContextualLaunch=false +org.eclipse.debug.ui.inColor=0,128,0 +org.eclipse.debug.ui.switch_perspective_on_suspend=never +org.eclipse.debug.ui.user_view_bindings=\r\n\r\n\r\n\r\n\r\n\r\n +pref_state_memento.org.eclipse.debug.ui.DebugVieworg.eclipse.debug.ui.DebugView=\r\n +preferredDetailPanes=DefaultDetailPane\:DefaultDetailPane| +preferredTargets=default\:default| diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.epp.usagedata.gathering.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.epp.usagedata.gathering.prefs new file mode 100644 index 0000000..333b991 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.epp.usagedata.gathering.prefs @@ -0,0 +1,3 @@ +#Sun Jun 05 18:58:07 CEST 2011 +eclipse.preferences.version=1 +org.eclipse.epp.usagedata.gathering.enabled=false diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..d9d57a2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,311 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.classpathVariable.JRE_LIB=C\:/Program Files/Java/jdk1.7.0_71/jre/lib/rt.jar +org.eclipse.jdt.core.classpathVariable.JRE_SRC=C\:/Program Files/Java/jdk1.7.0_71/src.zip +org.eclipse.jdt.core.classpathVariable.JRE_SRCROOT= +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.codeComplete.visibilityCheck=enabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.deprecation=ignore +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=ignore +org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=16 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=17 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=17 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=0 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=9999 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=1 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=true +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true +org.eclipse.jdt.core.formatter.lineSplit=9999 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=0 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=false diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 0000000..5507262 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_VM_XML=\r\n\r\n\r\n\r\n\r\n\r\n\r\n 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 new file mode 100644 index 0000000..64475e3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,34 @@ +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_number_of_computers=19 +content_assist_proposals_background=255,255,255 +content_assist_proposals_foreground=0,0,0 +eclipse.preferences.version=1 +fontPropagated=true +formatter_profile=_Domi's Code Style +formatter_settings_version=12 +org.eclipse.jdt.internal.ui.navigator.layout=2 +org.eclipse.jdt.ui.cleanupprofiles=\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n +org.eclipse.jdt.ui.cleanupprofiles.version=2 +org.eclipse.jdt.ui.editor.tab.width= +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.formatterprofiles=\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n +org.eclipse.jdt.ui.formatterprofiles.version=12 +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoclocations.migrated=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.code_templates_migrated=true +org.eclipse.jdt.ui.text.custom_code_templates= +org.eclipse.jdt.ui.text.custom_templates= +org.eclipse.jdt.ui.text.templates_migrated=true +org.eclipse.jface.textfont=1|Courier New|10.0|0|WINDOWS|1|0|0|0|0|0|0|0|0|1|0|0|0|0|Courier New; +proposalOrderMigrated=true +spelling_locale_initialized=true +tabWidthPropagated=true +useAnnotationsPrefPage=true +useQuickDiffPrefPage=true diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jst.j2ee.webservice.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jst.j2ee.webservice.ui.prefs new file mode 100644 index 0000000..553bb96 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jst.j2ee.webservice.ui.prefs @@ -0,0 +1,2 @@ +areThereWebServices=false +eclipse.preferences.version=1 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs new file mode 100644 index 0000000..67b1d96 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.m2e.discovery.pref.projects= diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs new file mode 100644 index 0000000..43e97e4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +mylyn.attention.migrated=true diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.java.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.java.ui.prefs new file mode 100644 index 0000000..2a6fe50 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.java.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.mylyn.java.ui.run.count.3_10_0=1 +org.eclipse.mylyn.java.ui.run.count.3_1_0=1 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs new file mode 100644 index 0000000..8d462a6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.mylyn.monitor.activity.tracking.enabled.checked=true diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 0000000..5330e43 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +migrated.task.repositories.secure.store=true +org.eclipse.mylyn.tasks.ui.filters.nonmatching=true +org.eclipse.mylyn.tasks.ui.filters.nonmatching.encouraged=true diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.pde.api.tools.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000..d2ed603 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +knownEEFragments= diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.recommenders.completion.rcp.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.recommenders.completion.rcp.prefs new file mode 100644 index 0000000..4a424ef --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.recommenders.completion.rcp.prefs @@ -0,0 +1,3 @@ +completion_tips_seen=org.eclipse.recommenders.completion.rcp.tips.discovery\:org.eclipse.recommenders.subwords.rcp.tips.enableSubwords +eclipse.preferences.version=1 +sessionprocessors=org.eclipse.recommenders.calls.rcp.sessionprocessors.call;org.eclipse.recommenders.subwords.rcp.sessionprocessors.subwords;org.eclipse.recommenders.completion.rcp.sessionprocessors.tips;org.eclipse.recommenders.overrides.rcp.completion.processor;org.eclipse.recommenders.completion.rcp.sessionprocessors.baseRelevance diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.search.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.search.prefs new file mode 100644 index 0000000..cec65c4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.search.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.search.defaultPerspective=org.eclipse.search.defaultPerspective.none diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs new file mode 100644 index 0000000..f9e585b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +pref_first_startup=false diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs new file mode 100644 index 0000000..56cd496 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.team.ui.first_time=false diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.browser.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.browser.prefs new file mode 100644 index 0000000..84f3ad2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.browser.prefs @@ -0,0 +1,2 @@ +browsers=\r\n\r\n\r\n\r\n +eclipse.preferences.version=1 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs new file mode 100644 index 0000000..b5f2b44 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs @@ -0,0 +1,17 @@ +eclipse.preferences.version=1 +matchingTagIndicationColor=0,0,0 +occurrenceHighlighting=false +occurrenceIndication=true +occurrenceIndicationColor=0,64,0 +occurrenceTextStyle=BOX +overrideIndicatorColor=255,0,0 +overviewRuler_migration=migrated_3.1 +searchResultHighlighting=false +searchResultIndication=true +searchResultIndicationColor=0,0,255 +searchResultTextStyle=BOX +spacesForTabs=true +writeOccurrenceHighlighting=false +writeOccurrenceIndication=true +writeOccurrenceIndicationColor=64,0,128 +writeOccurrenceTextStyle=BOX diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs new file mode 100644 index 0000000..7d2886a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs @@ -0,0 +1,8 @@ +IMPORT_FILES_AND_FOLDERS_MODE=prompt +IMPORT_FILES_AND_FOLDERS_VIRTUAL_FOLDER_MODE=prompt +PROBLEMS_FILTERS_MIGRATE=true +SAVE_ALL_BEFORE_BUILD=true +eclipse.preferences.version=1 +platformState=1413973123639 +quickStart=false +tipsAndTricks=true diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs new file mode 100644 index 0000000..08076f2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +showIntro=false diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs new file mode 100644 index 0000000..bd77b38 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs @@ -0,0 +1,4 @@ +//org.eclipse.ui.commands/state/org.eclipse.wst.xml.views.XPathView.processor.xpathprocessor/org.eclipse.ui.commands.radioState=xpath10 +ENABLED_DECORATORS=org.eclipse.jst.ws.jaxws.dom.integration.navigator.WebServiceDecorator\:true,org.eclipse.wst.server.ui.decorator\:false,org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.DependencyDecoration\:true,org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.ColumnDecoration\:true,org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.ForeignKeyDecoration\:true,org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.IndexTriggerDecoration\:true,org.eclipse.datatools.connectivity.internal.core.ui.bookmarkDecoration\:true,org.eclipse.datatools.connectivity.internal.core.ui.FilterNodeDecoration\:true,org.eclipse.datatools.connectivity.ui.decorator.contentextension\:false,org.eclipse.datatools.enablement.ingres.ui.providers.decorators.SynonymDecorationService\:true,org.eclipse.datatools.enablement.ingres.internal.ui.providers.decorators.ParameterDecorationService\:true,org.eclipse.datatools.enablement.sybase.asa.proxytabledecorator\:true,org.eclipse.datatools.enablement.sybase.ase.webservicetabledecorator\:true,org.eclipse.datatools.enablement.sybase.systemtabledecorator\:true,org.eclipse.jdt.ui.override.decorator\:true,org.eclipse.jdt.ui.interface.decorator\:false,org.eclipse.jdt.ui.buildpath.decorator\:true,org.eclipse.jst.j2ee.internal.ui.util.AnnotationIconDecorator_ejb\:true,org.eclipse.jst.j2ee.navigator.internal.J2EEProjectDecorator\:true,org.eclipse.jst.jee.ui.internal.navigator.ejb.BeanDecorator\:true,org.eclipse.jst.jee.navigator.internal.JEEProjectDecorator\:true,org.eclipse.jst.j2ee.internal.ui.util.AnnotationIconDecorator_servlet\:true,org.eclipse.jst.servlet.ui.Decorator\:true,org.eclipse.mylyn.context.ui.decorator.interest\:true,org.eclipse.mylyn.tasks.ui.decorators.task\:true,org.eclipse.mylyn.team.ui.changeset.decorator\:true,org.eclipse.pde.ui.binaryProjectDecorator\:false,org.eclipse.rse.core.virtualobject.decorator\:true,org.eclipse.rse.core.binary.executable.decorator\:true,org.eclipse.rse.core.script.executable.decorator\:true,org.eclipse.rse.core.java.executable.decorator\:true,org.eclipse.rse.core.library.decorator\:true,org.eclipse.rse.core.link.decorator\:true,org.eclipse.rse.subsystems.error.decorator\:true,org.eclipse.team.cvs.ui.decorator\:true,org.eclipse.ui.LinkedResourceDecorator\:true,org.eclipse.ui.VirtualResourceDecorator\:true,org.eclipse.ui.ContentTypeDecorator\:true,org.eclipse.ui.ResourceFilterDecorator\:false,org.eclipse.wst.jsdt.ui.override.decorator\:true,org.eclipse.wst.server.ui.navigatorDecorator\:true, +PLUGINS_NOT_ACTIVATED_ON_STARTUP=org.eclipse.m2e.discovery; +eclipse.preferences.version=1 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.sse.core.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.sse.core.prefs new file mode 100644 index 0000000..c24da96 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.sse.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +task-tag-projects-already-scanned=Minecraft diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.ws.service.policy.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.ws.service.policy.prefs new file mode 100644 index 0000000..6696959 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.ws.service.policy.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp.wsiap.defaultProtocol=http\://schemas.xmlsoap.org/wsdl/soap/ +org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp.wsissbp.defaultProtocol=http\://schemas.xmlsoap.org/wsdl/soap/ diff --git a/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Client.launch b/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Client.launch new file mode 100644 index 0000000..71073e4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Client.launch @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/ClientNoLogin.launch b/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/ClientNoLogin.launch new file mode 100644 index 0000000..cab1034 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/ClientNoLogin.launch @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Server.launch b/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Server.launch new file mode 100644 index 0000000..e46a5a1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/Server.launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml new file mode 100644 index 0000000..0213cf8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml @@ -0,0 +1,21 @@ + +
+
+ + + +
+
+ + + +
+
+ + + + + + +
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml b/eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml new file mode 100644 index 0000000..e720862 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi new file mode 100644 index 0000000..7907ab6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -0,0 +1,3230 @@ + + + + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration + ModelMigrationProcessor.001 + + + + + + topLevel + shellMaximized + + + + + persp.actionSet:org.eclipse.mylyn.context.ui.actionSet + persp.actionSet:org.eclipse.mylyn.doc.actionSet + persp.actionSet:org.eclipse.mylyn.tasks.ui.navigation + persp.actionSet:org.eclipse.ui.cheatsheets.actionSet + persp.actionSet:org.eclipse.rse.core.search.searchActionSet + persp.actionSet:org.eclipse.search.searchActionSet + persp.actionSet:org.eclipse.ui.edit.text.actionSet.annotationNavigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.navigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo + persp.actionSet:org.eclipse.ui.externaltools.ExternalToolsSet + persp.actionSet:org.eclipse.ui.actionSet.keyBindings + persp.actionSet:org.eclipse.ui.actionSet.openFiles + persp.actionSet:org.eclipse.jst.j2ee.J2eeMainActionSet + persp.actionSet:org.eclipse.jdt.ui.JavaActionSet + persp.actionSet:org.eclipse.debug.ui.launchActionSet + persp.actionSet:org.eclipse.debug.ui.debugActionSet + persp.actionSet:org.eclipse.ui.NavigateActionSet + persp.viewSC:org.eclipse.ui.navigator.ProjectExplorer + persp.viewSC:org.eclipse.wst.server.ui.ServersView + persp.viewSC:org.eclipse.datatools.connectivity.DataSourceExplorerNavigator + persp.viewSC:org.eclipse.ui.views.BookmarkView + persp.viewSC:org.eclipse.ui.views.ContentOutline + persp.viewSC:org.eclipse.ui.views.PropertySheet + persp.viewSC:org.eclipse.ui.views.ResourceNavigator + persp.viewSC:org.eclipse.wst.common.snippets.internal.ui.SnippetsView + persp.viewSC:org.eclipse.ui.views.AllMarkersView + persp.viewSC:org.eclipse.mylyn.tasks.ui.views.tasks + persp.viewSC:org.eclipse.search.ui.views.SearchView + persp.viewSC:org.eclipse.ui.console.ConsoleView + persp.showIn:org.eclipse.ui.navigator.ProjectExplorer + persp.newWizSC:org.eclipse.jpt.jpa.ui.wizard.newJpaProject + persp.perspSC:org.eclipse.jpt.ui.jpaPerspective + persp.perspSC:org.eclipse.debug.ui.DebugPerspective + persp.perspSC:org.eclipse.jdt.ui.JavaPerspective + persp.perspSC:org.eclipse.ui.resourcePerspective + persp.perspSC:org.eclipse.wst.web.ui.webDevPerspective + persp.newWizSC:org.eclipse.jst.j2ee.ui.project.facet.EarProjectWizard + persp.newWizSC:org.eclipse.jst.servlet.ui.project.facet.WebProjectWizard + persp.newWizSC:org.eclipse.jst.ejb.ui.project.facet.EjbProjectWizard + persp.newWizSC:org.eclipse.jst.j2ee.jca.ui.internal.wizard.ConnectorProjectWizard + persp.newWizSC:org.eclipse.jst.j2ee.ui.project.facet.appclient.AppClientProjectWizard + persp.newWizSC:org.eclipse.wst.web.ui.internal.wizards.SimpleWebProjectWizard + persp.newWizSC:org.eclipse.jpt.ui.wizard.newJpaProject + persp.newWizSC:org.eclipse.jst.servlet.ui.internal.wizard.AddServletWizard + persp.newWizSC:org.eclipse.jst.ejb.ui.internal.wizard.AddSessionBeanWizard + persp.newWizSC:org.eclipse.jst.ejb.ui.internal.wizard.AddMessageDrivenBeanWizard + persp.newWizSC:org.eclipse.jpt.ui.wizard.newEntity + persp.newWizSC:org.eclipse.jst.ws.creation.ui.wizard.serverwizard + persp.newWizSC:org.eclipse.ui.wizards.new.folder + persp.newWizSC:org.eclipse.ui.wizards.new.file + persp.actionSet:org.eclipse.wst.server.ui.internal.webbrowser.actionSet + persp.actionSet:org.eclipse.debug.ui.breakpointActionSet + persp.actionSet:org.eclipse.wst.ws.explorer.explorer + + + newtablook + + + + + + + + + Maximized + + + newtablook + Minimized + + + + + + newtablook + org.eclipse.e4.secondaryDataStack + + + + + + + + + + + + + + + + + + + persp.actionSet:org.eclipse.mylyn.doc.actionSet + persp.actionSet:org.eclipse.mylyn.tasks.ui.navigation + persp.actionSet:org.eclipse.ui.cheatsheets.actionSet + persp.actionSet:org.eclipse.search.searchActionSet + persp.actionSet:org.eclipse.ui.edit.text.actionSet.annotationNavigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.navigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo + persp.actionSet:org.eclipse.ui.externaltools.ExternalToolsSet + persp.actionSet:org.eclipse.ui.actionSet.keyBindings + persp.actionSet:org.eclipse.ui.actionSet.openFiles + persp.actionSet:org.eclipse.wb.core.ui.actionset + persp.actionSet:org.eclipse.debug.ui.launchActionSet + persp.actionSet:org.eclipse.jdt.ui.JavaActionSet + persp.actionSet:org.eclipse.jdt.ui.JavaElementCreationActionSet + persp.actionSet:org.eclipse.ui.NavigateActionSet + persp.viewSC:org.eclipse.jdt.ui.PackageExplorer + persp.viewSC:org.eclipse.jdt.ui.TypeHierarchy + persp.viewSC:org.eclipse.jdt.ui.SourceView + persp.viewSC:org.eclipse.jdt.ui.JavadocView + persp.viewSC:org.eclipse.search.ui.views.SearchView + persp.viewSC:org.eclipse.ui.console.ConsoleView + persp.viewSC:org.eclipse.ui.views.ContentOutline + persp.viewSC:org.eclipse.ui.views.ProblemView + persp.viewSC:org.eclipse.ui.views.ResourceNavigator + persp.viewSC:org.eclipse.ui.views.TaskList + persp.viewSC:org.eclipse.ui.views.ProgressView + persp.viewSC:org.eclipse.ui.navigator.ProjectExplorer + persp.viewSC:org.eclipse.ui.texteditor.TemplatesView + persp.viewSC:org.eclipse.pde.runtime.LogView + persp.newWizSC:org.eclipse.jdt.ui.wizards.JavaProjectWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewPackageCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewClassCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewEnumCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewJavaWorkingSetWizard + persp.newWizSC:org.eclipse.ui.wizards.new.folder + persp.newWizSC:org.eclipse.ui.wizards.new.file + persp.newWizSC:org.eclipse.ui.editors.wizards.UntitledTextFileWizard + persp.perspSC:org.eclipse.jdt.ui.JavaBrowsingPerspective + persp.perspSC:org.eclipse.debug.ui.DebugPerspective + persp.viewSC:org.eclipse.ant.ui.views.AntView + persp.showIn:org.eclipse.egit.ui.RepositoriesView + persp.actionSet:org.eclipse.debug.ui.breakpointActionSet + persp.actionSet:org.eclipse.jdt.debug.ui.JDTDebugActionSet + persp.newWizSC:org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizard + persp.actionSet:org.eclipse.jdt.junit.JUnitActionSet + persp.showIn:org.eclipse.jdt.ui.PackageExplorer + persp.showIn:org.eclipse.team.ui.GenericHistoryView + persp.showIn:org.eclipse.ui.views.ResourceNavigator + persp.showIn:org.eclipse.ui.navigator.ProjectExplorer + persp.viewSC:org.eclipse.mylyn.tasks.ui.views.tasks + persp.newWizSC:org.eclipse.mylyn.tasks.ui.wizards.new.repository.task + persp.viewSC:org.eclipse.wb.core.StructureView + persp.viewSC:org.eclipse.wb.core.PaletteView + persp.actionSet:org.eclipse.debug.ui.debugActionSet + + + + newtablook + org.eclipse.e4.primaryNavigationStack + Minimized + + + + + + + + + + newtablook + + + + + + + + newtablook + org.eclipse.e4.secondaryDataStack + + + + + + + + + + + + + + newtablook + Minimized + + + + newtablook + org.eclipse.e4.secondaryNavigationStack + Minimized + + + + + + + + + + + + + + + + + View + categoryTag:Help + + + View + categoryTag:General + + + View + categoryTag:Help + + + + newtablook + org.eclipse.e4.primaryDataStack + EditorStack + active + + + Editor + org.eclipse.jdt.ui.CompilationUnitEditor + removeOnHide + + menuContribution:popup + popup:#CompilationUnitEditorContext + popup:org.eclipse.jdt.ui.CompilationUnitEditor.EditorContext + popup:#AbstractTextEditorContext + + + menuContribution:popup + popup:#CompilationUnitRulerContext + popup:org.eclipse.jdt.ui.CompilationUnitEditor.RulerContext + popup:#AbstractTextEditorRulerContext + + + menuContribution:popup + popup:#OverviewRulerContext + + + + + Editor + org.eclipse.ui.DefaultTextEditor + removeOnHide + + menuContribution:popup + popup:#TextEditorContext + popup:org.eclipse.ui.DefaultTextEditor.EditorContext + popup:#AbstractTextEditorContext + + + menuContribution:popup + popup:#TextRulerContext + popup:org.eclipse.ui.DefaultTextEditor.RulerContext + popup:#AbstractTextEditorRulerContext + + + menuContribution:popup + popup:#OverviewRulerContext + + + + + Editor + org.eclipse.ui.DefaultTextEditor + 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 + active + activeOnClose + + + + Editor + org.eclipse.jdt.ui.CompilationUnitEditor + removeOnHide + + + + Editor + org.eclipse.jdt.ui.ClassFileEditor + removeOnHide + + + + Editor + org.eclipse.jdt.ui.CompilationUnitEditor + removeOnHide + + + + Editor + org.eclipse.jdt.ui.CompilationUnitEditor + removeOnHide + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + View + categoryTag:General + + + + View + categoryTag:Java + + ViewMenu + menuContribution:menu + + + + + View + categoryTag:Java Browsing + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + View + categoryTag:Server + + + View + categoryTag:Data Management + + + View + categoryTag:General + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + menuContribution:popup + popup:org.eclipse.ui.views.ProblemView + popup:org.eclipse.ui.ide.MarkersView + + + menuContribution:popup + popup:org.eclipse.ui.views.ProblemView + popup:org.eclipse.ui.ide.MarkersView + + + menuContribution:popup + popup:org.eclipse.ui.views.ProblemView + popup:org.eclipse.ui.ide.MarkersView + + + menuContribution:popup + popup:org.eclipse.ui.views.ProblemView + popup:org.eclipse.ui.ide.MarkersView + + + menuContribution:popup + popup:org.eclipse.ui.views.ProblemView + popup:org.eclipse.ui.ide.MarkersView + + + menuContribution:popup + popup:org.eclipse.ui.views.ProblemView + popup:org.eclipse.ui.ide.MarkersView + + + menuContribution:popup + popup:org.eclipse.ui.views.ProblemView + popup:org.eclipse.ui.ide.MarkersView + + + menuContribution:popup + popup:org.eclipse.ui.views.ProblemView + popup:org.eclipse.ui.ide.MarkersView + + + + + View + categoryTag:General + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + menuContribution:popup + popup:org.eclipse.debug.ui.ProcessConsoleType.#ContextMenu + + + menuContribution:popup + popup:org.eclipse.debug.ui.ProcessConsoleType.#ContextMenu + + + menuContribution:popup + popup:org.eclipse.debug.ui.ProcessConsoleType.#ContextMenu + + + menuContribution:popup + popup:org.eclipse.debug.ui.ProcessConsoleType.#ContextMenu + + + menuContribution:popup + popup:org.eclipse.debug.ui.ProcessConsoleType.#ContextMenu + + + menuContribution:popup + popup:org.eclipse.debug.ui.ProcessConsoleType.#ContextMenu + + + menuContribution:popup + popup:org.eclipse.debug.ui.ProcessConsoleType.#ContextMenu + + + menuContribution:popup + popup:org.eclipse.debug.ui.ProcessConsoleType.#ContextMenu + + + + + View + categoryTag:General + + + View + categoryTag:General + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + menuContribution:popup + popup:org.eclipse.jdt.ui.outline + + + + + + View + categoryTag:Mylyn + + ViewMenu + menuContribution:menu + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.menus.activeTask + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.views.tasks + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.menus.activeTask + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.views.tasks + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.menus.activeTask + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.views.tasks + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.menus.activeTask + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.views.tasks + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.menus.activeTask + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.views.tasks + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.menus.activeTask + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.views.tasks + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.menus.activeTask + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.views.tasks + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.menus.activeTask + + + menuContribution:popup + popup:org.eclipse.mylyn.tasks.ui.views.tasks + + + + + + View + categoryTag:Debug + + ViewMenu + menuContribution:menu + + + menuContribution:popup + popup:org.eclipse.debug.ui.DebugView + + + menuContribution:popup + popup:org.eclipse.debug.ui.DebugView + + + menuContribution:popup + popup:org.eclipse.debug.ui.DebugView + + + menuContribution:popup + popup:org.eclipse.debug.ui.DebugView + + + menuContribution:popup + popup:org.eclipse.debug.ui.DebugView + + + menuContribution:popup + popup:org.eclipse.debug.ui.DebugView + + + + + + View + categoryTag:Java + + ViewMenu + menuContribution:menu + + + menuContribution:popup + popup:org.eclipse.jdt.ui.PackageExplorer + + + menuContribution:popup + popup:org.eclipse.jdt.ui.PackageExplorer + + + menuContribution:popup + popup:org.eclipse.jdt.ui.PackageExplorer + + + menuContribution:popup + popup:org.eclipse.jdt.ui.PackageExplorer + + + menuContribution:popup + popup:org.eclipse.jdt.ui.PackageExplorer + + + menuContribution:popup + popup:org.eclipse.jdt.ui.PackageExplorer + + + menuContribution:popup + popup:org.eclipse.jdt.ui.PackageExplorer + + + menuContribution:popup + popup:org.eclipse.jdt.ui.PackageExplorer + + + + + + View + categoryTag:Java + + ViewMenu + menuContribution:menu + + + menuContribution:popup + popup:org.eclipse.jdt.ui.JavadocView + + + + + View + categoryTag:Java + + + View + categoryTag:General + + + View + categoryTag:Ant + + + View + categoryTag:Git + + + View + categoryTag:Java + + + View + categoryTag:WindowBuilder + + + View + categoryTag:WindowBuilder + + + + View + categoryTag:Team + + ViewMenu + menuContribution:menu + + + + + + toolbarSeparator + + + + Draggable + + + + toolbarSeparator + + + + Draggable + + + Draggable + + + Draggable + + + Draggable + + + Draggable + + + Draggable + + + Draggable + + + Draggable + + + Draggable + + + toolbarSeparator + + + + Draggable + + + + toolbarSeparator + + + + toolbarSeparator + + + + Draggable + + + stretch + SHOW_RESTORE_MENU + + + Draggable + HIDEABLE + SHOW_RESTORE_MENU + + + + + stretch + + + + Draggable + + + + + TrimStack + + + + + TrimStack + + + + + TrimStack + + + TrimStack + + + TrimStack + + + TrimStack + + + TrimStack + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Editor + + + View + categoryTag:Ant + + + View + categoryTag:Data Management + + + View + categoryTag:Data Management + + + View + categoryTag:Data Management + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + View + categoryTag:General + + + View + categoryTag:Help + + + View + categoryTag:Debug + + + View + categoryTag:Java + + + View + categoryTag:Java + + + View + categoryTag:Java + + + View + categoryTag:Java Browsing + + + View + categoryTag:Java Browsing + + + View + categoryTag:Java Browsing + + + View + categoryTag:Java Browsing + + + View + categoryTag:Java + + + View + categoryTag:General + + + View + categoryTag:Java + + + View + categoryTag:Java + + + View + categoryTag:JPA + + + View + categoryTag:JPA + + + View + categoryTag:JavaServer Faces + + + View + categoryTag:JavaServer Faces + + + View + categoryTag:JAX-WS + + + View + categoryTag:Mylyn + + + View + categoryTag:Mylyn + + + View + categoryTag:Mylyn + + + View + categoryTag:API Tools + + + View + categoryTag:Plug-in Development + + + View + categoryTag:Plug-in Development + + + View + categoryTag:Plug-in Development + + + View + categoryTag:Plug-in Development + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:CVS + + + View + categoryTag:CVS + + + View + categoryTag:Team + + + View + categoryTag:Team + + + View + categoryTag:Terminal + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:Help + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:Debug + + + View + categoryTag:JavaScript + + + View + categoryTag:JavaScript + + + View + categoryTag:JavaScript + + + View + categoryTag:JavaScript + + + View + categoryTag:JavaScript + + + View + categoryTag:Server + + + View + categoryTag:XML + + + View + categoryTag:XML + + + View + categoryTag:XML + + + View + categoryTag:XML + + + View + categoryTag:XML + + + View + categoryTag:Git + + + View + categoryTag:Git + + + View + categoryTag:Git + + + View + categoryTag:Git + + + View + categoryTag:Git + + + View + categoryTag:Maven + + + View + categoryTag:Maven + + + View + categoryTag:Mylyn + + + View + categoryTag:Code Recommenders + + + View + categoryTag:Code Recommenders + + + View + categoryTag:Code Recommenders + + + View + categoryTag:Code Recommenders + + + View + categoryTag:WindowBuilder + + + View + categoryTag:WindowBuilder + + + + glue + move_after:PerspectiveSpacer + SHOW_RESTORE_MENU + + + move_after:Spacer Glue + HIDEABLE + SHOW_RESTORE_MENU + + + glue + move_after:SearchField + SHOW_RESTORE_MENU + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.egit.ui/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.egit.ui/dialog_settings.xml new file mode 100644 index 0000000..59dd13f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.egit.ui/dialog_settings.xml @@ -0,0 +1,6 @@ + +
+
+ +
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.equinox.p2.ui/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.equinox.p2.ui/dialog_settings.xml new file mode 100644 index 0000000..7a912f7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.equinox.p2.ui/dialog_settings.xml @@ -0,0 +1,10 @@ + +
+
+ + + + + +
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/.org.eclipse.jdt.core.external.folders/.project b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/.org.eclipse.jdt.core.external.folders/.project new file mode 100644 index 0000000..d685162 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/.org.eclipse.jdt.core.external.folders/.project @@ -0,0 +1,18 @@ + + + .org.eclipse.jdt.core.external.folders + + + + + + + + + + .link0 + 2 + C:/Users/Sorin/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.0.1208/start + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1007111076.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1007111076.index new file mode 100644 index 0000000..e832290 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1007111076.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1112183641.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1112183641.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1112183641.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1140841982.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1140841982.index new file mode 100644 index 0000000..0d86251 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1140841982.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/122877426.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/122877426.index new file mode 100644 index 0000000..501fdbf Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/122877426.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1349318312.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1349318312.index new file mode 100644 index 0000000..1b612ed Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1349318312.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1396595163.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1396595163.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1396595163.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1405940092.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1405940092.index new file mode 100644 index 0000000..1966f2c Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1405940092.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1421139610.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1421139610.index new file mode 100644 index 0000000..8ac64af Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1421139610.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1501172594.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1501172594.index new file mode 100644 index 0000000..7f92335 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1501172594.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1532915402.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1532915402.index new file mode 100644 index 0000000..f8a355a Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1532915402.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1560443425.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1560443425.index new file mode 100644 index 0000000..ae69821 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1560443425.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1701803245.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1701803245.index new file mode 100644 index 0000000..be6850a Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1701803245.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1819133815.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1819133815.index new file mode 100644 index 0000000..70b45fb Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1819133815.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1830251659.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1830251659.index new file mode 100644 index 0000000..feedfda Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1830251659.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1846500785.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1846500785.index new file mode 100644 index 0000000..e39cf29 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1846500785.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1921212175.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1921212175.index new file mode 100644 index 0000000..8688337 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1921212175.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1964534855.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1964534855.index new file mode 100644 index 0000000..2e34903 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1964534855.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1977427294.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1977427294.index new file mode 100644 index 0000000..264b1f1 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1977427294.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/20746801.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/20746801.index new file mode 100644 index 0000000..c3f5130 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/20746801.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2084239533.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2084239533.index new file mode 100644 index 0000000..288b556 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2084239533.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2084554879.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2084554879.index new file mode 100644 index 0000000..5f272cd Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2084554879.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2208772637.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2208772637.index new file mode 100644 index 0000000..cd533e4 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2208772637.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2258076031.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2258076031.index new file mode 100644 index 0000000..5996921 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2258076031.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2306963099.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2306963099.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2306963099.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2373544449.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2373544449.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2373544449.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2485927450.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2485927450.index new file mode 100644 index 0000000..2100381 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2485927450.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2531317059.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2531317059.index new file mode 100644 index 0000000..e84ad75 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2531317059.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2540715342.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2540715342.index new file mode 100644 index 0000000..fffb696 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2540715342.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2619072759.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2619072759.index new file mode 100644 index 0000000..03c718d Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2619072759.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2651294000.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2651294000.index new file mode 100644 index 0000000..8856652 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2651294000.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2722331477.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2722331477.index new file mode 100644 index 0000000..dbbdd6e Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2722331477.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2864048921.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2864048921.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2864048921.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/286606776.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/286606776.index new file mode 100644 index 0000000..49a1b31 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/286606776.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2881167831.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2881167831.index new file mode 100644 index 0000000..2bbb412 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2881167831.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2884189329.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2884189329.index new file mode 100644 index 0000000..482d6e4 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2884189329.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/292378129.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/292378129.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/292378129.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3113700871.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3113700871.index new file mode 100644 index 0000000..43f0504 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3113700871.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3128574298.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3128574298.index new file mode 100644 index 0000000..723831e Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3128574298.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3136311497.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3136311497.index new file mode 100644 index 0000000..789d99b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3136311497.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3140820942.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3140820942.index new file mode 100644 index 0000000..f9fe97b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3140820942.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3156511736.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3156511736.index new file mode 100644 index 0000000..619039d Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3156511736.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3299643186.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3299643186.index new file mode 100644 index 0000000..590de9f Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3299643186.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3305494902.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3305494902.index new file mode 100644 index 0000000..e41a79b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3305494902.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3318142213.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3318142213.index new file mode 100644 index 0000000..bb72e39 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3318142213.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3340730395.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3340730395.index new file mode 100644 index 0000000..723831e Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3340730395.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3498421256.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3498421256.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3498421256.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3565748907.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3565748907.index new file mode 100644 index 0000000..61f5188 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3565748907.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3567615882.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3567615882.index new file mode 100644 index 0000000..a6c1a61 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3567615882.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3574260035.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3574260035.index new file mode 100644 index 0000000..54581b2 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3574260035.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3589703992.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3589703992.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3589703992.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3604851502.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3604851502.index new file mode 100644 index 0000000..ce07e54 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3604851502.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3631395337.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3631395337.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3631395337.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3640198305.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3640198305.index new file mode 100644 index 0000000..d46b1a0 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3640198305.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3843255497.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3843255497.index new file mode 100644 index 0000000..e3345ba Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3843255497.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3906489835.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3906489835.index new file mode 100644 index 0000000..d874bc1 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3906489835.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3926268792.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3926268792.index new file mode 100644 index 0000000..dc0877b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3926268792.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3950275383.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3950275383.index new file mode 100644 index 0000000..70b45fb Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3950275383.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4106476167.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4106476167.index new file mode 100644 index 0000000..0959ff0 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4106476167.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4137555767.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4137555767.index new file mode 100644 index 0000000..6e5b5a7 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4137555767.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4217051397.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4217051397.index new file mode 100644 index 0000000..8b9949f Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4217051397.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4219528247.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4219528247.index new file mode 100644 index 0000000..f630b23 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4219528247.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4224004643.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4224004643.index new file mode 100644 index 0000000..b94c51c Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4224004643.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4257325822.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4257325822.index new file mode 100644 index 0000000..3dcdd55 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4257325822.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4263599826.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4263599826.index new file mode 100644 index 0000000..4f8d640 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4263599826.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4288041202.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4288041202.index new file mode 100644 index 0000000..c51c3b3 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4288041202.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/473306299.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/473306299.index new file mode 100644 index 0000000..cebefcf Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/473306299.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/512031428.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/512031428.index new file mode 100644 index 0000000..aa097df Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/512031428.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/542699870.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/542699870.index new file mode 100644 index 0000000..8c6da66 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/542699870.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/573497671.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/573497671.index new file mode 100644 index 0000000..42aa99a Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/573497671.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/702867120.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/702867120.index new file mode 100644 index 0000000..c406e06 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/702867120.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/752465932.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/752465932.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/752465932.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/785918974.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/785918974.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/785918974.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/904948993.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/904948993.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/904948993.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache new file mode 100644 index 0000000..593f470 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache new file mode 100644 index 0000000..31baf0b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps new file mode 100644 index 0000000..09db74d Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt new file mode 100644 index 0000000..32e47ed --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt @@ -0,0 +1 @@ +INDEX VERSION 1.127 diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/invalidArchivesCache b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/invalidArchivesCache new file mode 100644 index 0000000..593f470 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/invalidArchivesCache differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt new file mode 100644 index 0000000..8586397 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt @@ -0,0 +1 @@ +java \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache new file mode 100644 index 0000000..7704294 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt new file mode 100644 index 0000000..561e3c1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt @@ -0,0 +1,74 @@ +INDEX VERSION 1.127+H:\Jewelrycraft\1.7.10\eclipse\.metadata\.plugins\org.eclipse.jdt.core +3604851502.index +2373544449.index +1830251659.index +2864048921.index +1349318312.index +1532915402.index +20746801.index +2884189329.index +4288041202.index +1421139610.index +573497671.index +1140841982.index +512031428.index +904948993.index +1112183641.index +4137555767.index +286606776.index +2084554879.index +4263599826.index +1560443425.index +473306299.index +292378129.index +1921212175.index +3631395337.index +1846500785.index +3574260035.index +3640198305.index +3906489835.index +3318142213.index +3843255497.index +2306963099.index +3340730395.index +1007111076.index +3926268792.index +702867120.index +3140820942.index +3305494902.index +2258076031.index +3128574298.index +1396595163.index +4106476167.index +2722331477.index +3498421256.index +3950275383.index +2485927450.index +3156511736.index +2619072759.index +785918974.index +2208772637.index +1977427294.index +1819133815.index +1405940092.index +4257325822.index +3299643186.index +1501172594.index +2540715342.index +4219528247.index +2531317059.index +3565748907.index +2651294000.index +752465932.index +2881167831.index +1701803245.index +542699870.index +4224004643.index +2084239533.index +4217051397.index +3567615882.index +3136311497.index +3113700871.index +122877426.index +1964534855.index +3589703992.index diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat new file mode 100644 index 0000000..bc50173 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.debug.ui/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.jdt.debug.ui/dialog_settings.xml new file mode 100644 index 0000000..8d5b3d2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.debug.ui/dialog_settings.xml @@ -0,0 +1,24 @@ + +
+ + + + +
+ + +
+ + + + + +
+
+
+ + + + +
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml b/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml new file mode 100644 index 0000000..fb83796 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml b/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml new file mode 100644 index 0000000..c2b59bd --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml new file mode 100644 index 0000000..a4ee3cb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml new file mode 100644 index 0000000..d5c2e61 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml new file mode 100644 index 0000000..df6dded --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml @@ -0,0 +1,201 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + + + + + + +
+
+ + + + + +
+
+ + + +
+
+ +
+
+ + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ + + +
+ + + + + + + + + + +
+
+ + + + + + + + + + +
+
+ + + + + + + + + + +
+
+
+ + + + + +
+
+ + +
+
+ + +
+
+
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2015/3/10/refactorings.history b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2015/3/10/refactorings.history new file mode 100644 index 0000000..9f422d7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2015/3/10/refactorings.history @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2015/3/10/refactorings.index b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2015/3/10/refactorings.index new file mode 100644 index 0000000..d2de8ad --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2015/3/10/refactorings.index @@ -0,0 +1 @@ +1425322244243 Delete resource 'Betweenlands' diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/1/refactorings.history b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/1/refactorings.history new file mode 100644 index 0000000..73d139f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/1/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/2014/12/1/refactorings.index b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/1/refactorings.index new file mode 100644 index 0000000..c4d2f9b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/1/refactorings.index @@ -0,0 +1,3 @@ +1419910506966 Rename local variable 'p_70300_1_' +1419917465880 Delete element +1419917704253 Rename field 'transparentMoltenMetal' diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/51/refactorings.history b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/51/refactorings.history new file mode 100644 index 0000000..f780540 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/51/refactorings.history @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/51/refactorings.index b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/51/refactorings.index new file mode 100644 index 0000000..89ce876 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/51/refactorings.index @@ -0,0 +1 @@ +1418968722117 Delete element diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/52/refactorings.history b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/52/refactorings.history new file mode 100644 index 0000000..ed79bea --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/52/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/2014/12/52/refactorings.index b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/52/refactorings.index new file mode 100644 index 0000000..e586f24 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2014/12/52/refactorings.index @@ -0,0 +1,4 @@ +1419171821283 Rename type 'EntityFlastShadowFX' +1419179648554 Delete element +1419558737167 Delete element +1419558800681 Rename type 'EntityShadowHandRender' diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/1/refactorings.history b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/1/refactorings.history new file mode 100644 index 0000000..89f6d24 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/1/refactorings.history @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/1/refactorings.index b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/1/refactorings.index new file mode 100644 index 0000000..7990f0e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/1/refactorings.index @@ -0,0 +1 @@ +1420250341472 Rename field 'jewel' diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/4/refactorings.history b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/4/refactorings.history new file mode 100644 index 0000000..f9f2ec4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/4/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/1/4/refactorings.index b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/4/refactorings.index new file mode 100644 index 0000000..c794c8b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/4/refactorings.index @@ -0,0 +1,4 @@ +1422112655819 Rename field 'hasJewel' +1422112672156 Rename field 'jewel' +1422113025219 Rename method 'isJewel' +1422115824086 Rename field 'timer' diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/5/refactorings.history b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/5/refactorings.history new file mode 100644 index 0000000..d902645 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/5/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/1/5/refactorings.index b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/5/refactorings.index new file mode 100644 index 0000000..db6fb9f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/1/5/refactorings.index @@ -0,0 +1,21 @@ +1422204263284 Delete element +1422204268798 Delete element +1422205079201 Delete element +1422205082602 Delete element +1422205118059 Delete element +1422208850113 Delete element +1422221010554 Delete element +1422324176912 Rename local variable 'p_70301_1_' +1422324188755 Rename local variable 'p_70463_1_' +1422324220438 Rename local variable 'p_70298_1_' +1422324244106 Rename local variable 'p_70298_2_' +1422325372030 Rename local variable 'p_i1814_2_' +1422327917576 Delete element +1422493603180 Delete element +1422493604971 Delete element +1422567168962 Delete element +1422656685033 Rename type 'GuiTabJewelsAndModifiers' +1422656717183 Delete element +1422656719094 Delete element +1422703686929 Rename local variable 'par2EntityPlayer' +1422703697298 Rename local variable 'par3EntityLivingBase' diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/6/refactorings.history b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/6/refactorings.history new file mode 100644 index 0000000..276c1f9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/6/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/2/6/refactorings.index b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/6/refactorings.index new file mode 100644 index 0000000..4327ee0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/6/refactorings.index @@ -0,0 +1,10 @@ +1422754300824 Delete element +1422905540601 Rename local variable 'persistTag' +1422907072319 Rename local variable 'persistTag' +1423163996206 Copy compilation unit +1423164015825 Copy compilation unit +1423184293290 Delete element +1423260418119 Rename method 'isModifierX' +1423279394453 Rename local variable 'in' +1423279406873 Rename local variable 'ingotIconName' +1423279448710 Rename local variable 'ingot' diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/7/refactorings.history b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/7/refactorings.history new file mode 100644 index 0000000..6a01274 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/7/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/2/7/refactorings.index b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/7/refactorings.index new file mode 100644 index 0000000..6109dc0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/7/refactorings.index @@ -0,0 +1,10 @@ +1423859536652 Rename local variable 'f' +1423859548665 Rename local variable 'f1' +1423859568443 Rename local variable 'f2' +1423859581699 Rename local variable 'f3' +1423859594855 Rename local variable 'f4' +1423859604113 Rename local variable 'f5' +1423859725852 Rename local variable 'f5' +1423861780649 Move compilation unit +1423861815255 Rename package 'darkknight.jewelrycraft.renders' +1423949994627 Delete element diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/8/refactorings.history b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/8/refactorings.history new file mode 100644 index 0000000..7fa2596 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/8/refactorings.history @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/8/refactorings.index b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/8/refactorings.index new file mode 100644 index 0000000..81c837f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/2/8/refactorings.index @@ -0,0 +1 @@ +1424485179580 Delete element diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/10/refactorings.history b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/10/refactorings.history new file mode 100644 index 0000000..6fa2ed3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/10/refactorings.history @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/10/refactorings.index b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/10/refactorings.index new file mode 100644 index 0000000..1fe8c66 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/10/refactorings.index @@ -0,0 +1 @@ +1425601664754 Delete element diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/12/refactorings.history b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/12/refactorings.history new file mode 100644 index 0000000..8ab5967 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/12/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/3/12/refactorings.index b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/12/refactorings.index new file mode 100644 index 0000000..9855add --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/Minecraft/2015/3/12/refactorings.index @@ -0,0 +1,2 @@ +1426814364438 Rename field 'greedCache' +1426814375468 Rename method 'checkPlayerGreed' diff --git a/eclipse/.metadata/.plugins/org.eclipse.ltk.ui.refactoring/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.ltk.ui.refactoring/dialog_settings.xml new file mode 100644 index 0000000..74081ba --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ltk.ui.refactoring/dialog_settings.xml @@ -0,0 +1,25 @@ + +
+ + +
+ + +
+
+ + +
+
+ + + +
+
+ +
+
+ + +
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/_0.cfs b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/_0.cfs new file mode 100644 index 0000000..5a30236 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/_0.cfs differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/_0_1.del b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/_0_1.del new file mode 100644 index 0000000..1b473bd Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/_0_1.del differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/_1.cfs b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/_1.cfs new file mode 100644 index 0000000..910380c Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/_1.cfs differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/segments.gen b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/segments.gen new file mode 100644 index 0000000..e9fa600 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/segments.gen differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/segments_3 b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/segments_3 new file mode 100644 index 0000000..17d300b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/segments_3 differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/write.lock b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/26522e0d83a422eed93329ece7565cfc/write.lock new file mode 100644 index 0000000..e69de29 diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_0.cfs b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_0.cfs new file mode 100644 index 0000000..2510e88 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_0.cfs differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_0_1.del b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_0_1.del new file mode 100644 index 0000000..1b473bd Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_0_1.del differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_1.cfs b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_1.cfs new file mode 100644 index 0000000..051597c Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_1.cfs differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments.gen b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments.gen new file mode 100644 index 0000000..e9fa600 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments.gen differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments_3 b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments_3 new file mode 100644 index 0000000..12d3727 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments_3 differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/write.lock b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/write.lock new file mode 100644 index 0000000..e69de29 diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/_0.cfs b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/_0.cfs new file mode 100644 index 0000000..4fe416b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/_0.cfs differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/_0_1.del b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/_0_1.del new file mode 100644 index 0000000..1b473bd Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/_0_1.del differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/_1.cfs b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/_1.cfs new file mode 100644 index 0000000..bb65889 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/_1.cfs differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/segments.gen b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/segments.gen new file mode 100644 index 0000000..e9fa600 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/segments.gen differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/segments_3 b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/segments_3 new file mode 100644 index 0000000..ecdb4b3 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/segments_3 differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/write.lock b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/nexus/c0b74ee5743f12e1740af8eef8e8bda1/write.lock new file mode 100644 index 0000000..e69de29 diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.core/workspaceState.ser b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/workspaceState.ser new file mode 100644 index 0000000..ea1867c Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.m2e.core/workspaceState.ser differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log b/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log new file mode 100644 index 0000000..4b3cbf0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log @@ -0,0 +1,97 @@ +2014-10-29 14:38:40,182 [Start Help Server] INFO org.eclipse.jetty.server.Server - jetty-8.1.14.v20131031 +2014-10-29 14:38:40,482 [Start Help Server] INFO o.e.jetty.server.AbstractConnector - Started SelectChannelConnector@127.0.0.1:49911 +2014-10-29 15:53:25,567 [Stop Help Server] INFO o.e.j.server.handler.ContextHandler - stopped o.e.j.s.ServletContextHandler{/help,null} +2014-12-21 15:52:58,450 [main] WARN o.e.r.i.c.rcp.TypeBindingAnalyzer - Can't handle class org.eclipse.jdt.internal.compiler.ast.IfStatement as parent of completion location. +2014-12-28 22:26:03,121 [Worker-12] ERROR o.e.r.m.a.MavenCentralFingerprintSearchAdvisor - Exception when querying Solr Server +org.apache.solr.client.solrj.SolrServerException: java.net.SocketTimeoutException: Read timed out + at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:480) ~[org.apache.solr.client.solrj_3.5.0.v20120530-0900.jar:na] + at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:246) ~[org.apache.solr.client.solrj_3.5.0.v20120530-0900.jar:na] + at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:89) ~[na:na] + at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:266) ~[org.apache.solr.client.solrj_3.5.0.v20120530-0900.jar:na] + at org.eclipse.recommenders.models.advisors.MavenCentralFingerprintSearchAdvisor.doSuggest(MavenCentralFingerprintSearchAdvisor.java:91) ~[org.eclipse.recommenders.models_2.1.9.v20140917-1240.jar:na] + at org.eclipse.recommenders.models.advisors.AbstractProjectCoordinateAdvisor.suggest(AbstractProjectCoordinateAdvisor.java:29) [org.eclipse.recommenders.models_2.1.9.v20140917-1240.jar:na] + at org.eclipse.recommenders.models.rcp.advisors.EclipseMavenCentralFingerprintSearchAdvisor.suggest(EclipseMavenCentralFingerprintSearchAdvisor.java:55) [org.eclipse.recommenders.models.rcp_2.1.9.v20140917-1240.jar:na] + at org.eclipse.recommenders.models.advisors.ProjectCoordinateAdvisorService.suggest(ProjectCoordinateAdvisorService.java:52) [org.eclipse.recommenders.models_2.1.9.v20140917-1240.jar:na] + at org.eclipse.recommenders.internal.models.rcp.EclipseProjectCoordinateAdvisorService$2.load(EclipseProjectCoordinateAdvisorService.java:101) [org.eclipse.recommenders.models.rcp_2.1.9.v20140917-1240.jar:na] + at org.eclipse.recommenders.internal.models.rcp.EclipseProjectCoordinateAdvisorService$2.load(EclipseProjectCoordinateAdvisorService.java:1) [org.eclipse.recommenders.models.rcp_2.1.9.v20140917-1240.jar:na] + at com.google.common.cache.CacheLoader.reload(CacheLoader.java:94) [com.google.guava_15.0.0.v201403281430.jar:na] + at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3525) [com.google.guava_15.0.0.v201403281430.jar:na] + at com.google.common.cache.LocalCache$Segment.loadAsync(LocalCache.java:2321) [com.google.guava_15.0.0.v201403281430.jar:na] + at com.google.common.cache.LocalCache$Segment.refresh(LocalCache.java:2385) [com.google.guava_15.0.0.v201403281430.jar:na] + at com.google.common.cache.LocalCache.refresh(LocalCache.java:4085) [com.google.guava_15.0.0.v201403281430.jar:na] + at com.google.common.cache.LocalCache$LocalLoadingCache.refresh(LocalCache.java:4825) [com.google.guava_15.0.0.v201403281430.jar:na] + at org.eclipse.recommenders.internal.models.rcp.EclipseProjectCoordinateAdvisorService$RefreshProjectCoordinatesJob.run(EclipseProjectCoordinateAdvisorService.java:209) [org.eclipse.recommenders.models.rcp_2.1.9.v20140917-1240.jar:na] + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) [org.eclipse.core.jobs_3.6.0.v20140424-0053.jar:na] +Caused by: java.net.SocketTimeoutException: Read timed out + at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.8.0_25] + at java.net.SocketInputStream.read(Unknown Source) ~[na:1.8.0_25] + at java.net.SocketInputStream.read(Unknown Source) ~[na:1.8.0_25] + at java.io.BufferedInputStream.fill(Unknown Source) ~[na:1.8.0_25] + at java.io.BufferedInputStream.read(Unknown Source) ~[na:1.8.0_25] + at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:424) ~[org.apache.solr.client.solrj_3.5.0.v20120530-0900.jar:na] + ... 17 common frames omitted +2014-12-28 22:26:06,427 [Worker-12] ERROR o.e.r.m.a.MavenCentralFingerprintSearchAdvisor - Exception when querying Solr Server +org.apache.solr.client.solrj.SolrServerException: java.net.SocketTimeoutException: Read timed out + at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:480) ~[org.apache.solr.client.solrj_3.5.0.v20120530-0900.jar:na] + at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:246) ~[org.apache.solr.client.solrj_3.5.0.v20120530-0900.jar:na] + at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:89) ~[na:na] + at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:266) ~[org.apache.solr.client.solrj_3.5.0.v20120530-0900.jar:na] + at org.eclipse.recommenders.models.advisors.MavenCentralFingerprintSearchAdvisor.doSuggest(MavenCentralFingerprintSearchAdvisor.java:91) ~[org.eclipse.recommenders.models_2.1.9.v20140917-1240.jar:na] + at org.eclipse.recommenders.models.advisors.AbstractProjectCoordinateAdvisor.suggest(AbstractProjectCoordinateAdvisor.java:29) [org.eclipse.recommenders.models_2.1.9.v20140917-1240.jar:na] + at org.eclipse.recommenders.models.rcp.advisors.EclipseMavenCentralFingerprintSearchAdvisor.suggest(EclipseMavenCentralFingerprintSearchAdvisor.java:55) [org.eclipse.recommenders.models.rcp_2.1.9.v20140917-1240.jar:na] + at org.eclipse.recommenders.models.advisors.ProjectCoordinateAdvisorService.suggest(ProjectCoordinateAdvisorService.java:52) [org.eclipse.recommenders.models_2.1.9.v20140917-1240.jar:na] + at org.eclipse.recommenders.internal.models.rcp.EclipseProjectCoordinateAdvisorService$2.load(EclipseProjectCoordinateAdvisorService.java:101) [org.eclipse.recommenders.models.rcp_2.1.9.v20140917-1240.jar:na] + at org.eclipse.recommenders.internal.models.rcp.EclipseProjectCoordinateAdvisorService$2.load(EclipseProjectCoordinateAdvisorService.java:1) [org.eclipse.recommenders.models.rcp_2.1.9.v20140917-1240.jar:na] + at com.google.common.cache.CacheLoader.reload(CacheLoader.java:94) [com.google.guava_15.0.0.v201403281430.jar:na] + at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3525) [com.google.guava_15.0.0.v201403281430.jar:na] + at com.google.common.cache.LocalCache$Segment.loadAsync(LocalCache.java:2321) [com.google.guava_15.0.0.v201403281430.jar:na] + at com.google.common.cache.LocalCache$Segment.refresh(LocalCache.java:2385) [com.google.guava_15.0.0.v201403281430.jar:na] + at com.google.common.cache.LocalCache.refresh(LocalCache.java:4085) [com.google.guava_15.0.0.v201403281430.jar:na] + at com.google.common.cache.LocalCache$LocalLoadingCache.refresh(LocalCache.java:4825) [com.google.guava_15.0.0.v201403281430.jar:na] + at org.eclipse.recommenders.internal.models.rcp.EclipseProjectCoordinateAdvisorService$RefreshProjectCoordinatesJob.run(EclipseProjectCoordinateAdvisorService.java:209) [org.eclipse.recommenders.models.rcp_2.1.9.v20140917-1240.jar:na] + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) [org.eclipse.core.jobs_3.6.0.v20140424-0053.jar:na] +Caused by: java.net.SocketTimeoutException: Read timed out + at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.8.0_25] + at java.net.SocketInputStream.read(Unknown Source) ~[na:1.8.0_25] + at java.net.SocketInputStream.read(Unknown Source) ~[na:1.8.0_25] + at java.io.BufferedInputStream.fill(Unknown Source) ~[na:1.8.0_25] + at java.io.BufferedInputStream.read(Unknown Source) ~[na:1.8.0_25] + at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) ~[org.apache.commons.httpclient_3.1.0.v201012070820.jar:na] + at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:424) ~[org.apache.solr.client.solrj_3.5.0.v20120530-0900.jar:na] + ... 17 common frames omitted +2014-12-28 23:16:22,132 [Start Help Server] INFO org.eclipse.jetty.server.Server - jetty-8.1.14.v20131031 +2014-12-28 23:16:22,458 [Start Help Server] INFO o.e.jetty.server.AbstractConnector - Started SelectChannelConnector@127.0.0.1:51761 +2015-01-02 05:55:19,774 [Start Help Server] INFO org.eclipse.jetty.server.Server - jetty-8.1.14.v20131031 +2015-01-02 05:55:20,178 [Start Help Server] INFO o.e.jetty.server.AbstractConnector - Started SelectChannelConnector@127.0.0.1:54156 +2015-01-25 16:18:09,146 [Start Help Server] INFO org.eclipse.jetty.server.Server - jetty-8.1.14.v20131031 +2015-01-25 16:18:09,396 [Start Help Server] INFO o.e.jetty.server.AbstractConnector - Started SelectChannelConnector@127.0.0.1:52874 +2015-01-25 18:29:31,438 [Stop Help Server] INFO o.e.j.server.handler.ContextHandler - stopped o.e.j.s.ServletContextHandler{/help,null} +2015-01-25 20:52:48,048 [Start Help Server] INFO org.eclipse.jetty.server.Server - jetty-8.1.14.v20131031 +2015-01-25 20:52:48,205 [Start Help Server] INFO o.e.jetty.server.AbstractConnector - Started SelectChannelConnector@127.0.0.1:54278 +2015-01-29 21:22:40,304 [Start Help Server] INFO org.eclipse.jetty.server.Server - jetty-8.1.14.v20131031 +2015-01-29 21:22:40,623 [Start Help Server] INFO o.e.jetty.server.AbstractConnector - Started SelectChannelConnector@127.0.0.1:60169 +2015-01-30 02:16:13,345 [Stop Help Server] INFO o.e.j.server.handler.ContextHandler - stopped o.e.j.s.ServletContextHandler{/help,null} +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} diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.5.0.20140606-0033.xml b/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.5.0.20140606-0033.xml new file mode 100644 index 0000000..e33758c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.5.0.20140606-0033.xml @@ -0,0 +1,43 @@ + + + + %date [%thread] %-5level %logger{35} - %msg%n + + + OFF + + + + + ${org.eclipse.m2e.log.dir}/0.log + + ${org.eclipse.m2e.log.dir}/%i.log + 1 + 10 + + + 100MB + + + %date [%thread] %-5level %logger{35} - %msg%n + + + + + + WARN + + + + + + + + + + + + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.mylyn.bugzilla.core/repositoryConfigurations b/eclipse/.metadata/.plugins/org.eclipse.mylyn.bugzilla.core/repositoryConfigurations new file mode 100644 index 0000000..f570878 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.mylyn.bugzilla.core/repositoryConfigurations differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.mylyn.bugzilla.ui/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.mylyn.bugzilla.ui/dialog_settings.xml new file mode 100644 index 0000000..9e311b6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.mylyn.bugzilla.ui/dialog_settings.xml @@ -0,0 +1,5 @@ + +
+
+
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.mylyn.tasks.ui/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.mylyn.tasks.ui/dialog_settings.xml new file mode 100644 index 0000000..849da36 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.mylyn.tasks.ui/dialog_settings.xml @@ -0,0 +1,5 @@ + +
+
+
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties b/eclipse/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties new file mode 100644 index 0000000..f116875 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties @@ -0,0 +1,2 @@ +#Cached timestamps +#Fri Sep 26 21:15:38 EEST 2014 diff --git a/eclipse/.metadata/.plugins/org.eclipse.search/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.search/dialog_settings.xml new file mode 100644 index 0000000..28302d6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.search/dialog_settings.xml @@ -0,0 +1,169 @@ + +
+
+ +
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + +
+
+ + + + + + + + + + +
+
+ + + + + + + + + + +
+
+ + + + + + + + + + +
+
+ +
+
+ + + + + + + + + + +
+
+ + + + + + + + + + +
+
+ + + + + + + + + + +
+
+ + + + + + + + + + +
+
+ + + + + + + + + + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + +
+
+ + + + + +
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.ui.editors/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.ui.editors/dialog_settings.xml new file mode 100644 index 0000000..50f1edb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ui.editors/dialog_settings.xml @@ -0,0 +1,5 @@ + +
+
+
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml new file mode 100644 index 0000000..4718892 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml @@ -0,0 +1,11 @@ + +
+
+ + +
+
+ + +
+
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 new file mode 100644 index 0000000..ba4c48b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ui.workbench.texteditor/dialog_settings.xml @@ -0,0 +1,38 @@ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + +
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml new file mode 100644 index 0000000..434b773 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml @@ -0,0 +1,19 @@ + +
+
+ + +
+
+ + + + + + + + + + +
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml new file mode 100644 index 0000000..fa4cc6e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/variablesAndContainers.dat b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/variablesAndContainers.dat new file mode 100644 index 0000000..3f8e74c Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/variablesAndContainers.dat differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties b/eclipse/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties new file mode 100644 index 0000000..7275930 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties @@ -0,0 +1,3 @@ +# +#Wed Oct 29 13:44:38 GMT 2014 +task-tag-projects-already-scanned=Minecraft diff --git a/eclipse/.metadata/.plugins/org.eclipse.wst.xml.ui/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.wst.xml.ui/dialog_settings.xml new file mode 100644 index 0000000..e11d0c6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.wst.xml.ui/dialog_settings.xml @@ -0,0 +1,5 @@ + +
+
+
+
diff --git a/eclipse/.metadata/version.ini b/eclipse/.metadata/version.ini new file mode 100644 index 0000000..55add6e --- /dev/null +++ b/eclipse/.metadata/version.ini @@ -0,0 +1,3 @@ +#Sun Mar 22 11:23:27 GMT 2015 +org.eclipse.core.runtime=2 +org.eclipse.platform=4.4.0.v20140925-0400 -- cgit v1.2.3