diff --git a/assets/hbm/models/bale.obj b/assets/hbm/models/bale.obj new file mode 100644 index 000000000..10e0a45a8 --- /dev/null +++ b/assets/hbm/models/bale.obj @@ -0,0 +1,535 @@ +# Blender v2.76 (sub 0) OBJ File: 'bale.blend' +# www.blender.org +o Cylinder +v 0.000000 1.000000 -0.500000 +v 0.000000 1.000000 0.750000 +v 0.250000 0.933013 -0.500000 +v 0.250000 0.933013 0.750000 +v 0.433013 0.750000 -0.500000 +v 0.433013 0.750000 0.750000 +v 0.500000 0.500000 -0.500000 +v 0.500000 0.500000 0.750000 +v 0.433013 0.250000 -0.500000 +v 0.433013 0.250000 0.750000 +v 0.250000 0.066987 -0.500000 +v 0.250000 0.066987 0.750000 +v 0.000000 -0.000000 -0.500000 +v 0.000000 0.000000 0.750000 +v -0.250000 0.066987 -0.500000 +v -0.250000 0.066987 0.750000 +v -0.433013 0.250000 -0.500000 +v -0.433013 0.250000 0.750000 +v -0.500000 0.500000 -0.500000 +v -0.500000 0.500000 0.750000 +v -0.433013 0.750000 -0.500000 +v -0.433013 0.750000 0.750000 +v -0.250000 0.933012 -0.500000 +v -0.250000 0.933013 0.750000 +v 0.187500 0.824760 1.000000 +v 0.000000 0.875000 1.000000 +v 0.324760 0.687500 1.000000 +v 0.375000 0.500000 1.000000 +v 0.324760 0.312500 1.000000 +v 0.187500 0.175241 1.000000 +v 0.000000 0.125000 1.000000 +v -0.187500 0.175241 1.000000 +v -0.324759 0.312500 1.000000 +v -0.375000 0.500000 1.000000 +v -0.324760 0.687500 1.000000 +v -0.187500 0.824759 1.000000 +v 0.000000 0.500000 1.150000 +v 0.000000 0.825000 -1.150000 +v 0.162500 0.781458 -1.150000 +v 0.281458 0.662500 -1.150000 +v 0.325000 0.500000 -1.150000 +v 0.281458 0.337500 -1.150000 +v 0.162500 0.218542 -1.150000 +v 0.000000 0.175000 -1.150000 +v -0.162500 0.218542 -1.150000 +v -0.281458 0.337500 -1.150000 +v -0.325000 0.500000 -1.150000 +v -0.281458 0.662500 -1.150000 +v -0.162500 0.781458 -1.150000 +v -0.500000 0.075000 -0.950000 +v 0.500000 0.075000 -0.950000 +v -0.500000 0.925000 -0.950000 +v 0.500000 0.925000 -0.950000 +v -0.425000 0.000000 -0.950000 +v 0.425000 0.000000 -0.950000 +v -0.425000 1.000000 -0.950000 +v 0.425000 1.000000 -0.950000 +v -0.425000 0.925000 -0.950000 +v 0.425000 0.925000 -0.950000 +v -0.425000 0.075000 -0.950000 +v 0.425000 0.075000 -0.950000 +v -0.500000 0.925000 -1.200000 +v -0.500000 0.075000 -1.200000 +v 0.425000 0.925000 -1.200000 +v 0.425000 0.075000 -1.200000 +v 0.500000 0.075000 -1.200000 +v 0.500000 0.925000 -1.200000 +v -0.425000 0.925000 -1.200000 +v -0.425000 0.075000 -1.200000 +v -0.425000 -0.000000 -1.200000 +v 0.425000 -0.000000 -1.200000 +v 0.425000 1.000000 -1.200000 +v -0.425000 1.000000 -1.200000 +v -0.459619 0.075736 -1.000000 +v 0.424264 0.959619 -1.000000 +v -0.459619 0.075736 -1.150000 +v 0.424264 0.959619 -1.150000 +v -0.424264 0.040381 -1.000000 +v 0.459619 0.924264 -1.000000 +v -0.424264 0.040381 -1.150000 +v 0.459619 0.924264 -1.150000 +v 0.000000 0.825000 -1.200000 +v 0.162500 0.781458 -1.200000 +v 0.281458 0.662500 -1.200000 +v 0.325000 0.500000 -1.200000 +v 0.281458 0.337500 -1.200000 +v 0.162500 0.218542 -1.200000 +v 0.000000 0.175000 -1.200000 +v -0.162500 0.218542 -1.200000 +v -0.281458 0.337500 -1.200000 +v -0.325000 0.500000 -1.200000 +v -0.281458 0.662500 -1.200000 +v -0.162500 0.781458 -1.200000 +v -0.424264 0.959619 -1.000000 +v 0.459619 0.075736 -1.000000 +v -0.424264 0.959619 -1.150000 +v 0.459619 0.075736 -1.150000 +v -0.459619 0.924264 -1.000000 +v 0.424264 0.040381 -1.000000 +v -0.459619 0.924264 -1.150000 +v 0.424264 0.040381 -1.150000 +vt 0.788698 0.361775 +vt 0.510343 0.361775 +vt 0.510343 0.304140 +vt 0.510343 0.246505 +vt 0.788698 0.246505 +vt 0.510343 0.188870 +vt 0.788698 0.188870 +vt 0.510343 0.131235 +vt 0.510343 0.073600 +vt 0.788698 0.073600 +vt 0.510343 0.015964 +vt 0.788698 0.015964 +vt 0.788698 0.707585 +vt 0.510343 0.707585 +vt 0.510343 0.649950 +vt 0.788698 0.649950 +vt 0.510343 0.592315 +vt 0.510343 0.534680 +vt 0.788698 0.534680 +vt 0.510343 0.477045 +vt 0.788698 0.477045 +vt 0.448519 0.124030 +vt 0.448519 0.080804 +vt 0.510343 0.419410 +vt 0.788698 0.419410 +vt 0.938258 0.198956 +vt 0.938258 0.236419 +vt 0.448519 0.181665 +vt 0.448519 0.138439 +vt 0.448519 0.412206 +vt 0.448519 0.354571 +vt 0.448519 0.311344 +vt 0.448519 0.239300 +vt 0.448519 0.196074 +vt 0.448519 0.469841 +vt 0.448519 0.296935 +vt 0.448519 0.253709 +vt 0.448519 0.527476 +vt 0.448519 0.484250 +vt 0.448519 0.585111 +vt 0.448519 0.541885 +vt 0.448519 0.642746 +vt 0.448519 0.599520 +vt 0.448519 0.700381 +vt 0.448519 0.657155 +vt 0.448519 0.066395 +vt 0.361215 0.678768 +vt 0.361214 0.621133 +vt 0.361215 0.563498 +vt 0.361215 0.505863 +vt 0.361215 0.448228 +vt 0.448519 0.426615 +vt 0.361215 0.390593 +vt 0.448519 0.368979 +vt 0.361215 0.332957 +vt 0.448519 0.023169 +vt 0.361215 0.044782 +vt 0.361214 0.102417 +vt 0.361215 0.160052 +vt 0.361215 0.217687 +vt 0.361215 0.275322 +vt 0.938258 0.141321 +vt 0.949392 0.141321 +vt 0.949392 0.178784 +vt 0.938258 0.429496 +vt 0.938258 0.466959 +vt 0.788698 0.304140 +vt 0.938258 0.256591 +vt 0.938258 0.487131 +vt 0.788698 0.592315 +vt 0.938258 0.544766 +vt 0.938258 0.602401 +vt 0.938258 0.639864 +vt 0.938258 0.660037 +vt 0.938258 0.697499 +vt 0.938258 0.026051 +vt 0.938258 0.063514 +vt 0.938258 0.083686 +vt 0.938258 0.121149 +vt 0.788698 0.131235 +vt 0.938258 0.178784 +vt 0.938258 0.371861 +vt 0.938258 0.409324 +vt 0.938258 0.314226 +vt 0.938258 0.351689 +vt 0.680346 0.943229 +vt 0.680346 0.959931 +vt 0.491064 0.959931 +vt 0.680346 0.753947 +vt 0.491064 0.753947 +vt 0.491064 0.737246 +vt 0.491064 0.943229 +vt 0.474362 0.943229 +vt 0.474362 0.753947 +vt 0.697047 0.753947 +vt 0.680346 0.737246 +vt 0.697047 0.943229 +vt 0.932691 0.959931 +vt 0.743409 0.959931 +vt 0.743409 0.943229 +vt 0.932691 0.737246 +vt 0.932691 0.753947 +vt 0.743409 0.753947 +vt 0.949392 0.753947 +vt 0.949392 0.943229 +vt 0.932691 0.943229 +vt 0.726707 0.753947 +vt 0.743409 0.737246 +vt 0.726707 0.943229 +vt 0.190552 0.394528 +vt 0.190552 0.205246 +vt 0.246223 0.205246 +vt 0.331554 0.228866 +vt 0.275883 0.228866 +vt 0.275883 0.205247 +vt 0.331554 0.418148 +vt 0.275883 0.418148 +vt 0.331554 0.631049 +vt 0.275883 0.631049 +vt 0.275883 0.441767 +vt 0.190551 0.015964 +vt 0.246223 0.015964 +vt 0.331554 0.867570 +vt 0.275883 0.867570 +vt 0.275883 0.843951 +vt 0.190552 0.583811 +vt 0.246223 0.583811 +vt 0.246223 0.773093 +vt 0.331554 0.654669 +vt 0.275883 0.654669 +vt 0.331554 0.205247 +vt 0.275883 0.015964 +vt 0.331554 0.843951 +vt 0.331554 0.441767 +vt 0.246223 0.394528 +vt 0.053199 0.941767 +vt 0.331554 0.941767 +vt 0.331554 0.975170 +vt 0.053199 0.930633 +vt 0.331554 0.930633 +vt 0.053198 0.897230 +vt 0.331554 0.897230 +vt 0.053199 0.975170 +vt 0.331554 0.986304 +vt 0.127488 0.015964 +vt 0.127488 0.294321 +vt 0.116354 0.294321 +vt 0.116354 0.015964 +vt 0.082952 0.294321 +vt 0.039809 0.445063 +vt 0.142160 0.342712 +vt 0.160891 0.412619 +vt 0.949392 0.429496 +vt 0.949392 0.466959 +vt 0.949392 0.314226 +vt 0.949392 0.351689 +vt 0.949392 0.602401 +vt 0.949392 0.639864 +vt 0.949392 0.083686 +vt 0.949392 0.121149 +vt 0.949392 0.371861 +vt 0.949392 0.409324 +vt 0.949392 0.256591 +vt 0.949392 0.294054 +vt 0.949392 0.544766 +vt 0.949392 0.582229 +vt 0.949392 0.026051 +vt 0.949392 0.198956 +vt 0.949392 0.236419 +vt 0.949392 0.487131 +vt 0.949392 0.524594 +vt 0.949392 0.660037 +vt 0.949392 0.697499 +vt 0.160891 0.015964 +vt 0.160891 0.294321 +vt 0.082951 0.015964 +vt 0.071817 0.294321 +vt 0.938258 0.294054 +vt 0.938258 0.524594 +vt 0.938258 0.582229 +vt 0.190551 0.773093 +vt 0.331554 0.015964 +vt 0.053199 0.986304 +vt 0.142160 0.445063 +vt 0.109716 0.463794 +vt 0.072253 0.463794 +vt 0.021078 0.412619 +vt 0.021078 0.375156 +vt 0.039809 0.342712 +vt 0.072253 0.323981 +vt 0.109716 0.323981 +vt 0.160891 0.375156 +vt 0.949392 0.063513 +vt 0.071817 0.015964 +vn 0.258800 0.965900 0.000000 +vn 0.707100 0.707100 0.000000 +vn 0.965900 0.258800 0.000000 +vn 0.965900 -0.258800 0.000000 +vn 0.707100 -0.707100 0.000000 +vn 0.258800 -0.965900 0.000000 +vn -0.258800 -0.965900 0.000000 +vn -0.707100 -0.707100 0.000000 +vn -0.965900 -0.258800 0.000000 +vn -0.965900 0.258800 -0.000000 +vn 0.636700 -0.636700 0.434900 +vn -0.258800 0.965900 -0.000000 +vn -0.707100 0.707100 -0.000000 +vn 0.934800 0.250500 -0.251700 +vn 0.869800 -0.233100 0.434900 +vn -0.233100 0.869800 0.434900 +vn 0.233100 0.869800 0.434900 +vn 0.869800 0.233100 0.434900 +vn -0.636700 0.636700 0.434900 +vn 0.636700 0.636700 0.434900 +vn -0.869800 0.233100 0.434900 +vn -0.869800 -0.233100 0.434900 +vn -0.636700 -0.636700 0.434900 +vn -0.233100 -0.869800 0.434900 +vn 0.233100 -0.869800 0.434900 +vn -0.099000 -0.369600 0.923900 +vn -0.270500 -0.270500 0.923900 +vn -0.369600 -0.099000 0.923900 +vn -0.369600 0.099000 0.923900 +vn -0.270500 0.270500 0.923900 +vn -0.099000 0.369600 0.923900 +vn 0.099000 0.369600 0.923900 +vn 0.099000 -0.369600 0.923900 +vn 0.270500 -0.270500 0.923900 +vn 0.369600 -0.099000 0.923900 +vn 0.369600 0.099000 0.923900 +vn 0.270500 0.270500 0.923900 +vn -0.684300 0.684300 -0.251700 +vn 0.684300 0.684300 -0.251700 +vn -0.934800 0.250500 -0.251700 +vn -0.934800 -0.250500 -0.251700 +vn -0.684300 -0.684300 -0.251700 +vn -0.250500 -0.934800 -0.251700 +vn 0.250500 -0.934800 -0.251700 +vn 0.684300 -0.684300 -0.251700 +vn 0.934800 -0.250500 -0.251700 +vn -0.250500 0.934800 -0.251700 +vn 0.250500 0.934800 -0.251700 +vn 0.000000 0.000000 1.000000 +vn 0.000000 -0.000000 -1.000000 +vn 1.000000 0.000000 0.000000 +vn -1.000000 0.000000 0.000000 +vn 0.000000 1.000000 0.000000 +vn 0.000000 -1.000000 0.000000 +s off +f 1/1/1 2/2/1 4/3/1 +f 4/3/2 6/4/2 5/5/2 +f 5/5/3 6/4/3 8/6/3 +f 7/7/4 8/6/4 10/8/4 +f 10/8/5 12/9/5 11/10/5 +f 12/9/6 14/11/6 13/12/6 +f 13/13/7 14/14/7 16/15/7 +f 15/16/8 16/15/8 18/17/8 +f 18/17/9 20/18/9 19/19/9 +f 20/18/10 22/20/10 21/21/10 +f 10/8/11 29/22/11 30/23/11 +f 24/24/12 2/2/12 1/1/12 +f 22/20/13 24/24/13 23/25/13 +f 7/7/14 41/26/14 40/27/14 +f 8/6/15 28/28/15 29/29/15 +f 2/2/16 24/24/16 36/30/16 +f 2/2/17 26/31/17 25/32/17 +f 6/4/18 27/33/18 28/34/18 +f 24/24/19 22/20/19 35/35/19 +f 4/3/20 25/36/20 27/37/20 +f 20/18/21 34/38/21 35/39/21 +f 18/17/22 33/40/22 34/41/22 +f 16/15/23 32/42/23 33/43/23 +f 14/14/24 31/44/24 32/45/24 +f 14/11/25 12/9/25 30/46/25 +f 31/44/26 37/47/26 32/45/26 +f 32/42/27 37/48/27 33/43/27 +f 33/40/28 37/49/28 34/41/28 +f 34/38/29 37/50/29 35/39/29 +f 35/35/30 37/51/30 36/52/30 +f 36/30/31 37/53/31 26/54/31 +f 26/31/32 37/55/32 25/32/32 +f 31/56/33 30/46/33 37/57/33 +f 29/22/34 37/58/34 30/23/34 +f 28/28/35 37/59/35 29/29/35 +f 27/33/36 37/60/36 28/34/36 +f 25/36/37 37/61/37 27/37/37 +f 42/62/4 86/63/4 85/64/4 +f 23/25/38 49/65/38 48/66/38 +f 3/67/39 5/5/39 40/68/39 +f 19/19/40 21/21/40 48/69/40 +f 17/70/41 19/19/41 47/71/41 +f 17/70/42 46/72/42 45/73/42 +f 15/16/43 45/74/43 44/75/43 +f 13/12/44 44/76/44 43/77/44 +f 11/10/45 43/78/45 42/79/45 +f 9/80/46 42/62/46 41/81/46 +f 1/1/47 38/82/47 49/83/47 +f 3/67/48 39/84/48 38/85/48 +f 61/86/49 51/87/49 53/88/49 +f 60/89/49 58/90/49 52/91/49 +f 59/92/49 57/93/49 56/94/49 +f 53/88/49 57/93/49 59/92/49 +f 56/94/49 52/91/49 58/90/49 +f 54/95/49 60/89/49 50/96/49 +f 51/87/49 61/86/49 55/97/49 +f 60/89/49 54/95/49 55/97/49 +f 67/98/50 66/99/50 65/100/50 +f 62/101/50 68/102/50 69/103/50 +f 73/104/50 72/105/50 64/106/50 +f 67/98/50 64/106/50 72/105/50 +f 73/104/50 68/102/50 62/101/50 +f 70/107/50 63/108/50 69/103/50 +f 66/99/50 71/109/50 65/100/50 +f 71/109/50 70/107/50 69/103/50 +f 58/110/51 60/111/51 69/112/51 +f 50/113/8 63/114/8 70/115/8 +f 52/116/52 62/117/52 63/114/52 +f 57/118/53 72/119/53 73/120/53 +f 61/121/53 65/122/53 69/112/53 +f 55/123/5 71/124/5 66/125/5 +f 59/126/52 64/127/52 65/128/52 +f 53/129/2 67/130/2 72/119/2 +f 54/131/54 70/115/54 71/132/54 +f 53/129/51 51/133/51 66/125/51 +f 56/134/13 73/120/13 62/117/13 +f 58/110/54 68/135/54 64/127/54 +f 77/136/13 76/137/13 74/138/13 +f 81/139/50 80/140/50 76/137/50 +f 79/141/5 78/142/5 80/140/5 +f 75/143/49 74/138/49 78/144/49 +f 101/145/50 100/146/50 96/147/50 +f 97/148/2 96/147/2 94/149/2 +f 85/150/50 91/151/50 93/152/50 +f 49/65/13 93/153/13 92/154/13 +f 39/84/1 83/155/1 82/156/1 +f 46/72/8 90/157/8 89/158/8 +f 43/78/5 87/159/5 86/160/5 +f 38/82/12 82/161/12 93/162/12 +f 40/68/2 84/163/2 83/164/2 +f 47/71/9 91/165/9 90/166/9 +f 43/77/6 44/76/6 88/167/6 +f 41/26/3 85/168/3 84/169/3 +f 48/69/10 92/170/10 91/171/10 +f 45/74/7 89/172/7 88/173/7 +f 99/174/8 98/175/8 100/146/8 +f 95/176/49 94/149/49 98/177/49 +f 3/67/1 1/1/1 4/3/1 +f 3/67/2 4/3/2 5/5/2 +f 7/7/3 5/5/3 8/6/3 +f 9/80/4 7/7/4 10/8/4 +f 9/80/5 10/8/5 11/10/5 +f 11/10/6 12/9/6 13/12/6 +f 15/16/7 13/13/7 16/15/7 +f 17/70/8 15/16/8 18/17/8 +f 17/70/9 18/17/9 19/19/9 +f 19/19/10 20/18/10 21/21/10 +f 12/9/11 10/8/11 30/23/11 +f 23/25/12 24/24/12 1/1/12 +f 21/21/13 22/20/13 23/25/13 +f 5/5/14 7/7/14 40/27/14 +f 10/8/15 8/6/15 29/29/15 +f 26/54/16 2/2/16 36/30/16 +f 4/3/17 2/2/17 25/32/17 +f 8/6/18 6/4/18 28/34/18 +f 36/52/19 24/24/19 35/35/19 +f 6/4/20 4/3/20 27/37/20 +f 22/20/21 20/18/21 35/39/21 +f 20/18/22 18/17/22 34/41/22 +f 18/17/23 16/15/23 33/43/23 +f 16/15/24 14/14/24 32/45/24 +f 31/56/25 14/11/25 30/46/25 +f 41/81/4 42/62/4 85/64/4 +f 21/21/38 23/25/38 48/66/38 +f 39/178/39 3/67/39 40/68/39 +f 47/179/40 19/19/40 48/69/40 +f 46/180/41 17/70/41 47/71/41 +f 15/16/42 17/70/42 45/73/42 +f 13/13/43 15/16/43 44/75/43 +f 11/10/44 13/12/44 43/77/44 +f 9/80/45 11/10/45 42/79/45 +f 7/7/46 9/80/46 41/81/46 +f 23/25/47 1/1/47 49/83/47 +f 1/1/48 3/67/48 38/85/48 +f 59/92/49 61/86/49 53/88/49 +f 50/96/49 60/89/49 52/91/49 +f 58/90/49 59/92/49 56/94/49 +f 61/86/49 60/89/49 55/97/49 +f 64/106/50 67/98/50 65/100/50 +f 63/108/50 62/101/50 69/103/50 +f 68/102/50 73/104/50 64/106/50 +f 65/100/50 71/109/50 69/103/50 +f 68/135/51 58/110/51 69/112/51 +f 54/131/8 50/113/8 70/115/8 +f 50/113/52 52/116/52 63/114/52 +f 56/134/53 57/118/53 73/120/53 +f 60/111/53 61/121/53 69/112/53 +f 51/133/5 55/123/5 66/125/5 +f 61/181/52 59/126/52 65/128/52 +f 57/118/2 53/129/2 72/119/2 +f 55/182/54 54/131/54 71/132/54 +f 67/130/51 53/129/51 66/125/51 +f 52/116/13 56/134/13 62/117/13 +f 59/126/54 58/110/54 64/127/54 +f 75/143/13 77/136/13 74/138/13 +f 77/136/50 81/139/50 76/137/50 +f 81/139/5 79/141/5 80/140/5 +f 79/183/49 75/143/49 78/144/49 +f 97/148/50 101/145/50 96/147/50 +f 95/176/2 97/148/2 94/149/2 +f 93/152/50 82/184/50 85/150/50 +f 83/185/50 84/186/50 85/150/50 +f 85/150/50 86/187/50 87/188/50 +f 87/188/50 88/189/50 89/190/50 +f 89/190/50 90/191/50 91/151/50 +f 91/151/50 92/192/50 93/152/50 +f 82/184/50 83/185/50 85/150/50 +f 85/150/50 87/188/50 89/190/50 +f 89/190/50 91/151/50 85/150/50 +f 48/66/13 49/65/13 92/154/13 +f 38/85/1 39/84/1 82/156/1 +f 45/73/8 46/72/8 89/158/8 +f 42/79/5 43/78/5 86/160/5 +f 49/83/12 38/82/12 93/162/12 +f 39/178/2 40/68/2 83/164/2 +f 46/180/9 47/71/9 90/166/9 +f 87/193/6 43/77/6 88/167/6 +f 40/27/3 41/26/3 84/169/3 +f 47/179/10 48/69/10 91/171/10 +f 44/75/7 45/74/7 88/173/7 +f 101/145/8 99/174/8 100/146/8 +f 99/194/49 95/176/49 98/177/49 diff --git a/assets/hbm/textures/models/bale.png b/assets/hbm/textures/models/bale.png new file mode 100644 index 000000000..908a0480f Binary files /dev/null and b/assets/hbm/textures/models/bale.png differ diff --git a/com/hbm/entity/projectile/EntityBulletBase.java b/com/hbm/entity/projectile/EntityBulletBase.java index 0b20a6151..e1b4395ae 100644 --- a/com/hbm/entity/projectile/EntityBulletBase.java +++ b/com/hbm/entity/projectile/EntityBulletBase.java @@ -1,26 +1,90 @@ package com.hbm.entity.projectile; +import com.hbm.handler.BulletConfiguration; + import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IProjectile; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class EntityBulletBase extends Entity implements IProjectile { + + private BulletConfiguration config; + private EntityLivingBase shooter; - public EntityBulletBase(World p_i1582_1_) { - super(p_i1582_1_); + private EntityBulletBase(World world) { super(world); } + + private EntityBulletBase(World world, BulletConfiguration config) { + super(world); + this.config = config; + + this.setSize(0.5F, 0.5F); + } + + public EntityBulletBase(World world, BulletConfiguration config, EntityLivingBase entity, float vel) { + super(world); + this.config = config; + shooter = entity; + + this.setLocationAndAngles(entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ, entity.rotationYaw, entity.rotationPitch); + + this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.posY -= 0.10000000149011612D; + this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.setPosition(this.posX, this.posY, this.posZ); + + this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI); + this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI); + this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI)); + + this.setSize(0.5F, 0.5F); } @Override - public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, - float p_70186_8_) { - // TODO Auto-generated method stub + public void setThrowableHeading(double moX, double moY, double moZ, float mult1, float mult2) { + + float deviation = 0; + + if(config != null) + deviation = config.spread; + + float f2 = MathHelper.sqrt_double(moX * moX + moY * moY + moZ * moZ); + moX /= f2; + moY /= f2; + moZ /= f2; + moX += this.rand.nextGaussian() * /*(this.rand.nextBoolean() ? -1 : 1) **/ deviation * mult2; + moY += this.rand.nextGaussian() * /*(this.rand.nextBoolean() ? -1 : 1) **/ deviation * mult2; + moZ += this.rand.nextGaussian() * /*(this.rand.nextBoolean() ? -1 : 1) **/ deviation * mult2; + moX *= mult1; + moY *= mult1; + moZ *= mult1; + this.motionX = moX; + this.motionY = moY; + this.motionZ = moZ; + + float f3 = MathHelper.sqrt_double(moX * moX + moZ * moZ); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(moX, moZ) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(moY, f3) * 180.0D / Math.PI); } @Override protected void entityInit() { - // TODO Auto-generated method stub + //style + this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + } + + @Override + public void onUpdate() { + + super.onUpdate(); + + if(config == null) { + this.setDead(); + return; + } } diff --git a/com/hbm/handler/BulletConfiguration.java b/com/hbm/handler/BulletConfiguration.java index 4018dfa08..2be584a36 100644 --- a/com/hbm/handler/BulletConfiguration.java +++ b/com/hbm/handler/BulletConfiguration.java @@ -1,11 +1,16 @@ package com.hbm.handler; +import java.util.List; + import net.minecraft.item.Item; +import net.minecraft.potion.PotionEffect; public class BulletConfiguration { //what item this specific configuration consumes public Item ammo; + //spread of bullets in gaussian range + public float spread; //damage bounds public float dmgMin; @@ -13,6 +18,8 @@ public class BulletConfiguration { //acceleration torwards neg Y public double gravity; + //max age in ticks before despawning + public int maxAge; //whether the projectile should be able to bounce off of blocks public boolean doesRicochet; @@ -25,18 +32,18 @@ public class BulletConfiguration { public boolean doesBreakGlass; //bullet effects + public List effects; public int incendiary; - public int poison; - public int wither; public int emp; - public int stun; public int explosive; public int rainbow; public int nuke; public boolean boxcar; public boolean destroysBlocks; - //appearance for rendering + //appearance public int style; + //0: no plinking, 1: bullet plink, 2: grenade plink + public int plink; } diff --git a/com/hbm/handler/GunConfigFactory.java b/com/hbm/handler/GunConfigFactory.java new file mode 100644 index 000000000..0322a2a04 --- /dev/null +++ b/com/hbm/handler/GunConfigFactory.java @@ -0,0 +1,55 @@ +package com.hbm.handler; + +import java.util.ArrayList; + +import com.hbm.items.ModItems; + +public class GunConfigFactory { + + public static GunConfiguration getRevolverConfig() { + + BulletConfiguration bullet = new BulletConfiguration(); + + bullet.ammo = ModItems.gun_revolver_lead_ammo; + bullet.spread = 0F; + bullet.dmgMin = 15; + bullet.dmgMax = 17; + bullet.gravity = 0D; + bullet.maxAge = 100; + bullet.doesRicochet = true; + bullet.ricochetAngle = 15; + bullet.doesPenetrate = true; + bullet.doesBreakGlass = true; + bullet.incendiary = 0; + bullet.emp = 0; + bullet.rainbow = 0; + bullet.nuke = 0; + bullet.boxcar = false; + bullet.destroysBlocks = false; + bullet.style = 0; + bullet.plink = 1; + + GunConfiguration config = new GunConfiguration(); + + config.rateOfFire = 20; + config.bulletsMin = 1; + config.bulletsMax = 1; + config.gunMode = 0; + config.firingMode = 0; + config.hasReloadAnim = false; + config.hasFiringAnim = false; + config.hasSpinup = false; + config.hasSpindown = false; + config.reloadDuration = 0; + config.firingDuration = 0; + config.ammoCap = 6; + config.reloadType = 1; + config.allowsInfinity = true; + + config.config = new ArrayList(); + config.config.add(bullet); + + return config; + } + +} diff --git a/com/hbm/handler/GunConfiguration.java b/com/hbm/handler/GunConfiguration.java index d3195c52f..64627c6ba 100644 --- a/com/hbm/handler/GunConfiguration.java +++ b/com/hbm/handler/GunConfiguration.java @@ -14,8 +14,6 @@ public class GunConfiguration { public int gunMode; //0 = manual, 1 = automatic public int firingMode; - //spread of bullets in gaussian range - public float spread; //whether or not there is a reload delay animation public boolean hasReloadAnim; diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index 6b07b7140..3beda26bf 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -2,6 +2,7 @@ package com.hbm.items; import com.hbm.blocks.ModBlocks; import com.hbm.handler.BucketHandler; +import com.hbm.handler.GunConfigFactory; import com.hbm.items.bomb.*; import com.hbm.items.food.*; import com.hbm.items.gear.*; @@ -2176,7 +2177,8 @@ public class ModItems { gun_skystinger = new GunStinger().setUnlocalizedName("gun_skystinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_skystinger"); gun_stinger_ammo = new Item().setUnlocalizedName("gun_stinger_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_stinger_ammo"); gun_revolver_ammo = new Item().setUnlocalizedName("gun_revolver_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_ammo"); - gun_revolver = new GunRevolver(gun_revolver_ammo, 10, 25, false, false).setMaxDamage(500).setUnlocalizedName("gun_revolver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver"); + //gun_revolver = new GunRevolver(gun_revolver_ammo, 10, 25, false, false).setMaxDamage(500).setUnlocalizedName("gun_revolver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver"); + gun_revolver = new ItemGunBase(GunConfigFactory.getRevolverConfig()).setUnlocalizedName("gun_revolver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver"); gun_revolver_saturnite = new GunRevolver(gun_revolver_ammo, 20, 35, false, false).setMaxDamage(2500).setUnlocalizedName("gun_revolver_saturnite").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_saturnite"); gun_revolver_iron_ammo = new Item().setUnlocalizedName("gun_revolver_iron_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_iron_ammo"); gun_revolver_iron = new GunRevolver(gun_revolver_iron_ammo, 5, 15, false, false).setMaxDamage(100).setUnlocalizedName("gun_revolver_iron").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_iron"); diff --git a/com/hbm/items/weapon/ItemGunBase.java b/com/hbm/items/weapon/ItemGunBase.java index 03c86688b..37b33cfad 100644 --- a/com/hbm/items/weapon/ItemGunBase.java +++ b/com/hbm/items/weapon/ItemGunBase.java @@ -7,9 +7,12 @@ import org.lwjgl.input.Mouse; import com.hbm.handler.GunConfiguration; import com.hbm.interfaces.IHoldableWeapon; +import com.hbm.packet.GunButtonPacket; +import com.hbm.packet.PacketDispatcher; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; +import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -21,6 +24,15 @@ public class ItemGunBase extends Item implements IHoldableWeapon { private GunConfiguration mainConfig; private GunConfiguration altConfig; + + public ItemGunBase(GunConfiguration config) { + mainConfig = config; + } + + public ItemGunBase(GunConfiguration config, GunConfiguration alt) { + mainConfig = config; + altConfig = alt; + } @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { @@ -30,50 +42,62 @@ public class ItemGunBase extends Item implements IHoldableWeapon { @Override public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isCurrentItem) { - if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) { - - boolean left = getIsMouseDown(stack); - boolean right = getIsAltDown(stack); - + if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT && entity instanceof EntityPlayer && world.isRemote) { + updateClient(stack, world, (EntityPlayer)entity, slot, isCurrentItem); + } else { + updateServer(stack, world, (EntityPlayer)entity, slot, isCurrentItem); + } + + } + + private void updateClient(ItemStack stack, World world, EntityPlayer entity, int slot, boolean isCurrentItem) { + + boolean clickLeft = Mouse.isButtonDown(0); + boolean clickRight = Mouse.isButtonDown(1); + boolean left = getIsMouseDown(stack); + boolean right = getIsAltDown(stack); + + if(isCurrentItem) { if(left && right) { - //TODO: stop both with packet + PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(false, (byte) 0)); + PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(false, (byte) 1)); setIsMouseDown(stack, false); setIsAltDown(stack, false); } if(!left && !right) { - if(Mouse.isButtonDown(0)) { - //TODO: start with packet + if(clickLeft) { + PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(true, (byte) 0)); setIsMouseDown(stack, true); - } else if(Mouse.isButtonDown(0)) { - //TODO: start with packet + } else if(clickRight) { + PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(true, (byte) 1)); setIsAltDown(stack, true); } } - if(left && !Mouse.isButtonDown(0)) { - //TODO: stop with packet + if(left && !clickLeft) { + PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(false, (byte) 0)); setIsMouseDown(stack, false); } - if(right && !Mouse.isButtonDown(1)) { - //TODO: stop with packet + if(right && !clickRight) { + PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(false, (byte) 1)); setIsAltDown(stack, false); } if(mainConfig.reloadType != 0 || (altConfig != null && altConfig.reloadType != 0)) { if(Keyboard.isKeyDown(Keyboard.KEY_R)) { - + PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(true, (byte) 2)); + setIsReloading(stack, true); } - //TODO: reload with packet } - - } else { - } - - } + } + + private void updateServer(ItemStack stack, World world, EntityPlayer entity, int slot, boolean isCurrentItem) { + + } //called every time the gun shoots private void fire(ItemStack stack, World world, EntityPlayer player) { @@ -101,6 +125,16 @@ public class ItemGunBase extends Item implements IHoldableWeapon { } + /*//returns main config from itemstack + public static GunConfiguration extractConfig(ItemStack stack) { + + if(stack != null && stack.getItem() instanceof ItemGunBase) { + return ((ItemGunBase)stack.getItem()).mainConfig; + } + + return null; + }*/ + /// if reloading routine is active /// public static void setIsReloading(ItemStack stack, boolean b) { writeNBT(stack, "isReloading", b ? 1 : 0); @@ -147,11 +181,11 @@ public class ItemGunBase extends Item implements IHoldableWeapon { } /// R/W reload animation timer /// - public static void setReloadAnim(ItemStack stack, int i) { + public static void setReloadCycle(ItemStack stack, int i) { writeNBT(stack, "reload", i); } - public static int getReloadAnim(ItemStack stack) { + public static int getReloadCycle(ItemStack stack) { return readNBT(stack, "reload"); } diff --git a/com/hbm/packet/GunButtonPacket.java b/com/hbm/packet/GunButtonPacket.java new file mode 100644 index 000000000..3fa2a87b0 --- /dev/null +++ b/com/hbm/packet/GunButtonPacket.java @@ -0,0 +1,81 @@ +package com.hbm.packet; + +import com.hbm.explosion.ExplosionLarge; +import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.items.weapon.ItemGunBase; +import com.hbm.saveddata.SatelliteSaveStructure; +import com.hbm.saveddata.SatelliteSavedData; +import com.hbm.tileentity.bomb.TileEntityTurretCIWS; +import com.hbm.tileentity.bomb.TileEntityTurretCheapo; +import com.hbm.tileentity.machine.TileEntityAMSBase; +import com.hbm.tileentity.machine.TileEntityAMSEmitter; +import com.hbm.tileentity.machine.TileEntityAMSLimiter; +import com.hbm.tileentity.machine.TileEntityForceField; +import com.hbm.tileentity.machine.TileEntityMachineDiesel; +import com.hbm.tileentity.machine.TileEntityMachineReactorLarge; +import com.hbm.tileentity.machine.TileEntityMachineReactorSmall; +import com.hbm.tileentity.machine.TileEntityMachineSeleniumEngine; +import com.hbm.tileentity.machine.TileEntityRadioRec; +import com.hbm.tileentity.machine.TileEntityReactorControl; + +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 cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; + +public class GunButtonPacket implements IMessage { + + //true or false, whether or not the key is pressed + boolean state; + //0: [M1] + //1: [M2] + //2: [R] + byte button; + + public GunButtonPacket() { } + + public GunButtonPacket(boolean m1, byte b) { + state = m1; + button = b; + } + + @Override + public void fromBytes(ByteBuf buf) { + state = buf.readBoolean(); + button = buf.readByte(); + } + + @Override + public void toBytes(ByteBuf buf) { + buf.writeBoolean(state); + buf.writeByte(button); + } + + public static class Handler implements IMessageHandler { + + @Override + public IMessage onMessage(GunButtonPacket m, MessageContext ctx) { + + EntityPlayer p = ctx.getServerHandler().playerEntity; + + if(p.getHeldItem() != null && p.getHeldItem().getItem() instanceof ItemGunBase) { + + switch(m.button) { + case 0: ItemGunBase.setIsMouseDown(p.getHeldItem(), m.state); break; + case 1: ItemGunBase.setIsAltDown(p.getHeldItem(), m.state); break; + case 2: ItemGunBase.setIsReloading(p.getHeldItem(), true); break; + } + } + + System.out.println(m.button + ": " + m.state); + + return null; + } + } +} diff --git a/com/hbm/packet/PacketDispatcher.java b/com/hbm/packet/PacketDispatcher.java index 5336f186e..50023ebbb 100644 --- a/com/hbm/packet/PacketDispatcher.java +++ b/com/hbm/packet/PacketDispatcher.java @@ -79,6 +79,8 @@ public class PacketDispatcher { wrapper.registerMessage(TEFFPacket.Handler.class, TEFFPacket.class, i++, Side.CLIENT); //Information packet for the reactor control block wrapper.registerMessage(TEControlPacket.Handler.class, TEControlPacket.class, i++, Side.CLIENT); + //Sends button information for ItemGunBase + wrapper.registerMessage(GunButtonPacket.Handler.class, GunButtonPacket.class, i++, Side.SERVER); } } diff --git a/com/hbm/render/entity/RenderRocket.java b/com/hbm/render/entity/RenderRocket.java index 9999259d4..67a68bb85 100644 --- a/com/hbm/render/entity/RenderRocket.java +++ b/com/hbm/render/entity/RenderRocket.java @@ -4,6 +4,7 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; @@ -40,6 +41,10 @@ public class RenderRocket extends Render { bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/bullet.png")); } miniNuke.renderAll(0.0625F); + + //renderFlechette(); + //renderDart(); + GL11.glPopMatrix(); } @@ -55,5 +60,216 @@ public class RenderRocket extends Render { return null; } + + private void renderFlechette() { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + + GL11.glScalef(1F/16F, 1F/16F, 1F/16F); + GL11.glScalef(-1, 1, 1); + + Tessellator tess = Tessellator.instance; + + //back + GL11.glColor3f(0.15F, 0.15F, 0.15F); + tess.startDrawingQuads(); + tess.addVertex(0, 1, -1); + tess.addVertex(0, -1, -1); + tess.addVertex(0, -1, 1); + tess.addVertex(0, 1, 1); + tess.draw(); + + //base + tess.startDrawingQuads(); + tess.addVertex(1, -0.5, -0.5); + tess.addVertex(0, -1, -1); + tess.addVertex(0, 1, -1); + tess.addVertex(1, 0.5, -0.5); + tess.draw(); + + tess.startDrawingQuads(); + tess.addVertex(0, -1, 1); + tess.addVertex(1, -0.5, 0.5); + tess.addVertex(1, 0.5, 0.5); + tess.addVertex(0, 1, 1); + tess.draw(); + + tess.startDrawingQuads(); + tess.addVertex(0, -1, -1); + tess.addVertex(1, -0.5, -0.5); + tess.addVertex(1, -0.5, 0.5); + tess.addVertex(0, -1, 1); + tess.draw(); + + tess.startDrawingQuads(); + tess.addVertex(1, 0.5, -0.5); + tess.addVertex(0, 1, -1); + tess.addVertex(0, 1, 1); + tess.addVertex(1, 0.5, 0.5); + tess.draw(); + + //pin + tess.startDrawing(4); + tess.addVertex(1, -0.5, -0.5); + tess.addVertex(1, 0.5, -0.5); + tess.addVertex(6, 0, 0); + tess.draw(); + + tess.startDrawing(4); + tess.addVertex(1, -0.5, 0.5); + tess.addVertex(6, 0, 0); + tess.addVertex(1, 0.5, 0.5); + tess.draw(); + + tess.startDrawing(4); + tess.addVertex(1, -0.5, -0.5); + tess.addVertex(6, 0, 0); + tess.addVertex(1, -0.5, 0.5); + tess.draw(); + + tess.startDrawing(4); + tess.addVertex(1, 0.5, -0.5); + tess.addVertex(1, 0.5, 0.5); + tess.addVertex(6, 0, 0); + tess.draw(); + + + GL11.glEnable(GL11.GL_TEXTURE_2D); + + GL11.glPopMatrix(); + } + + private void renderDart() { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDepthMask(false); + + GL11.glScalef(1F/4F, 1F/8F, 1F/8F); + GL11.glScalef(-1, 1, 1); + + Tessellator tess = Tessellator.instance; + + float red = 0.125F; + float green = 0.0F; + float blue = 1.0F; + + //front + tess.startDrawing(4); + tess.setColorRGBA_F(red, green, blue, 1); + tess.addVertex(6, 0, 0); + tess.setColorRGBA_F(red, green, blue, 0); + tess.addVertex(3, -1, -1); + tess.addVertex(3, 1, -1); + tess.draw(); + + tess.startDrawing(4); + tess.setColorRGBA_F(red, green, blue, 0); + tess.addVertex(3, -1, 1); + tess.setColorRGBA_F(red, green, blue, 1); + tess.addVertex(6, 0, 0); + tess.setColorRGBA_F(red, green, blue, 0); + tess.addVertex(3, 1, 1); + tess.draw(); + + tess.startDrawing(4); + tess.setColorRGBA_F(red, green, blue, 0); + tess.addVertex(3, -1, -1); + tess.setColorRGBA_F(red, green, blue, 1); + tess.addVertex(6, 0, 0); + tess.setColorRGBA_F(red, green, blue, 0); + tess.addVertex(3, -1, 1); + tess.draw(); + + tess.startDrawing(4); + tess.setColorRGBA_F(red, green, blue, 1); + tess.addVertex(6, 0, 0); + tess.setColorRGBA_F(red, green, blue, 0); + tess.addVertex(3, 1, -1); + tess.setColorRGBA_F(red, green, blue, 0); + tess.addVertex(3, 1, 1); + tess.draw(); + + //mid + tess.startDrawing(4); + tess.setColorRGBA_F(red, green, blue, 1); + tess.addVertex(6, 0, 0); + tess.addVertex(4, -0.5, -0.5); + tess.addVertex(4, 0.5, -0.5); + tess.draw(); + + tess.startDrawing(4); + tess.setColorRGBA_F(red, green, blue, 1); + tess.addVertex(4, -0.5, 0.5); + tess.addVertex(6, 0, 0); + tess.addVertex(4, 0.5, 0.5); + tess.draw(); + + tess.startDrawing(4); + tess.setColorRGBA_F(red, green, blue, 1); + tess.addVertex(4, -0.5, -0.5); + tess.addVertex(6, 0, 0); + tess.addVertex(4, -0.5, 0.5); + tess.draw(); + + tess.startDrawing(4); + tess.setColorRGBA_F(red, green, blue, 1); + tess.addVertex(6, 0, 0); + tess.addVertex(4, 0.5, -0.5); + tess.addVertex(4, 0.5, 0.5); + tess.draw(); + + //tail + tess.startDrawingQuads(); + tess.setColorRGBA_F(red, green, blue, 1); + tess.addVertex(4, 0.5, -0.5); + tess.addVertex(4, 0.5, 0.5); + tess.setColorRGBA_F(red, green, blue, 0); + tess.addVertex(0, 0.5, 0.5); + tess.addVertex(0, 0.5, -0.5); + tess.draw(); + + tess.startDrawingQuads(); + tess.setColorRGBA_F(red, green, blue, 1); + tess.addVertex(4, -0.5, -0.5); + tess.addVertex(4, -0.5, 0.5); + tess.setColorRGBA_F(red, green, blue, 0); + tess.addVertex(0, -0.5, 0.5); + tess.addVertex(0, -0.5, -0.5); + tess.draw(); + + tess.startDrawingQuads(); + tess.setColorRGBA_F(red, green, blue, 1); + tess.addVertex(4, -0.5, 0.5); + tess.addVertex(4, 0.5, 0.5); + tess.setColorRGBA_F(red, green, blue, 0); + tess.addVertex(0, 0.5, 0.5); + tess.addVertex(0, -0.5, 0.5); + tess.draw(); + + tess.startDrawingQuads(); + tess.setColorRGBA_F(red, green, blue, 1); + tess.addVertex(4, -0.5, -0.5); + tess.addVertex(4, 0.5, -0.5); + tess.setColorRGBA_F(red, green, blue, 0); + tess.addVertex(0, 0.5, -0.5); + tess.addVertex(0, -0.5, -0.5); + tess.draw(); + + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDepthMask(true); + + GL11.glPopMatrix(); + } } \ No newline at end of file