mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Compare commits
1450 Commits
1.0.27_X52
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bb6b5426c | ||
|
|
492703ab23 | ||
|
|
b4d0122cfc | ||
|
|
f809843745 | ||
|
|
6401ffde19 | ||
|
|
1aba934d36 | ||
|
|
69c1ed01fa | ||
|
|
e776b4c8d9 | ||
|
|
6fa00c5771 | ||
|
|
69c1f49f55 | ||
|
|
ade48e4ac7 | ||
|
|
6c1fd10a50 | ||
|
|
a2fd0ea108 | ||
|
|
33a4b983e5 | ||
|
|
0d431e387b | ||
|
|
f0a1eaaaff | ||
|
|
165fd062f4 | ||
|
|
7b18634b34 | ||
|
|
99ca4628dc | ||
|
|
b892f0cc37 | ||
|
|
7664cacd2f | ||
|
|
e96e821146 | ||
|
|
e02e4f6aae | ||
|
|
c1464f2881 | ||
|
|
91dd4cc218 | ||
|
|
6cadca0d89 | ||
|
|
5c9d71c626 | ||
|
|
bd03028170 | ||
|
|
67aee6a2e0 | ||
|
|
223fe240c1 | ||
|
|
5cb013d545 | ||
|
|
82293e46cd | ||
|
|
2e7af7058c | ||
|
|
cc816b40e0 | ||
|
|
64fc72e18a | ||
|
|
76c6222f45 | ||
|
|
2f8b0dde49 | ||
|
|
712ae952df | ||
|
|
b2df165b4b | ||
|
|
90e148e022 | ||
|
|
52440fca2f | ||
|
|
292b989e09 | ||
|
|
b0e0b54def | ||
|
|
51b758e103 | ||
|
|
d25cef888d | ||
|
|
62ce75f458 | ||
|
|
c146829bf4 | ||
|
|
b60cf07e98 | ||
|
|
0e30985963 | ||
|
|
a491b16dfe | ||
|
|
026c0d074e | ||
|
|
6cc60c0234 | ||
|
|
1f17af27f7 | ||
|
|
8aa9ff2895 | ||
|
|
5c0ff2b603 | ||
|
|
3c461313bc | ||
|
|
71fb9a814d | ||
|
|
27e4cd32aa | ||
|
|
8bdce3a4b3 | ||
|
|
4bfce2ba92 | ||
|
|
5ec68643f8 | ||
|
|
65ea177ac0 | ||
|
|
be93b9cc8c | ||
|
|
439d5e52b8 | ||
|
|
72500ed749 | ||
|
|
f17556a0d6 | ||
|
|
6a732fadde | ||
|
|
bcb2f1a198 | ||
|
|
79351bbd0a | ||
|
|
a6087b4bef | ||
|
|
9f26d04f7a | ||
|
|
84326bedb4 | ||
|
|
a0a7e000d4 | ||
|
|
b5b4a537c5 | ||
|
|
7757e3cb53 | ||
|
|
b77633b152 | ||
|
|
9ef7668702 | ||
|
|
4998cd13c2 | ||
|
|
1aaf568338 | ||
|
|
18a4d7a25a | ||
|
|
2b9d43891a | ||
|
|
0197ee79a7 | ||
|
|
6297bbd6a8 | ||
|
|
ad9130079e | ||
|
|
7a39fd778f | ||
|
|
ee0149c133 | ||
|
|
ee643f4407 | ||
|
|
218ad3e59e | ||
|
|
4032cc277a | ||
|
|
4b4868e102 | ||
|
|
83d4505021 | ||
|
|
0e063bbd72 | ||
|
|
29960cdc0a | ||
|
|
d718b58269 | ||
|
|
6141d1d24e | ||
|
|
8619c8e67d | ||
|
|
9c89902e56 | ||
|
|
b20d5f46b2 | ||
|
|
52ae974f51 | ||
|
|
a7afacfaf2 | ||
|
|
f089578ba7 | ||
|
|
1e4346a54b | ||
|
|
a1b83b4a67 | ||
|
|
4e7bbda689 | ||
|
|
539225cf78 | ||
|
|
195cf193c7 | ||
|
|
fd348a40e7 | ||
|
|
6964b4ec9d | ||
|
|
1418a9be87 | ||
|
|
f87b37d7e3 | ||
|
|
871de4ae47 | ||
|
|
89b1cb1de0 | ||
|
|
5dc1ee440b | ||
|
|
e52f70b340 | ||
|
|
e629802bcb | ||
|
|
59bccc9be3 | ||
|
|
838bcb8faa | ||
|
|
5100384e18 | ||
|
|
a8b046f46b | ||
|
|
6b87447ca1 | ||
|
|
e601e79ad3 | ||
|
|
a944c28dd4 | ||
|
|
de2a11389c | ||
|
|
b88d6f6cd3 | ||
|
|
ef2b20d357 | ||
|
|
f82a606b66 | ||
|
|
c639be1429 | ||
|
|
76e6e7852b | ||
|
|
82f175105c | ||
|
|
fa12cfeec1 | ||
|
|
7ee52ac56c | ||
|
|
0fe125251b | ||
|
|
5bcfd368fc | ||
|
|
154503a95d | ||
|
|
54cbb495cc | ||
|
|
1f5fc1926c | ||
|
|
1e3e5f38d4 | ||
|
|
ec0613b9cf | ||
|
|
7204b3662c | ||
|
|
d5ac6fe239 | ||
|
|
c916ad73e1 | ||
|
|
bce98561d3 | ||
|
|
7129d5ee7c | ||
|
|
003afa4071 | ||
|
|
7f963bdb6f | ||
|
|
96298a5c31 | ||
|
|
540900d0f5 | ||
|
|
10585527ae | ||
|
|
d02b328c27 | ||
|
|
510923d14a | ||
|
|
8b5cf6f321 | ||
|
|
39aa0de008 | ||
|
|
bd17238c1c | ||
|
|
63146394ac | ||
|
|
7867d6c6bd | ||
|
|
55b4fec00b | ||
|
|
2430fec8c6 | ||
|
|
6cf88c673f | ||
|
|
308e559229 | ||
|
|
1fcfa136be | ||
|
|
03e7db5d92 | ||
|
|
a94005fc1f | ||
|
|
548ede7f89 | ||
|
|
0e4ef1c45c | ||
|
|
42ab196b06 | ||
|
|
a32b04ed14 | ||
|
|
2f841940b8 | ||
|
|
4141b424a9 | ||
|
|
afb44cd3fd | ||
|
|
096f77f3ab | ||
|
|
e2bb1e00c9 | ||
|
|
b43577c6cd | ||
|
|
818f39c1c5 | ||
|
|
d71fee617c | ||
|
|
aa7aff5150 | ||
|
|
f6a3e44271 | ||
|
|
6ad72b293d | ||
|
|
bce94d0957 | ||
|
|
3101c9b3b9 | ||
|
|
99b19cd022 | ||
|
|
f50e0ee67c | ||
|
|
a8c6ee4ba4 | ||
|
|
9ab73e382f | ||
|
|
3bdd7b4c94 | ||
|
|
4322892abb | ||
|
|
a4a08aa9cd | ||
|
|
cbff57375c | ||
|
|
879d9d1f8a | ||
|
|
b9271cc81d | ||
|
|
fc967e8878 | ||
|
|
7afd9901d3 | ||
|
|
f91718111d | ||
|
|
c7f5a14e42 | ||
|
|
dacddfb3a1 | ||
|
|
4fe5128547 | ||
|
|
e1cb8d00a7 | ||
|
|
2b056a8ae2 | ||
|
|
14490f9392 | ||
|
|
9aa3ac9978 | ||
|
|
4233a36348 | ||
|
|
170f155bc7 | ||
|
|
6818121b9a | ||
|
|
e5b93da9e4 | ||
|
|
71b40de7a7 | ||
|
|
4a3db6adba | ||
|
|
56a17c8856 | ||
|
|
2b5d23fbc1 | ||
|
|
c33d717631 | ||
|
|
2e00964514 | ||
|
|
f28ebbea5c | ||
|
|
1d559fbfe0 | ||
|
|
732f6552b6 | ||
|
|
e16a60d713 | ||
|
|
6c4b58a192 | ||
|
|
938f99318f | ||
|
|
c4c873767f | ||
|
|
4b15267d4f | ||
|
|
51380e49a7 | ||
|
|
94db51bb37 | ||
|
|
84f1434131 | ||
|
|
1cb8ca18cf | ||
|
|
de40ff388a | ||
|
|
8ffbb512c1 | ||
|
|
9a2a79c4c2 | ||
|
|
13cf418c16 | ||
|
|
bb693a729d | ||
|
|
c6a7d2aba4 | ||
|
|
0c0a3c952b | ||
|
|
b5fb8ae5be | ||
|
|
0a60e10827 | ||
|
|
85a0373675 | ||
|
|
6b30ba7d76 | ||
|
|
f1cfe03bf3 | ||
|
|
ded4c9c53a | ||
|
|
0194c0d2a9 | ||
|
|
97349a1df5 | ||
|
|
991e3ffa1d | ||
|
|
58c76bdd55 | ||
|
|
ab48d52265 | ||
|
|
eaf0cfa24a | ||
|
|
f7d2038f7e | ||
|
|
ada5ccbf77 | ||
|
|
252659bdf0 | ||
|
|
bc1073f734 | ||
|
|
9386e9d186 | ||
|
|
a8c24cf76a | ||
|
|
6e7be25614 | ||
|
|
8b88d0f439 | ||
|
|
82185aa9ca | ||
|
|
b2d52e8cfa | ||
|
|
b278d27b9b | ||
|
|
036c220317 | ||
|
|
a3fbb711f0 | ||
|
|
09dd5e37b5 | ||
|
|
176a2e58ee | ||
|
|
18dabf7e8c | ||
|
|
113a800270 | ||
|
|
311a9d1a31 | ||
|
|
b6c60f5997 | ||
|
|
76d4a4a453 | ||
|
|
0a6bddc83d | ||
|
|
efc5a88928 | ||
|
|
02ee44e1ce | ||
|
|
9e5c4e4a8e | ||
|
|
14d79d426c | ||
|
|
03f8b2d80a | ||
|
|
7161a1ef73 | ||
|
|
2833d58e84 | ||
|
|
6eeefc23b4 | ||
|
|
9ce0c0ec39 | ||
|
|
f9baf87289 | ||
|
|
bff3e15fb3 | ||
|
|
f297d4f856 | ||
|
|
3b55d26e17 | ||
|
|
dfd1aafb89 | ||
|
|
75adc232f7 | ||
|
|
d6f957f975 | ||
|
|
f9baf88f3c | ||
|
|
b3aa9ab637 | ||
|
|
c8a0b7f89a | ||
|
|
193f011619 | ||
|
|
f2e733679c | ||
|
|
2f7c013423 | ||
|
|
5a987621a5 | ||
|
|
e7b3dff934 | ||
|
|
51b1f3e46d | ||
|
|
c3c0be94e3 | ||
|
|
f87a23d494 | ||
|
|
59ace7eaf5 | ||
|
|
bd8ed4920d | ||
|
|
72957ef167 | ||
|
|
b3b05d9208 | ||
|
|
2d593dbeb3 | ||
|
|
cde2d39631 | ||
|
|
38cd74536d | ||
|
|
e16be434f5 | ||
|
|
3bf9ab1570 | ||
|
|
bbe41c02a7 | ||
|
|
10cf45b452 | ||
|
|
907d389b43 | ||
|
|
ec076fb97a | ||
|
|
12e8da8750 | ||
|
|
4d6a92e015 | ||
|
|
5fd64f5d8f | ||
|
|
fe38e61ba4 | ||
|
|
db9b0501d5 | ||
|
|
40a14fb440 | ||
|
|
6f7a23d8cc | ||
|
|
db3f58b4cd | ||
|
|
a0670eb700 | ||
|
|
6304df71dd | ||
|
|
d1c5355362 | ||
|
|
801fdc146c | ||
|
|
7d6fea7646 | ||
|
|
39603e2edb | ||
|
|
edbc062da0 | ||
|
|
054aa07318 | ||
|
|
264ee49212 | ||
|
|
32c0491ca4 | ||
|
|
3ca0e1ad4c | ||
|
|
59afb41c22 | ||
|
|
ab7c852d61 | ||
|
|
15d7edacb5 | ||
|
|
278a7b5dfb | ||
|
|
4ef2442770 | ||
|
|
bbf3d29d80 | ||
|
|
8cc94738ad | ||
|
|
ee79c8d9dc | ||
|
|
97cb4cb6a1 | ||
|
|
9a42d65e26 | ||
|
|
f3e315297a | ||
|
|
b1d4e99ea9 | ||
|
|
40dc8c8679 | ||
|
|
63fbbeb5c7 | ||
|
|
669c2b9b50 | ||
|
|
62366d5adb | ||
|
|
8b6af76fa0 | ||
|
|
abe22b7f97 | ||
|
|
111f0d1114 | ||
|
|
0f5b5837b8 | ||
|
|
2796bcb892 | ||
|
|
540cf425e9 | ||
|
|
31a9000a82 | ||
|
|
4710fcfc34 | ||
|
|
9ba40044ed | ||
|
|
bb056af18d | ||
|
|
b710b88ed5 | ||
|
|
995f987e66 | ||
|
|
a709db58bb | ||
|
|
4f97af940c | ||
|
|
a08c410a9c | ||
|
|
a030397f71 | ||
|
|
a0184b1751 | ||
|
|
640397fdda | ||
|
|
6f314c3996 | ||
|
|
f389a25dec | ||
|
|
bc7e00c71c | ||
|
|
2d64453317 | ||
|
|
c9155b55ba | ||
|
|
dfa1d7718b | ||
|
|
6a7acb337e | ||
|
|
f082094740 | ||
|
|
c8fe3cc095 | ||
|
|
dd3746a3d4 | ||
|
|
dd0a604aa6 | ||
|
|
7285867856 | ||
|
|
b57acc2cb2 | ||
|
|
d67b3778c3 | ||
|
|
4440550a37 | ||
|
|
644e188a94 | ||
|
|
72026cb772 | ||
|
|
072f226181 | ||
|
|
9f849e8c2d | ||
|
|
cf5bf4be8c | ||
|
|
890eb49747 | ||
|
|
ebd7ffc827 | ||
|
|
eddd75a626 | ||
|
|
b3405d085b | ||
|
|
003721d4f7 | ||
|
|
f3345f7778 | ||
|
|
94e3df1751 | ||
|
|
d01016034f | ||
|
|
f7ffc694bf | ||
|
|
7113838d68 | ||
|
|
96e5ea531c | ||
|
|
c25adf5014 | ||
|
|
f499e6cf00 | ||
|
|
daae6e9694 | ||
|
|
0916aa9b17 | ||
|
|
d6a10bf49a | ||
|
|
1f09f64176 | ||
|
|
3dc97e8133 | ||
|
|
aaa046e4eb | ||
|
|
2ffe3d0072 | ||
|
|
715ecda0dd | ||
|
|
c61d7f4f89 | ||
|
|
2efce806a9 | ||
|
|
b9fabc3af4 | ||
|
|
dbd63e706f | ||
|
|
a79125b94d | ||
|
|
afb559d604 | ||
|
|
c0cb28c2ad | ||
|
|
ada1b5245d | ||
|
|
8c752488ee | ||
|
|
4a4606e6ed | ||
|
|
7916d76aca | ||
|
|
463d020dad | ||
|
|
4805dd800c | ||
|
|
4320071a41 | ||
|
|
07a2e4eea3 | ||
|
|
d7f859ecab | ||
|
|
f6c74ce98e | ||
|
|
966206dbf5 | ||
|
|
675cde7321 | ||
|
|
98cf0b002b | ||
|
|
3ff201bf4d | ||
|
|
81c5bb84d3 | ||
|
|
1025f626b7 | ||
|
|
13df9566a2 | ||
|
|
99aa9da490 | ||
|
|
465b521f19 | ||
|
|
0cea7393a6 | ||
|
|
7096062847 | ||
|
|
2b612e82e9 | ||
|
|
e03ad3edfb | ||
|
|
a35cb1cbd5 | ||
|
|
2ed4d906c3 | ||
|
|
d4844073ae | ||
|
|
fba1d2a97b | ||
|
|
45af851032 | ||
|
|
94accf6ed6 | ||
|
|
539ecb8130 | ||
|
|
3f38c9b7d2 | ||
|
|
8f67cb6ba3 | ||
|
|
9a6cebe0fa | ||
|
|
ff75e7662e | ||
|
|
7e01544c19 | ||
|
|
4e0171159e | ||
|
|
f005680cc1 | ||
|
|
eb0dd854f0 | ||
|
|
2f12549464 | ||
|
|
174ce22da3 | ||
|
|
5604fa5e4a | ||
|
|
bb453ce45b | ||
|
|
b6e9d36301 | ||
|
|
a0ff23a4d1 | ||
|
|
b456275016 | ||
|
|
4d5f88896a | ||
|
|
6215b32f4d | ||
|
|
be78cf3a43 | ||
|
|
97866f1fb9 | ||
|
|
1be5127582 | ||
|
|
53a63a28aa | ||
|
|
37926a6b8f | ||
|
|
53d1323604 | ||
|
|
4fba0fc42a | ||
|
|
45aab4617a | ||
|
|
a636440d13 | ||
|
|
c978fa8955 | ||
|
|
66971b3310 | ||
|
|
92d4232472 | ||
|
|
ee9c69cfca | ||
|
|
5bde7c9a0d | ||
|
|
848ac39463 | ||
|
|
b9418dcb2e | ||
|
|
245dbf421c | ||
|
|
0b28311374 | ||
|
|
c20a90e45c | ||
|
|
9a7f991092 | ||
|
|
a24bed5337 | ||
|
|
bf3e795a66 | ||
|
|
76b51ebca9 | ||
|
|
c8bf809e9f | ||
|
|
7084dc919a | ||
|
|
b98c8c3f98 | ||
|
|
3f6e758cd4 | ||
|
|
a000347877 | ||
|
|
e5b29e3352 | ||
|
|
5605a9c3b8 | ||
|
|
708879c276 | ||
|
|
95e1c97781 | ||
|
|
cac17dea98 | ||
|
|
03d195fd91 | ||
|
|
2eecf17100 | ||
|
|
48b4124c14 | ||
|
|
23669e6337 | ||
|
|
6ed83ab7ec | ||
|
|
2b3f98a850 | ||
|
|
fcabf659af | ||
|
|
742595c83f | ||
|
|
e062b4d2c3 | ||
|
|
a2a91d929a | ||
|
|
7e87efcc48 | ||
|
|
61e10fe48f | ||
|
|
518871bf2b | ||
|
|
b75e14d9fc | ||
|
|
12d2d6b8dd | ||
|
|
37279845be | ||
|
|
d6b095c568 | ||
|
|
f7cf05d944 | ||
|
|
3cbc342af5 | ||
|
|
ee41e9a7ed | ||
|
|
79074e19c2 | ||
|
|
ad9cb55b98 | ||
|
|
d71057bbab | ||
|
|
8033fde2b9 | ||
|
|
b209795f60 | ||
|
|
f73d81310a | ||
|
|
6555d6316a | ||
|
|
bf0aa7d285 | ||
|
|
fbc5177918 | ||
|
|
4aafbdaeac | ||
|
|
4e30ac8084 | ||
|
|
63d5d41d48 | ||
|
|
fdf73a4f06 | ||
|
|
dafe4a535e | ||
|
|
96793ec599 | ||
|
|
951c00d79d | ||
|
|
d5e923c263 | ||
|
|
9d67211ddd | ||
|
|
4b28ee2227 | ||
|
|
78ea52cbab | ||
|
|
7793f9fa24 | ||
|
|
1d18d832e7 | ||
|
|
14f7668a9a | ||
|
|
f0bd84fa47 | ||
|
|
13b3988829 | ||
|
|
0a99397f30 | ||
|
|
52149b098e | ||
|
|
4903b2e189 | ||
|
|
54a5769dee | ||
|
|
f9369f5e02 | ||
|
|
90522b98db | ||
|
|
9e83f24179 | ||
|
|
9a0cadaf9d | ||
|
|
3f641a843b | ||
|
|
60b9e1fb18 | ||
|
|
fa6b4faeee | ||
|
|
fb4bca3544 | ||
|
|
9e99a21969 | ||
|
|
0ac72afa97 | ||
|
|
bdd56b6062 | ||
|
|
16824452b0 | ||
|
|
ee1ffc98ba | ||
|
|
4b52afd0e1 | ||
|
|
aa045050a1 | ||
|
|
b7dc3fb600 | ||
|
|
8ea7cf4080 | ||
|
|
7505b72f7a | ||
|
|
763a702ed7 | ||
|
|
a4e1cc139f | ||
|
|
ecc8151919 | ||
|
|
b4b471e5c3 | ||
|
|
525169743c | ||
|
|
e1d66c93a1 | ||
|
|
037af08963 | ||
|
|
1a13e68c67 | ||
|
|
a0451b46a5 | ||
|
|
c86aa101ba | ||
|
|
be03467f65 | ||
|
|
b01b88cb03 | ||
|
|
b7da4e7bd1 | ||
|
|
bee95f9065 | ||
|
|
d669c4372e | ||
|
|
2db923173a | ||
|
|
9e2f116a32 | ||
|
|
eaadc36618 | ||
|
|
8ef85c4d04 | ||
|
|
ffd83ebef3 | ||
|
|
85895f7ce8 | ||
|
|
792dff062e | ||
|
|
ed67caa19c | ||
|
|
74bd23d76e | ||
|
|
9a47ec30f4 | ||
|
|
9b7332a047 | ||
|
|
098ecd3791 | ||
|
|
de4a359002 | ||
|
|
997ed75b79 | ||
|
|
2ad1c2121d | ||
|
|
9da95bbff3 | ||
|
|
c99f647e15 | ||
|
|
9ff54c2495 | ||
|
|
9b412c726d | ||
|
|
470f950b1a | ||
|
|
4750b0eba2 | ||
|
|
458ee0a90e | ||
|
|
563defd5f1 | ||
|
|
2546cf79b7 | ||
|
|
b8fa2a67d7 | ||
|
|
4c162e9f37 | ||
|
|
a4b49633c6 | ||
|
|
00980d937a | ||
|
|
c39854dbb4 | ||
|
|
aa5c85ade5 | ||
|
|
cdda91f2d8 | ||
|
|
84c69e7803 | ||
|
|
1709848209 | ||
|
|
f6ce5b5ae7 | ||
|
|
bbe87c34c3 | ||
|
|
37cee61269 | ||
|
|
81f9915e54 | ||
|
|
8c696a6f64 | ||
|
|
61ab6dda7b | ||
|
|
96976e9fb4 | ||
|
|
2bd11fdd71 | ||
|
|
07a6b144c8 | ||
|
|
d8a6272597 | ||
|
|
0911ddc423 | ||
|
|
8e102c3fc8 | ||
|
|
aaff825539 | ||
|
|
0748abae07 | ||
|
|
1051342526 | ||
|
|
adc57e79b4 | ||
|
|
7741330fec | ||
|
|
74b0e4e929 | ||
|
|
a88b7ef5df | ||
|
|
f003235381 | ||
|
|
0920358df4 | ||
|
|
75dd1ea555 | ||
|
|
6def4eaac9 | ||
|
|
c841002f70 | ||
|
|
3ddad84863 | ||
|
|
907d97e1ba | ||
|
|
af9780f57d | ||
|
|
e6901d8134 | ||
|
|
5f041cde7d | ||
|
|
4c67d4d0c3 | ||
|
|
bdba1fc503 | ||
|
|
ad6c7c06a5 | ||
|
|
8ddc169c31 | ||
|
|
9b316af586 | ||
|
|
419b207eff | ||
|
|
ba24ed64aa | ||
|
|
9cfdc17115 | ||
|
|
938c28f293 | ||
|
|
b374f4088b | ||
|
|
5444f57cad | ||
|
|
0ec1e5735a | ||
|
|
219db7acdf | ||
|
|
afab6c7750 | ||
|
|
8117f9b888 | ||
|
|
b5363ef039 | ||
|
|
6f97e04dda | ||
|
|
f523b958d6 | ||
|
|
a9f2762a97 | ||
|
|
242c4f5b03 | ||
|
|
3f72a93d28 | ||
|
|
7213b9b84d | ||
|
|
0c5c7a4150 | ||
|
|
10e21a2676 | ||
|
|
3877a666a6 | ||
|
|
84601f685f | ||
|
|
a7c1a42244 | ||
|
|
e8b7504fff | ||
|
|
e450bbc49d | ||
|
|
26f1b38df9 | ||
|
|
d70464b3d1 | ||
|
|
7bfb6ac7c6 | ||
|
|
96f02c6a16 | ||
|
|
852e89b21d | ||
|
|
b7ced0b946 | ||
|
|
05630028a0 | ||
|
|
30a20e34e0 | ||
|
|
a5bdfa87d9 | ||
|
|
69b9ea9a7d | ||
|
|
889cc46486 | ||
|
|
bafa8d6dba | ||
|
|
5f999100d1 | ||
|
|
737c56ed07 | ||
|
|
8d63e86a98 | ||
|
|
ddc6e42f55 | ||
|
|
423cbbcf79 | ||
|
|
ef3397ddb1 | ||
|
|
daae2a5e32 | ||
|
|
5b22da19c4 | ||
|
|
e6c059041e | ||
|
|
b9332f2e81 | ||
|
|
4d25b5dc8b | ||
|
|
55bfe1b8d2 | ||
|
|
82b02c29ea | ||
|
|
e85ae838c6 | ||
|
|
77df7e6cde | ||
|
|
c82e371ec8 | ||
|
|
b656e1d22e | ||
|
|
18855018c4 | ||
|
|
7f887a623a | ||
|
|
66e0a0252b | ||
|
|
7b30d17031 | ||
|
|
131e4fd42d | ||
|
|
7aa8818a5b | ||
|
|
f0679b04cc | ||
|
|
2102db6229 | ||
|
|
a8485bdb5a | ||
|
|
71695de235 | ||
|
|
fd04024706 | ||
|
|
2f74d17823 | ||
|
|
9d558a68f3 | ||
|
|
05bc334274 | ||
|
|
b7641dcd54 | ||
|
|
6bbb002e34 | ||
|
|
06930f6ec8 | ||
|
|
2e6ca970a7 | ||
|
|
83876e388f | ||
|
|
85bef7672e | ||
|
|
8686a64141 | ||
|
|
5fb88801ec | ||
|
|
0c5077b54a | ||
|
|
23487bd0d8 | ||
|
|
faa87edd40 | ||
|
|
cc9d04d063 | ||
|
|
5b6f8e5b3d | ||
|
|
563b726b62 | ||
|
|
d389a2cf84 | ||
|
|
9cf7cc6643 | ||
|
|
6bbb354a9f | ||
|
|
af6f3d76fe | ||
|
|
97556e4c5a | ||
|
|
8bdf209c0b | ||
|
|
f94fd70cf0 | ||
|
|
281e66b37e | ||
|
|
73c2f9aa67 | ||
|
|
fa6d8c1a54 | ||
|
|
e18cc2d729 | ||
|
|
5f8b0f6aed | ||
|
|
83b3ce085e | ||
|
|
6374f912cb | ||
|
|
cf94df9e48 | ||
|
|
9ab3bc865b | ||
|
|
76368acbf8 | ||
|
|
da605a794e | ||
|
|
02a4bf483e | ||
|
|
12dbb340dd | ||
|
|
2cd25dbfb1 | ||
|
|
c83a53b62a | ||
|
|
982e50556b | ||
|
|
dc04226713 | ||
|
|
fa6497146a | ||
|
|
119b8a037b | ||
|
|
e4f980e21c | ||
|
|
da2abe281d | ||
|
|
2841c8b67b | ||
|
|
fb32763c88 | ||
|
|
4b6cf3473d | ||
|
|
10d8551ce3 | ||
|
|
f2f3e04bb0 | ||
|
|
3c2d49419f | ||
|
|
16fcac0a3c | ||
|
|
89100738f4 | ||
|
|
ca3af9e863 | ||
|
|
ee99c1e491 | ||
|
|
ef54c6e23b | ||
|
|
e7ebc7dd07 | ||
|
|
c33b962043 | ||
|
|
603cc10696 | ||
|
|
541c6a1c99 | ||
|
|
21efc6b61c | ||
|
|
3d77afab1f | ||
|
|
714a5298a9 | ||
|
|
acb01b13e0 | ||
|
|
274995ebd6 | ||
|
|
c42e03c268 | ||
|
|
453c47c6f0 | ||
|
|
9c818f45d1 | ||
|
|
dcdf5c4f27 | ||
|
|
0e92a96b2a | ||
|
|
8a3c8b5e10 | ||
|
|
f24c244730 | ||
|
|
19fd479170 | ||
|
|
0e5e114b12 | ||
|
|
d8080835f8 | ||
|
|
097b2bb12c | ||
|
|
8294df1aa3 | ||
|
|
0cf9d88e36 | ||
|
|
6b1d61166f | ||
|
|
ba220420fe | ||
|
|
79c7faf55b | ||
|
|
0880287660 | ||
|
|
360b0acabe | ||
|
|
b3983f7fb8 | ||
|
|
edd952ec6a | ||
|
|
6282bd028d | ||
|
|
ac45637bf6 | ||
|
|
4983002013 | ||
|
|
3da96091da | ||
|
|
8bef7d63dd | ||
|
|
c55c8c5da1 | ||
|
|
90813de8cc | ||
|
|
90ab38dc44 | ||
|
|
3592deca8e | ||
|
|
58da6f154e | ||
|
|
25a2172c6b | ||
|
|
8685831c04 | ||
|
|
1f7131536c | ||
|
|
1a9fc72a93 | ||
|
|
43f38d8679 | ||
|
|
c08a90553a | ||
|
|
533dfd6ded | ||
|
|
ac7f186528 | ||
|
|
17b0dde444 | ||
|
|
1da6140e2e | ||
|
|
cac082a6e2 | ||
|
|
2e5882df60 | ||
|
|
f792fdebe3 | ||
|
|
4875aefba4 | ||
|
|
3db1dbd277 | ||
|
|
18a310ba3a | ||
|
|
d1497abd1e | ||
|
|
3583ad66cd | ||
|
|
d1f50a8eb4 | ||
|
|
27c0c94897 | ||
|
|
42d45506bd | ||
|
|
3658953d33 | ||
|
|
3b36807242 | ||
|
|
b89bec56c8 | ||
|
|
0eb87524ab | ||
|
|
4a869ae2ea | ||
|
|
41d62c49db | ||
|
|
1bb88b176a | ||
|
|
1f073d570c | ||
|
|
f6f1c1c380 | ||
|
|
997e96f757 | ||
|
|
db109d8bcf | ||
|
|
9a7124c8ff | ||
|
|
a3578e67a0 | ||
|
|
92bce167f3 | ||
|
|
14377708be | ||
|
|
fa075a3bd4 | ||
|
|
62e32f70c6 | ||
|
|
942f7fefea | ||
|
|
c6fce12a0b | ||
|
|
f4a1e8beed | ||
|
|
18a6f228c6 | ||
|
|
096cd046c5 | ||
|
|
a70410f5dd | ||
|
|
f3ee962e8e | ||
|
|
bfe043b81d | ||
|
|
f5db461bfd | ||
|
|
36080e183a | ||
|
|
6946a70f18 | ||
|
|
5a0dabc5a9 | ||
|
|
71c1eaf430 | ||
|
|
b400b88701 | ||
|
|
f820ae32e2 | ||
|
|
a40d0b3513 | ||
|
|
0b5731266e | ||
|
|
dec8c9c43a | ||
|
|
466f12e6e2 | ||
|
|
32fc58821a | ||
|
|
03693e7c0a | ||
|
|
57b0cc4727 | ||
|
|
89b145fde8 | ||
|
|
a982616f89 | ||
|
|
2a7033bb76 | ||
|
|
7737ac7989 | ||
|
|
46c59eace3 | ||
|
|
18d8fe292c | ||
|
|
f416b9ad44 | ||
|
|
1615096a84 | ||
|
|
78c33e904d | ||
|
|
3e3b651d11 | ||
|
|
25a7222cf2 | ||
|
|
c2354adbc3 | ||
|
|
5a12d14948 | ||
|
|
014a253e43 | ||
|
|
dd5e4e1343 | ||
|
|
149e79f550 | ||
|
|
d15ab7079a | ||
|
|
2744ab322c | ||
|
|
eaa2dfa23d | ||
|
|
9b08adc314 | ||
|
|
381ef334b2 | ||
|
|
570ad03802 | ||
|
|
06a1b9163d | ||
|
|
ad4b1733d5 | ||
|
|
5aee91636c | ||
|
|
474148110d | ||
|
|
983f91edc5 | ||
|
|
155595772c | ||
|
|
5f08488268 | ||
|
|
1e26546c79 | ||
|
|
b328130edb | ||
|
|
baad5cefbe | ||
|
|
8ad065b891 | ||
|
|
3303df8345 | ||
|
|
7dab92f3b2 | ||
|
|
d65cc18dd8 | ||
|
|
d4d552b9dd | ||
|
|
11fc058690 | ||
|
|
ae593a8188 | ||
|
|
590da72fbb | ||
|
|
a9567d986b | ||
|
|
f4af494d2a | ||
|
|
9c3e6e2ce4 | ||
|
|
959570c230 | ||
|
|
105f44a36a | ||
|
|
79dcb69ed2 | ||
|
|
f2991e4518 | ||
|
|
37546b252d | ||
|
|
6bfca4e1fe | ||
|
|
f03dca7470 | ||
|
|
cb8c95278c | ||
|
|
9dbe596401 | ||
|
|
060c259fa9 | ||
|
|
57eba8e6ec | ||
|
|
6f598278d6 | ||
|
|
6b28649094 | ||
|
|
47eabb8b36 | ||
|
|
63bf3a1e7c | ||
|
|
d185a5ea22 | ||
|
|
947ba198cc | ||
|
|
c8ad381418 | ||
|
|
e9888a8634 | ||
|
|
cf82ea3796 | ||
|
|
8a93b02c94 | ||
|
|
51ad12d51a | ||
|
|
88713946dd | ||
|
|
3b2a4aee1e | ||
|
|
4d0ce8b6d9 | ||
|
|
d27bda1f74 | ||
|
|
84d3722c04 | ||
|
|
60f05defe0 | ||
|
|
25e20662e4 | ||
|
|
c9110aaa33 | ||
|
|
c19e867bfd | ||
|
|
df8d456a90 | ||
|
|
8c196f05ca | ||
|
|
f8d827d6cd | ||
|
|
79d510aefb | ||
|
|
3733a8bee9 | ||
|
|
d9ef97f345 | ||
|
|
20eb02e816 | ||
|
|
61acb3db45 | ||
|
|
8a7934d274 | ||
|
|
997fb20129 | ||
|
|
5fe26d5647 | ||
|
|
cf26eac2c9 | ||
|
|
8970878e6b | ||
|
|
6fb0b647fd | ||
|
|
4bc07d9cbf | ||
|
|
0f7c8b49f3 | ||
|
|
169f1666e7 | ||
|
|
7ef016ccce | ||
|
|
a6740a35e9 | ||
|
|
4b3430f9b1 | ||
|
|
640b0ae341 | ||
|
|
4ae675aebc | ||
|
|
0c9bea7091 | ||
|
|
5d7fc996e5 | ||
|
|
e9b809d9dc | ||
|
|
015ff7e5c1 | ||
|
|
5501380d15 | ||
|
|
4a931a4be1 | ||
|
|
2d33e90f93 | ||
|
|
afa0418104 | ||
|
|
8d7664f728 | ||
|
|
d890443150 | ||
|
|
169e9c0879 | ||
|
|
0a1822ff10 | ||
|
|
0be198d21f | ||
|
|
70cd3d4071 | ||
|
|
891d4d869d | ||
|
|
e6b84bd6d3 | ||
|
|
87a1c01fe7 | ||
|
|
95f3bcb1f5 | ||
|
|
282326d3c4 | ||
|
|
0c0c9d02d7 | ||
|
|
a57e538479 | ||
|
|
4f975293a5 | ||
|
|
d01f54d1ba | ||
|
|
3a8e0048a3 | ||
|
|
65f1866e8c | ||
|
|
087be46083 | ||
|
|
9ff55acccf | ||
|
|
381febd64e | ||
|
|
30be3d5fa7 | ||
|
|
60f64f33f2 | ||
|
|
acbea88eca | ||
|
|
ac46cdf1ad | ||
|
|
8f2a858f52 | ||
|
|
b00e3b9efb | ||
|
|
00c73d63c0 | ||
|
|
38c6b4691d | ||
|
|
e347aa4346 | ||
|
|
7d6289b228 | ||
|
|
ce99e65b0b | ||
|
|
73406b4dae | ||
|
|
1a5fda1847 | ||
|
|
9d3860df64 | ||
|
|
630654ded7 | ||
|
|
148ba19721 | ||
|
|
ea430afe71 | ||
|
|
ed59ba69f3 | ||
|
|
4fc41c631d | ||
|
|
051938a3cd | ||
|
|
933ecded5d | ||
|
|
41189e5f25 | ||
|
|
d3e839a9bb | ||
|
|
81ca498fa8 | ||
|
|
93638c3889 | ||
|
|
6a7dabbb1e | ||
|
|
9bb9a56452 | ||
|
|
bf2a4b776f | ||
|
|
f3a88b6afb | ||
|
|
953d120fc6 | ||
|
|
3a6f890774 | ||
|
|
dc66e5ac04 | ||
|
|
d19894fa3d | ||
|
|
a47aa63d21 | ||
|
|
e5cfc9cf2b | ||
|
|
5459920b9c | ||
|
|
b4ae72513b | ||
|
|
716e429772 | ||
|
|
411d73ff9b | ||
|
|
e628976969 | ||
|
|
527459b92c | ||
|
|
df1ee57563 | ||
|
|
b48b536834 | ||
|
|
ce8099d4aa | ||
|
|
f73fa37659 | ||
|
|
c7f570706d | ||
|
|
a8829245f4 | ||
|
|
4baf5e7c67 | ||
|
|
4f8c102b68 | ||
|
|
b55d66ecac | ||
|
|
5cf209e2c1 | ||
|
|
c49bbab8c9 | ||
|
|
9085dc5f0c | ||
|
|
fa25d17a45 | ||
|
|
3f106f01e2 | ||
|
|
345fe2ef06 | ||
|
|
ef5059a9a6 | ||
|
|
bbc27820f1 | ||
|
|
de8b888f3e | ||
|
|
2c48bcb782 | ||
|
|
afb0c67090 | ||
|
|
b85e4d2835 | ||
|
|
4728e3c6ba | ||
|
|
aadb2d5f2a | ||
|
|
25015a4f7a | ||
|
|
7c135c4a33 | ||
|
|
92b9ab2369 | ||
|
|
05562018fc | ||
|
|
c475e4f3d3 | ||
|
|
29e69b9c49 | ||
|
|
2497d628e5 | ||
|
|
cc31edff44 | ||
|
|
ce64270b2c | ||
|
|
e23cfab649 | ||
|
|
239454e23c | ||
|
|
b79b499b21 | ||
|
|
c190863785 | ||
|
|
634836c549 | ||
|
|
f1184f8731 | ||
|
|
e59f8b441d | ||
|
|
853b6576ad | ||
|
|
0f22e34069 | ||
|
|
61917ddc2f | ||
|
|
bf1e14c08f | ||
|
|
2982dd1f58 | ||
|
|
caf416a27d | ||
|
|
3e35f0ac47 | ||
|
|
f7baf332cb | ||
|
|
d360ebe6cc | ||
|
|
9f758c49bc | ||
|
|
a43986603b | ||
|
|
4ce7e396be | ||
|
|
0c9fc86c12 | ||
|
|
58f8ba8f8c | ||
|
|
5d9ef5ae67 | ||
|
|
74992ede71 | ||
|
|
273590a96b | ||
|
|
e21b14b979 | ||
|
|
149e51288f | ||
|
|
14746a76b3 | ||
|
|
b95e9b6e80 | ||
|
|
59df04d608 | ||
|
|
f69a1d8876 | ||
|
|
b485558e13 | ||
|
|
6696f3b736 | ||
|
|
791b4c7687 | ||
|
|
db0dbafe75 | ||
|
|
be84b21867 | ||
|
|
763b6ec020 | ||
|
|
6b65c79704 | ||
|
|
1ffe752ef6 | ||
|
|
a1402daec2 | ||
|
|
2c68f3a57c | ||
|
|
19c481c6d7 | ||
|
|
5b1121e0e4 | ||
|
|
14eac38f3e | ||
|
|
f3a9c0f787 | ||
|
|
1eecfbca85 | ||
|
|
805ee3a998 | ||
|
|
15fb0c1ad7 | ||
|
|
be2edd87d8 | ||
|
|
03c5466c0e | ||
|
|
20b46c3884 | ||
|
|
17de40d7b2 | ||
|
|
21088af66f | ||
|
|
71998aca41 | ||
|
|
0d141f56b1 | ||
|
|
7d1a164bf7 | ||
|
|
ca9b9f7b6c | ||
|
|
d8d3263493 | ||
|
|
22aefff48d | ||
|
|
58166fda33 | ||
|
|
b508f2f534 | ||
|
|
af8cc78ad5 | ||
|
|
d4a25205a7 | ||
|
|
82d3523ea1 | ||
|
|
dbbe55a990 | ||
|
|
0ab4f215b1 | ||
|
|
01df6f20c2 | ||
|
|
11d4412b83 | ||
|
|
4b5d9664bf | ||
|
|
3cd9fc7b7c | ||
|
|
82d6c0a923 | ||
|
|
0685f231fe | ||
|
|
13b862d14e | ||
|
|
592d52270c | ||
|
|
395acea899 | ||
|
|
6b6c9635a3 | ||
|
|
edc870dff1 | ||
|
|
64d3cdcf78 | ||
|
|
0aeeda9113 | ||
|
|
f0db8853e6 | ||
|
|
c2a2a99a80 | ||
|
|
c636632dc3 | ||
|
|
4fd4aa819b | ||
|
|
f74b5a337c | ||
|
|
152de687f2 | ||
|
|
e518ef48c9 | ||
|
|
f7659acde1 | ||
|
|
108b581df2 | ||
|
|
30f41fe1b0 | ||
|
|
f42b4b3dd4 | ||
|
|
f1ad376a5d | ||
|
|
29979ab319 | ||
|
|
13741930ca | ||
|
|
c1d3aad937 | ||
|
|
f45cffd9ce | ||
|
|
1fbb8fafb9 | ||
|
|
96a7058f38 | ||
|
|
91e98a9013 | ||
|
|
89f4da4ab4 | ||
|
|
334cffe04e | ||
|
|
28d3664781 | ||
|
|
312162734b | ||
|
|
31dc235dc1 | ||
|
|
39c8a6711b | ||
|
|
64b2525e04 | ||
|
|
e1dd8c80b4 | ||
|
|
03a6af791f | ||
|
|
0907997bec | ||
|
|
1fa4dca870 | ||
|
|
2b37164ed6 | ||
|
|
9ba8f797dc | ||
|
|
89377e9164 | ||
|
|
cacf041cab | ||
|
|
dc6faed2d9 | ||
|
|
031c78b80e | ||
|
|
0213916a42 | ||
|
|
d9498cb2dc | ||
|
|
8221615898 | ||
|
|
0b0c5bc043 | ||
|
|
416ae78c6a | ||
|
|
5372884c50 | ||
|
|
ef2fba2a52 | ||
|
|
78089b2265 | ||
|
|
eeefb0e4eb | ||
|
|
c6966aa7dc | ||
|
|
1193b0f51f | ||
|
|
1533a43e19 | ||
|
|
0338c6a8fd | ||
|
|
7e81a7b5c2 | ||
|
|
6d67a31dff | ||
|
|
edc701e129 | ||
|
|
fe52d7aed1 | ||
|
|
0cc70760ab | ||
|
|
975b7ff722 | ||
|
|
c6cd707894 | ||
|
|
3d0b8f0fec | ||
|
|
fb8e3b522f | ||
|
|
624bb35b72 | ||
|
|
d3e29bf5da | ||
|
|
abc58c1dc2 | ||
|
|
36c56501bd | ||
|
|
1f6d4bf55b | ||
|
|
985966d8a1 | ||
|
|
0c25ba0c1c | ||
|
|
12c54d66e7 | ||
|
|
16f9c4ad16 | ||
|
|
3be4d9a6bc | ||
|
|
0cb6d3530f | ||
|
|
345d6e8710 | ||
|
|
f5456e54b3 | ||
|
|
7b3e3284b3 | ||
|
|
98bc692d29 | ||
|
|
1282e525da | ||
|
|
4c501d209f | ||
|
|
7a49ec2cae | ||
|
|
955a349793 | ||
|
|
fb19e4d93f | ||
|
|
097907820b | ||
|
|
e6bd1fef4a | ||
|
|
5d3860a4f6 | ||
|
|
574c4f1ca2 | ||
|
|
c2d33ba043 | ||
|
|
8c6f2150fd | ||
|
|
da9b0750f7 | ||
|
|
2d5ddd049d | ||
|
|
61c22602a4 | ||
|
|
e23636044a | ||
|
|
c8ebf180ab | ||
|
|
8ed0411a27 | ||
|
|
a0b593a93e | ||
|
|
63a68cf9ea | ||
|
|
532e27bf0a | ||
|
|
4aa7d195c0 | ||
|
|
b9047ac593 | ||
|
|
484ff585d1 | ||
|
|
79cace83b3 | ||
|
|
445da9b38e | ||
|
|
6aad688485 | ||
|
|
e2b3b480c1 | ||
|
|
85d29fc326 | ||
|
|
8d39fb7174 | ||
|
|
9f86ef1980 | ||
|
|
bfede6d87b | ||
|
|
7fe7960dba | ||
|
|
c629b1e79b | ||
|
|
df88ed481b | ||
|
|
917ccb871c | ||
|
|
f6d2ff3f5a | ||
|
|
26dcc1730d | ||
|
|
f465758bfd | ||
|
|
4a0ac6e95f | ||
|
|
e02142d255 | ||
|
|
54d2314496 | ||
|
|
c1e5ae5c30 | ||
|
|
f43cf194cd | ||
|
|
32d3b6722f | ||
|
|
3323356c73 | ||
|
|
12af0abed9 | ||
|
|
5c9f6962e2 | ||
|
|
1ecbc015a3 | ||
|
|
1b53215e61 | ||
|
|
7e54c5478b | ||
|
|
00f98ac456 | ||
|
|
aaff6b9b70 | ||
|
|
fa6d2a4e56 | ||
|
|
b1a778c949 | ||
|
|
6ae779cb23 | ||
|
|
b1f4dfd984 | ||
|
|
77ca4e5c77 | ||
|
|
fe2dddec3b | ||
|
|
e9376c788c | ||
|
|
e79eae78a7 | ||
|
|
2c4dc279b6 | ||
|
|
f177c8899a | ||
|
|
9028ca87b0 | ||
|
|
f9f1e1c73e | ||
|
|
2d48960e2d | ||
|
|
300f005de4 | ||
|
|
9943a73f2a | ||
|
|
473bdd67c4 | ||
|
|
4e08e107a8 | ||
|
|
088a640d8f | ||
|
|
86ce0f6509 | ||
|
|
ca8a7a72f9 | ||
|
|
b90741f640 | ||
|
|
a2f5eeada7 | ||
|
|
20bd424cd4 | ||
|
|
dfd5d2c2a6 | ||
|
|
d625a9a9d9 | ||
|
|
375b4581e5 | ||
|
|
7731b4c1e8 | ||
|
|
79d3b0cbb7 | ||
|
|
7146e20fb3 | ||
|
|
659bd662bf | ||
|
|
177e5a245e | ||
|
|
b5d76afb8c | ||
|
|
4c58d9a084 | ||
|
|
5e9399a696 | ||
|
|
141e80bfcb | ||
|
|
62485c6854 | ||
|
|
f00f2c7ca3 | ||
|
|
6db42e6d4b | ||
|
|
d6c15c8ff2 | ||
|
|
6ceba52f95 | ||
|
|
9806d53b45 | ||
|
|
7d642f155c | ||
|
|
eb8971dc2e | ||
|
|
e318c83023 | ||
|
|
737fb1e432 | ||
|
|
8bb91eda3c | ||
|
|
7ae8693841 | ||
|
|
9839107c4e | ||
|
|
b139e084fb | ||
|
|
f27234879f | ||
|
|
07618f6a60 | ||
|
|
cf5e0e7d12 | ||
|
|
291a34103a | ||
|
|
3ac7a8cdd6 | ||
|
|
fc716379c9 | ||
|
|
4ceadec5c6 | ||
|
|
ffa8a0c5bb | ||
|
|
4ef77bad1f | ||
|
|
9f0fd19ef8 | ||
|
|
51b7c71534 | ||
|
|
725baf37ff | ||
|
|
8608796a09 | ||
|
|
1538932316 | ||
|
|
c73ec3a0ac | ||
|
|
0a59fa86a0 | ||
|
|
5a9f3e75dc | ||
|
|
ccc80781b2 | ||
|
|
7b80e9fb64 | ||
|
|
360daaa524 | ||
|
|
b5166ca517 | ||
|
|
850679ca94 | ||
|
|
11e9bc22ed | ||
|
|
6d1165ba33 | ||
|
|
a6f3cd54eb | ||
|
|
900f8e6959 | ||
|
|
86a805bd92 | ||
|
|
98f4b22a19 | ||
|
|
5ead78349c | ||
|
|
3c2ddf4d64 | ||
|
|
f461851228 | ||
|
|
2bdbfda243 | ||
|
|
d1e4d1572f | ||
|
|
20cb0f6f5d | ||
|
|
565d5c1129 | ||
|
|
0ca1be3d6f | ||
|
|
ac81021ddf | ||
|
|
c6ca31eb23 | ||
|
|
52b781ea9f | ||
|
|
3da9f7c56f | ||
|
|
df5253df1b | ||
|
|
1afe84a871 | ||
|
|
5d24e76601 | ||
|
|
a78dae4a8e | ||
|
|
23928d3d7b | ||
|
|
e21fe3eecc | ||
|
|
3bf526419e | ||
|
|
ed4421b2e2 | ||
|
|
5a9b65095d | ||
|
|
00cacbbadc | ||
|
|
228fbf506d | ||
|
|
d13d0679b7 | ||
|
|
1238933bca | ||
|
|
3a5c943c0a | ||
|
|
18d21a0f13 | ||
|
|
299f514f99 | ||
|
|
4c2639ecf4 | ||
|
|
dc70967279 | ||
|
|
1574f90a4d | ||
|
|
fb414ad80a | ||
|
|
3ae27afe4d | ||
|
|
fa93b944b5 | ||
|
|
e6aa3f232d | ||
|
|
247f3eace8 | ||
|
|
b789482f3d | ||
|
|
9da32595ff | ||
|
|
b3e8fad079 | ||
|
|
a6b1a9068b | ||
|
|
bb84ebe209 | ||
|
|
ec311a6d54 | ||
|
|
fd500f8a98 | ||
|
|
c5c6beb453 | ||
|
|
747d0006b2 | ||
|
|
06caf11654 | ||
|
|
bd3b52cd36 | ||
|
|
61bba7974f | ||
|
|
0ccf81443a | ||
|
|
c3e532ab33 | ||
|
|
d20c190c3e | ||
|
|
e6e11a3a1c | ||
|
|
223e0d2855 | ||
|
|
66feaf292f | ||
|
|
d802645bc3 | ||
|
|
c855f67cda | ||
|
|
4fd9d5b0fa | ||
|
|
f9e22ddab0 | ||
|
|
b28cb312dc | ||
|
|
c12948b330 | ||
|
|
a5fa13c32e | ||
|
|
093d23e700 | ||
|
|
4c82dfcdcb | ||
|
|
d4f62675c4 | ||
|
|
20646c407b | ||
|
|
c3eb6035aa | ||
|
|
23db8e3d86 | ||
|
|
de8324ce9b | ||
|
|
18dfb21ca4 | ||
|
|
fd04bf9b3f | ||
|
|
4444038f35 | ||
|
|
beae7b31fe | ||
|
|
b1d5540887 | ||
|
|
4aaf3ec864 | ||
|
|
0262fcc984 | ||
|
|
3a7e974541 | ||
|
|
89fe899f2a | ||
|
|
4972f4023a | ||
|
|
614f5db7dc | ||
|
|
d34624a224 | ||
|
|
940f45813a | ||
|
|
6043d1df80 | ||
|
|
27afb9eb7b | ||
|
|
1a24b8df67 | ||
|
|
2968d927bc | ||
|
|
98a334575d | ||
|
|
0dea47ff87 | ||
|
|
8994d2e0b1 | ||
|
|
c1a2f8d270 | ||
|
|
7f0c483cb1 | ||
|
|
aceb313fec | ||
|
|
352cee350f | ||
|
|
e2d64ff376 | ||
|
|
977bd3e2b5 | ||
|
|
5341f5d255 | ||
|
|
4fb7df8b3e | ||
|
|
3dbe648ebe | ||
|
|
f74ce297f8 | ||
|
|
4a95dc1240 | ||
|
|
b462b30156 | ||
|
|
b60db5b911 | ||
|
|
fe9808f621 | ||
|
|
8522b584d4 | ||
|
|
5f1a4509f2 | ||
|
|
bd59ae5970 | ||
|
|
d4d5340a33 | ||
|
|
2f2c2438d5 | ||
|
|
d363177e7f | ||
|
|
1f5c58b7bb | ||
|
|
27bd64eafc | ||
|
|
4b32e2665b | ||
|
|
7206cad26a | ||
|
|
a814e581b9 | ||
|
|
3b1a578d71 | ||
|
|
c49161ab39 | ||
|
|
a581cb74d0 | ||
|
|
6027ad963b | ||
|
|
18af968073 | ||
|
|
6d920ce91d | ||
|
|
c4e973dc03 | ||
|
|
b6d4e95ec9 | ||
|
|
642945e7ac | ||
|
|
9fa148c218 |
62
.github/workflows/build.yml
vendored
Normal file
62
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
|
||||
|
||||
# Yes this is a mostly untouched Github actions template
|
||||
|
||||
|
||||
name: Java CI with Gradle
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'temurin' # Temurin because it's default :P
|
||||
|
||||
# Calculate days since 10/10/10
|
||||
- name: Calculate days since 10/10/10
|
||||
id: calculate_days
|
||||
run: |
|
||||
start_date="2010-10-10"
|
||||
current_date=$(date +%Y-%m-%d)
|
||||
days_since=$(( ($(date -d "$current_date" +%s) - $(date -d "$start_date" +%s)) / 86400 ))
|
||||
echo "days=$days_since" >> $GITHUB_OUTPUT
|
||||
|
||||
# Update version files with proper sed syntax
|
||||
- name: Update version files
|
||||
run: |
|
||||
days=${{ steps.calculate_days.outputs.days }}
|
||||
# Use proper sed syntax for Linux runners
|
||||
sed -i "s/public static final String VERSION = \".*\";/public static final String VERSION = \"1.0.27 BETA ($days)\";/" src/main/java/com/hbm/lib/RefStrings.java
|
||||
sed -i "s/mod_build_number=.*/mod_build_number=$days/" gradle.properties
|
||||
|
||||
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
|
||||
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
|
||||
|
||||
- name: Build with Gradle Wrapper
|
||||
run: ./gradlew build
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.6.0
|
||||
with:
|
||||
# A file, directory or wildcard pattern that describes what to upload
|
||||
path: ./build/libs
|
||||
@ -13,6 +13,8 @@ Things you should also avoid include:
|
||||
* duplicate util functions (just use what we have, man)
|
||||
* unused or half finished util functions (for obvious reasons)
|
||||
* half finished or obviously broken features (à la "bob will fix it, i'm sure of it", please don't do that)
|
||||
* updating the changelog (you're guaranteed to cause a merge conflict with that)
|
||||
* any use of `I18n`, use `I18nUtil` instead
|
||||
|
||||
## Test your code
|
||||
|
||||
@ -20,6 +22,9 @@ This should go without saying, but please don't PR code that was never actually
|
||||
|
||||
**Addendum:** Because apparently some people think that testing is somehow optional, it is now **mandatory** to test the code both on a client and on a server. If the PR contains compat code, the game has to work **with and without** the mod that the compat is for.
|
||||
|
||||
## No refactor PRs
|
||||
Your refactors suck ass and usually something ends up breaking.
|
||||
|
||||
## Communication
|
||||
|
||||
If you're planning on adding some new thing or doing a grand change, it's best to ask whether that's a good idea before spending 50 hours on a project that won't end up getting merged, due to issues that could have been entirely avoidable with communication.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
[NTM on Modrinth](https://modrinth.com/mod/ntm)
|
||||
|
||||
[NTM on CurseForge](https://minecraft.curseforge.com/projects/hbms-nuclear-tech-mod?gameCategorySlug=mc-mods&projectID=235439)
|
||||
[NTM on CurseForge](https://www.curseforge.com/minecraft/mc-mods/hbms-nuclear-tech-mod)
|
||||
|
||||
[Official NTM Wiki](https://nucleartech.wiki/wiki/Main_Page)
|
||||
|
||||
@ -10,8 +10,9 @@
|
||||
|
||||
**This is for 1.7.10!** For 1.12, check out these projects:
|
||||
|
||||
* NTM Reloaded: https://github.com/TheOriginalGolem/Hbm-s-Nuclear-Tech-GIT/releases
|
||||
* NTM Community Edition (WarFactory): https://github.com/MisterNorwood/Hbm-s-Nuclear-Tech-CE
|
||||
* NTM Extended Edition (Alcater): https://github.com/Alcatergit/Hbm-s-Nuclear-Tech-GIT/releases
|
||||
* NTM Reloaded: https://github.com/TheOriginalGolem/Hbm-s-Nuclear-Tech-GIT/releases
|
||||
|
||||
For 1.18, try Martin's remake: https://codeberg.org/MartinTheDragon/Nuclear-Tech-Mod-Remake/releases
|
||||
|
||||
@ -24,7 +25,7 @@ Simply navigate to "Releases" on the right side of the page, download links for
|
||||
Tired of waiting until the next version comes out? Here is a tutorial on how to compile the very newest version yourself:
|
||||
Please note that these installation instructions are assuming you're running Microsoft Windows operating system. Linux users should know what to do by looking at the same guide.
|
||||
|
||||
1. Make sure you have JDK8 installed. If not, download it from [adoptium.net](https://adoptium.net/?variant=openjdk8&jvmVariant=hotspot)
|
||||
1. Make sure you have JDK8 installed. If not, download it from [adoptium.net](https://adoptium.net/temurin/releases?version=8)
|
||||
2. If you don't have git installed, download&install it from [here](https://git-scm.com/downloads).
|
||||
3. Open up "Git Bash":
|
||||
* Press Windows Button, type "Git Bash" and press ENTER
|
||||
|
||||
19
build.gradle
19
build.gradle
@ -6,6 +6,7 @@ import java.nio.file.StandardCopyOption
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url = 'https://maven.ntmr.dev/proxy/' }
|
||||
maven { url = 'https://maven.minecraftforge.net/' }
|
||||
maven { url = 'https://plugins.gradle.org/m2' }
|
||||
mavenCentral()
|
||||
@ -67,6 +68,10 @@ eclipse.classpath.file.whenMerged { cp ->
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = 'Blerg'
|
||||
url = 'https://maven.ntmr.dev/proxy/'
|
||||
}
|
||||
maven {
|
||||
name = 'ModMaven'
|
||||
url = 'https://modmaven.dev'
|
||||
@ -79,6 +84,18 @@ repositories {
|
||||
// name = "CurseForge"
|
||||
// url = "https://minecraft.curseforge.com/api/maven/"
|
||||
//}
|
||||
maven {
|
||||
name = "Jitpack"
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
maven {
|
||||
name = "CurseMaven"
|
||||
url = "https://cursemaven.com"
|
||||
}
|
||||
maven {
|
||||
name = "OpenComputers"
|
||||
url = "https://maven.cil.li/"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@ -94,6 +111,8 @@ dependencies {
|
||||
compileOnly "inventorytweaks:InventoryTweaks:1.59-dev:deobf"
|
||||
|
||||
implementation "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api"
|
||||
|
||||
compileOnly "com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta.56-GTNH:dev"
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
||||
34
changelog
34
changelog
@ -1,11 +1,27 @@
|
||||
## Changed
|
||||
* Blast doors will now pulverize any block that gets in their way during closing
|
||||
* The nuclear and RTG furnaces will be retired, their recipes have been removed but they remain operational for now
|
||||
* Changed the magnetron recipe to be 3 copper plates and 4 tungsten wires
|
||||
* Added recipes to some secret ammo types
|
||||
* Updated russian localization
|
||||
* Rad absorbers now use metadata, existing blocks will be converted automatically
|
||||
* Fissure bombs that go off in crater biomes now create fissures with metadata 1 which creates radioactive volcanic lava
|
||||
* If a crater biome is created on top of an existing fissure, it will keep producing normal volcanic lava
|
||||
* Simplified the battery socket's client packets, reducing CPU load
|
||||
* Muzzle flashes on guns now work in third person mode, including on other players and on NPCs, making it more apparent when you're being fired at
|
||||
* This includes non-standard special effects like the .44 gap flash and the .35-800 ejector plume
|
||||
* Removed the old unused satelite deco blocks, freeing up 6 block IDs
|
||||
* Crucibles that smelt metal with no template set will no place the metal in the recipe stack instead of the waste stack, this should make it easier to get a recipe to work in the many, many cases where people add the template after smelting the material
|
||||
* Battery sockets and the FENSU now support the copy tool
|
||||
* Removed unused displaylist support from the model loader
|
||||
* DLs have been long phased out in favor of VBOs anyway
|
||||
* Rebranded canned horse slime
|
||||
* Now with extra bone marrow
|
||||
* Updated the deuterium tower's model
|
||||
* Increased the energy requirement for welding osmiridium
|
||||
|
||||
## Fixed
|
||||
* Fixed the CCGT's steam output breaking as soon as the steam buffer runs full
|
||||
* Fixed crash caused by mobs holding belt-fed guns
|
||||
* Fixed boiler heat input being way too low due to operation order (diffusion was applied AFTER the input heat was capped)
|
||||
* Fixed stinger playing its lockon sound on the wrong side
|
||||
# Fixed
|
||||
* Potentially fixed yet another issue regarding crates
|
||||
* Fixed battery socket `fillpercent` RoR function always assuming a max power of 1
|
||||
* Fixed issue where multiblock ports would generate many OpenComputers component entries
|
||||
* Fixed RBMK automatic control rods having incorrect settings when using the copy tool
|
||||
* Fixed battery sockets producing junk debug data in the logs
|
||||
* Fixed an issue where the charging station would crash when trying to charge certain items
|
||||
* Fixed the DFC's core component not dropping its contents when mined
|
||||
* Fixed audio problems with guns
|
||||
@ -1,24 +1,28 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=5224
|
||||
mod_build_number=5572
|
||||
|
||||
credits=HbMinecraft,\
|
||||
\ rodolphito (explosion algorithms),\
|
||||
\ grangerave (explosion algorithms),\
|
||||
\ Hoboy (textures, models),\
|
||||
\ Drillgon200 (effects, models, porting),\
|
||||
\ Drillgon200 (effects, models),\
|
||||
\ MartinTheDragon (calculator, chunk-based fallout, bendable cranes, pipe improvements, PWR sounds),\
|
||||
\ Alcater (GUI textures, porting),\
|
||||
\ MellowArpeggiation (new animation system, turbine sounds, sound fixes, industrial lights, better particle diodes),\
|
||||
\ Alcater (GUI textures),\
|
||||
\ MellowArpeggiation (new animation system, turbine sounds, sound fixes, industrial lights, conveyor wand, NBT structures, MSU displays),\
|
||||
\ Pheo (textures, various machines, models, weapons),\
|
||||
\ Vær (gas centrifuges, better worldgen, ZIRNOX, CP-1 parts, starter guide, new cyclotron, weapon animations),\
|
||||
\ UFFR (RTG pellets, guns, casings, euphemium capacitor, nucleartech.wiki),\
|
||||
\ LePeep (coilgun model, BDCL QC),\
|
||||
\ Adam29 (liquid petroleum, ethanol, electric furnace),\
|
||||
\ Pvndols (thorium fuel recipe, gas turbine),\
|
||||
\ JamesH2 (blood mechanics, nitric acid, particle emitter),\
|
||||
\ Lazzzycat (structures, mob gear),\
|
||||
\ PastaBaguette (coal horse decal),\
|
||||
\ Doctor17 (russian localization)),\
|
||||
\ Pashtet (russian localization),\
|
||||
\ 7H40 (russian localization),\
|
||||
\ RayzerHan (russian localization),\
|
||||
\ Bismarck (chinese localization),\
|
||||
\ Creeper-banner (chinese localization),\
|
||||
\ 5467864 (chinese localization),\
|
||||
@ -30,16 +34,22 @@ credits=HbMinecraft,\
|
||||
\ UnnameTokiko (chinese localization),\
|
||||
\ Herobrine 457985 (chinese localization),\
|
||||
\ xxwinhere (chinese localization),\
|
||||
\ Nycticoraxnightheron (chinese localization),\
|
||||
\ NarekoMichigami810 (chinese localization),\
|
||||
\ Maksymisio (polish localization)\
|
||||
\ el3ctro4ndre (italian localization),\
|
||||
\ Goaty1208 (italian localization),\
|
||||
\ Pu-238 (Tom impact effects),\
|
||||
\ UFFR (RTG pellets, guns, casings, euphemium capacitor),\
|
||||
\ Frooz (gun models),\
|
||||
\ VT-6/24 (models, textures),\
|
||||
\ Nos (models),\
|
||||
\ WushiThe (models),\
|
||||
\ Minecreep (models),\
|
||||
\ 70k (textures, glyphid AI, strand caster, electrolyzer changes),\
|
||||
\ ackbarcrowbars (models),\
|
||||
\ haru315 (spiral point algorithm),\
|
||||
\ mlbv (threaded MK5),\
|
||||
\ 70k (textures, glyphid AI, strand caster, electrolyzer changes, cryolite),\
|
||||
\ instantnootles (concept artist),\
|
||||
\ Sten89 (models),\
|
||||
\ Pixelguru26 (textures),\
|
||||
\ TheBlueHat (textures),\
|
||||
@ -47,16 +57,24 @@ credits=HbMinecraft,\
|
||||
\ TehTemmie (reacher radiation function),\
|
||||
\ Silly541 (config for safe ME drives),\
|
||||
\ Voxelstice (OpenComputers integration, turbine spinup),\
|
||||
\ BallOfEnergy1 (OpenComputers integration),\
|
||||
\ BallOfEnergy1 (OpenComputers integration, RBMK and packet optimization, crate backpacks),\
|
||||
\ PewPewCricket (OpenComputers integration),\
|
||||
\ kelllllen (OpenComputers integration),\
|
||||
\ sdddddf80 (recipe configs, chinese localization, custom machine holograms),\
|
||||
\ Abel1502 (optimization, crate upgrade recipes, strand caster improvements, varous tweaks),\
|
||||
\ Abel1502 (abilities GUI, optimization, crate upgrade recipes, strand caster improvements, varous tweaks),\
|
||||
\ Darek505 (armor rendering compatibility fix),\
|
||||
\ ranch21 (improved HUD gauges),\
|
||||
\ SuperCraftAlex (tooltips)\
|
||||
\ Ice-Arrow (research reactor tweaks),\
|
||||
\ 245tt (anvil GUI improvements),\
|
||||
\ KoblizekXD (doors),\
|
||||
\ FOlkvangrField (custom machine parts),\
|
||||
\ RosaTryp (centrifuge config),\
|
||||
\ Toshayo (satellite loot system, project settings, gradle curse task),\
|
||||
\ Toshayo (satellite loot system, project settings, gradle curse task, OpenComputers integration, fluid counter valve),\
|
||||
\ Dash (PA particle serialization fix),\
|
||||
\ archiecarrot123 (armor rendering compatibility fix),\
|
||||
\ mikkerlo (mining laser & builder's jetpack improvements),\
|
||||
\ icomet (refactoring),\
|
||||
\ martemen (project settings),\
|
||||
\ OvermindDL1 (project settings),\
|
||||
\ impbk2002 (project settings)\
|
||||
|
||||
@ -3,6 +3,7 @@ package api.hbm.block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Deprecated
|
||||
public interface IDrillInteraction {
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package api.hbm.block;
|
||||
|
||||
@Deprecated
|
||||
public interface IMiningDrill {
|
||||
|
||||
/**
|
||||
|
||||
@ -11,8 +11,8 @@ public interface IBatteryItem {
|
||||
public void dischargeBattery(ItemStack stack, long i);
|
||||
public long getCharge(ItemStack stack);
|
||||
public long getMaxCharge(ItemStack stack);
|
||||
public long getChargeRate();
|
||||
public long getDischargeRate();
|
||||
public long getChargeRate(ItemStack stack);
|
||||
public long getDischargeRate(ItemStack stack);
|
||||
|
||||
/** Returns a string for the NBT tag name of the long storing power */
|
||||
public default String getChargeTagName() {
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
package api.hbm.energymk2;
|
||||
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.handler.threading.PacketThreading;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.util.Compat;
|
||||
|
||||
import api.hbm.energymk2.Nodespace.PowerNode;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -25,7 +24,7 @@ public interface IEnergyProviderMK2 extends IEnergyHandlerMK2 {
|
||||
|
||||
public default void tryProvide(World world, int x, int y, int z, ForgeDirection dir) {
|
||||
|
||||
TileEntity te = Compat.getTileStandard(world, x, y, z);
|
||||
TileEntity te = TileAccessCache.getTileOrCache(world, x, y, z);
|
||||
boolean red = false;
|
||||
|
||||
if(te instanceof IEnergyConductorMK2) {
|
||||
@ -43,7 +42,7 @@ public interface IEnergyProviderMK2 extends IEnergyHandlerMK2 {
|
||||
|
||||
if(te instanceof IEnergyReceiverMK2 && te != this) {
|
||||
IEnergyReceiverMK2 rec = (IEnergyReceiverMK2) te;
|
||||
if(rec.canConnect(dir.getOpposite())) {
|
||||
if(rec.canConnect(dir.getOpposite()) && rec.allowDirectProvision()) {
|
||||
long provides = Math.min(this.getPower(), this.getProviderSpeed());
|
||||
long receives = Math.min(rec.getMaxPower() - rec.getPower(), rec.getReceiverSpeed());
|
||||
long toTransfer = Math.min(provides, receives);
|
||||
@ -62,7 +61,7 @@ public interface IEnergyProviderMK2 extends IEnergyHandlerMK2 {
|
||||
data.setDouble("mX", dir.offsetX * (red ? 0.025 : 0.1));
|
||||
data.setDouble("mY", dir.offsetY * (red ? 0.025 : 0.1));
|
||||
data.setDouble("mZ", dir.offsetZ * (red ? 0.025 : 0.1));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.dimensionId, posX, posY, posZ, 25));
|
||||
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.dimensionId, posX, posY, posZ, 25));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package api.hbm.energymk2;
|
||||
|
||||
import com.hbm.handler.threading.PacketThreading;
|
||||
import com.hbm.interfaces.NotableComments;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.util.Compat;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energymk2.Nodespace.PowerNode;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -31,9 +31,14 @@ public interface IEnergyReceiverMK2 extends IEnergyHandlerMK2 {
|
||||
return this.getMaxPower();
|
||||
}
|
||||
|
||||
/** Whether a provider can provide power by touching the block (i.e. via proxies), bypassing the need for a network entirely */
|
||||
public default boolean allowDirectProvision() { return true; }
|
||||
|
||||
public default void trySubscribe(World world, DirPos pos) { trySubscribe(world, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); }
|
||||
|
||||
public default void trySubscribe(World world, int x, int y, int z, ForgeDirection dir) {
|
||||
|
||||
TileEntity te = Compat.getTileStandard(world, x, y, z);
|
||||
TileEntity te = TileAccessCache.getTileOrCache(world, x, y, z);
|
||||
boolean red = false;
|
||||
|
||||
if(te instanceof IEnergyConductorMK2) {
|
||||
@ -58,7 +63,7 @@ public interface IEnergyReceiverMK2 extends IEnergyHandlerMK2 {
|
||||
data.setDouble("mX", -dir.offsetX * (red ? 0.025 : 0.1));
|
||||
data.setDouble("mY", -dir.offsetY * (red ? 0.025 : 0.1));
|
||||
data.setDouble("mZ", -dir.offsetZ * (red ? 0.025 : 0.1));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.dimensionId, posX, posY, posZ, 25));
|
||||
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.dimensionId, posX, posY, posZ, 25));
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,31 +81,6 @@ public interface IEnergyReceiverMK2 extends IEnergyHandlerMK2 {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Project MKUltra was an illegal human experiments program designed and undertaken by the U.S. Central Intelligence Agency (CIA)
|
||||
* to develop procedures and identify drugs that could be used during interrogations to weaken people and force confessions through
|
||||
* brainwashing and psychological torture. It began in 1953 and was halted in 1973. MKUltra used numerous methods to manipulate
|
||||
* its subjects' mental states and brain functions, such as the covert administration of high doses of psychoactive drugs (especially LSD)
|
||||
* and other chemicals without the subjects' consent, electroshocks, hypnosis, sensory deprivation, isolation, verbal and sexual
|
||||
* abuse, and other forms of torture.
|
||||
* MKUltra was preceded by Project Artichoke. It was organized through the CIA's Office of Scientific Intelligence and coordinated
|
||||
* with the United States Army Biological Warfare Laboratories. The program engaged in illegal activities, including the
|
||||
* use of U.S. and Canadian citizens as unwitting test subjects. MKUltra's scope was broad, with activities carried
|
||||
* out under the guise of research at more than 80 institutions aside from the military, including colleges and universities,
|
||||
* hospitals, prisons, and pharmaceutical companies. The CIA operated using front organizations, although some top officials at these
|
||||
* institutions were aware of the CIA's involvement.
|
||||
* MKUltra was revealed to the public in 1975 by the Church Committee of the United States Congress and Gerald Ford's United States
|
||||
* President's Commission on CIA activities within the United States (the Rockefeller Commission). Investigative efforts were hampered
|
||||
* by CIA Director Richard Helms's order that all MKUltra files be destroyed in 1973; the Church Committee and Rockefeller Commission
|
||||
* investigations relied on the sworn testimony of direct participants and on the small number of documents that survived Helms's order.
|
||||
* In 1977, a Freedom of Information Act request uncovered a cache of 20,000 documents relating to MKUltra, which led to Senate hearings.
|
||||
* Some surviving information about MKUltra was declassified in 2001.
|
||||
* */
|
||||
public default ConnectionPriority getPriority() {
|
||||
return ConnectionPriority.NORMAL;
|
||||
}
|
||||
|
||||
/** More is better-er */
|
||||
public enum ConnectionPriority {
|
||||
LOWEST,
|
||||
LOW,
|
||||
@ -108,4 +88,8 @@ public interface IEnergyReceiverMK2 extends IEnergyHandlerMK2 {
|
||||
HIGH,
|
||||
HIGHEST
|
||||
}
|
||||
|
||||
public default ConnectionPriority getPriority() {
|
||||
return ConnectionPriority.NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,161 +1,41 @@
|
||||
package api.hbm.energymk2;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import com.hbm.interfaces.NotableComments;
|
||||
import com.hbm.uninos.GenNode;
|
||||
import com.hbm.uninos.UniNodespace;
|
||||
import com.hbm.uninos.networkproviders.PowerNetProvider;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* The "Nodespace" is an intermediate, "ethereal" layer of abstraction that tracks nodes (i.e. cables) even when they are no longer loaded, allowing continued operation even when unloaded
|
||||
* @author hbm
|
||||
* The dead fucking corpse of nodespace MK1.
|
||||
* A fantastic proof of concept, but ultimately it was killed for being just not that versatile.
|
||||
* This class is mostly just a compatibility husk that should allow uninodespace to slide into the mod with as much lubrication as it deserves.
|
||||
*
|
||||
* @author hbm
|
||||
*/
|
||||
@NotableComments
|
||||
public class Nodespace {
|
||||
|
||||
/** Contains all "NodeWorld" instances, i.e. lists of nodes existing per world */
|
||||
public static HashMap<World, NodeWorld> worlds = new HashMap<>();
|
||||
public static Set<PowerNetMK2> activePowerNets = new HashSet<>();
|
||||
public static final PowerNetProvider THE_POWER_PROVIDER = new PowerNetProvider();
|
||||
|
||||
public static PowerNode getNode(World world, int x, int y, int z) {
|
||||
NodeWorld nodeWorld = worlds.get(world);
|
||||
if(nodeWorld != null) return nodeWorld.nodes.get(new BlockPos(x, y, z));
|
||||
return null;
|
||||
@Deprecated public static PowerNode getNode(World world, int x, int y, int z) {
|
||||
return (PowerNode) UniNodespace.getNode(world, x, y, z, THE_POWER_PROVIDER);
|
||||
}
|
||||
|
||||
public static void createNode(World world, PowerNode node) {
|
||||
NodeWorld nodeWorld = worlds.get(world);
|
||||
if(nodeWorld == null) {
|
||||
nodeWorld = new NodeWorld();
|
||||
worlds.put(world, nodeWorld);
|
||||
}
|
||||
nodeWorld.pushNode(node);
|
||||
@Deprecated public static void createNode(World world, PowerNode node) {
|
||||
UniNodespace.createNode(world, node);
|
||||
}
|
||||
|
||||
public static void destroyNode(World world, int x, int y, int z) {
|
||||
PowerNode node = getNode(world, x, y, z);
|
||||
if(node != null) {
|
||||
worlds.get(world).popNode(node);
|
||||
}
|
||||
}
|
||||
|
||||
/** Goes over each node and manages connections */
|
||||
public static void updateNodespace() {
|
||||
|
||||
for(World world : MinecraftServer.getServer().worldServers) {
|
||||
NodeWorld nodes = worlds.get(world);
|
||||
|
||||
if(nodes == null)
|
||||
continue;
|
||||
|
||||
for(Entry<BlockPos, PowerNode> entry : nodes.nodes.entrySet()) {
|
||||
PowerNode node = entry.getValue();
|
||||
if(!node.hasValidNet() || node.recentlyChanged) {
|
||||
checkNodeConnection(world, node);
|
||||
node.recentlyChanged = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updatePowerNets();
|
||||
}
|
||||
|
||||
private static void updatePowerNets() {
|
||||
|
||||
for(PowerNetMK2 net : activePowerNets) net.resetEnergyTracker(); //reset has to be done before everything else
|
||||
for(PowerNetMK2 net : activePowerNets) net.transferPower();
|
||||
}
|
||||
|
||||
/** Goes over each connection point of the given node, tries to find neighbor nodes and to join networks with them */
|
||||
private static void checkNodeConnection(World world, PowerNode node) {
|
||||
|
||||
for(DirPos con : node.connections) {
|
||||
|
||||
PowerNode conNode = getNode(world, con.getX(), con.getY(), con.getZ()); // get whatever neighbor node intersects with that connection
|
||||
|
||||
if(conNode != null) { // if there is a node at that place
|
||||
|
||||
if(conNode.hasValidNet() && conNode.net == node.net) continue; // if the net is valid and both nodes have the same net, skip
|
||||
|
||||
if(checkConnection(conNode, con, false)) {
|
||||
connectToNode(node, conNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(node.net == null || !node.net.isValid()) new PowerNetMK2().joinLink(node);
|
||||
}
|
||||
|
||||
public static boolean checkConnection(PowerNode connectsTo, DirPos connectFrom, boolean skipSideCheck) {
|
||||
|
||||
for(DirPos revCon : connectsTo.connections) {
|
||||
|
||||
if(revCon.getX() - revCon.getDir().offsetX == connectFrom.getX() && revCon.getY() - revCon.getDir().offsetY == connectFrom.getY() && revCon.getZ() - revCon.getDir().offsetZ == connectFrom.getZ() && (revCon.getDir() == connectFrom.getDir().getOpposite() || skipSideCheck)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Links two nodes with different or potentially no networks */
|
||||
private static void connectToNode(PowerNode origin, PowerNode connection) {
|
||||
|
||||
if(origin.hasValidNet() && connection.hasValidNet()) { // both nodes have nets, but the nets are different (previous assumption), join networks
|
||||
if(origin.net.links.size() > connection.net.links.size()) {
|
||||
origin.net.joinNetworks(connection.net);
|
||||
} else {
|
||||
connection.net.joinNetworks(origin.net);
|
||||
}
|
||||
} else if(!origin.hasValidNet() && connection.hasValidNet()) { // origin has no net, connection does, have origin join connection's net
|
||||
connection.net.joinLink(origin);
|
||||
} else if(origin.hasValidNet() && !connection.hasValidNet()) { // ...and vice versa
|
||||
origin.net.joinLink(connection);
|
||||
}
|
||||
}
|
||||
|
||||
public static class NodeWorld {
|
||||
|
||||
/** Contains a map showing where each node is, a node is every spot that a cable exists at.
|
||||
* Instead of the old proxy system, things like substation now create multiple nodes at their connection points */
|
||||
public HashMap<BlockPos, PowerNode> nodes = new HashMap<>();
|
||||
|
||||
/** Adds a node at all its positions to the nodespace */
|
||||
public void pushNode(PowerNode node) {
|
||||
for(BlockPos pos : node.positions) {
|
||||
nodes.put(pos, node);
|
||||
}
|
||||
}
|
||||
|
||||
/** Removes the specified node from all positions from nodespace */
|
||||
public void popNode(PowerNode node) {
|
||||
if(node.net != null) node.net.destroy();
|
||||
for(BlockPos pos : node.positions) {
|
||||
nodes.remove(pos);
|
||||
node.expired = true;
|
||||
}
|
||||
}
|
||||
|
||||
/** Grabs the node at one position, then removes it from all positions it occupies */
|
||||
public void popNode(BlockPos pos) {
|
||||
PowerNode node = nodes.get(pos);
|
||||
if(node != null) popNode(node);
|
||||
}
|
||||
@Deprecated public static void destroyNode(World world, int x, int y, int z) {
|
||||
UniNodespace.destroyNode(world, x, y, z, THE_POWER_PROVIDER);
|
||||
}
|
||||
|
||||
@NotableComments
|
||||
public static class PowerNode {
|
||||
public static class PowerNode extends GenNode<PowerNetMK2> {
|
||||
|
||||
public BlockPos[] positions;
|
||||
public DirPos[] connections;
|
||||
public PowerNetMK2 net;
|
||||
public boolean expired = false;
|
||||
/**
|
||||
* Okay so here's the deal: The code has shit idiot brain fungus. I don't know why. I re-tested every part involved several times.
|
||||
* I don't know why. But for some reason, during neighbor checks, on certain arbitrary fucking places, the joining operation just fails.
|
||||
@ -167,32 +47,16 @@ public class Nodespace {
|
||||
* breaking, but it seems to allow those parts to connect back to their neighbor nets as they are supposed to. I am not proud of this solution,
|
||||
* this issue shouldn't exist to begin with and I am going fucking insane but it is what it is.
|
||||
*/
|
||||
public boolean recentlyChanged = true;
|
||||
|
||||
public PowerNode(BlockPos... positions) {
|
||||
super(THE_POWER_PROVIDER, positions);
|
||||
this.positions = positions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PowerNode setConnections(DirPos... connections) {
|
||||
this.connections = connections;
|
||||
super.setConnections(connections);
|
||||
return this;
|
||||
}
|
||||
|
||||
public PowerNode addConnection(DirPos connection) {
|
||||
DirPos[] newCons = new DirPos[this.connections.length + 1];
|
||||
for(int i = 0; i < this.connections.length; i++) newCons[i] = this.connections[i];
|
||||
newCons[newCons.length - 1] = connection;
|
||||
this.connections = newCons;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean hasValidNet() {
|
||||
return this.net != null && this.net.isValid();
|
||||
}
|
||||
|
||||
public void setNet(PowerNetMK2 net) {
|
||||
this.net = net;
|
||||
this.recentlyChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,125 +1,32 @@
|
||||
package api.hbm.energymk2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.hbm.uninos.NodeNet;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Random;
|
||||
|
||||
import api.hbm.energymk2.IEnergyReceiverMK2.ConnectionPriority;
|
||||
import api.hbm.energymk2.Nodespace.PowerNode;
|
||||
|
||||
public class PowerNetMK2 {
|
||||
|
||||
public static Random rand = new Random();
|
||||
public boolean valid = true;
|
||||
public Set<PowerNode> links = new HashSet();
|
||||
|
||||
/** Maps all active subscribers to a timestamp, handy for handling timeouts. In a good system this shouldn't be necessary, but the previous system taught me to be cautious anyway */
|
||||
public HashMap<IEnergyReceiverMK2, Long> receiverEntries = new HashMap();
|
||||
public HashMap<IEnergyProviderMK2, Long> providerEntries = new HashMap();
|
||||
/**
|
||||
* Technically MK3 since it's now UNINOS compatible, although UNINOS was build out of 95% nodespace code
|
||||
*
|
||||
* @author hbm
|
||||
*/
|
||||
public class PowerNetMK2 extends NodeNet<IEnergyReceiverMK2, IEnergyProviderMK2, PowerNode> {
|
||||
|
||||
public long energyTracker = 0L;
|
||||
|
||||
public PowerNetMK2() {
|
||||
Nodespace.activePowerNets.add(this);
|
||||
}
|
||||
|
||||
/// SUBSCRIBER HANDLING ///
|
||||
public boolean isSubscribed(IEnergyReceiverMK2 receiver) {
|
||||
return this.receiverEntries.containsKey(receiver);
|
||||
}
|
||||
|
||||
public void addReceiver(IEnergyReceiverMK2 receiver) {
|
||||
this.receiverEntries.put(receiver, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public void removeReceiver(IEnergyReceiverMK2 receiver) {
|
||||
this.receiverEntries.remove(receiver);
|
||||
}
|
||||
|
||||
/// PROVIDER HANDLING ///
|
||||
public boolean isProvider(IEnergyProviderMK2 provider) {
|
||||
return this.providerEntries.containsKey(provider);
|
||||
}
|
||||
|
||||
public void addProvider(IEnergyProviderMK2 provider) {
|
||||
this.providerEntries.put(provider, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public void removeProvider(IEnergyProviderMK2 provider) {
|
||||
this.providerEntries.remove(provider);
|
||||
}
|
||||
|
||||
/// LINK JOINING ///
|
||||
|
||||
/** Combines two networks into one */
|
||||
public void joinNetworks(PowerNetMK2 network) {
|
||||
|
||||
if(network == this) return; //wtf?!
|
||||
|
||||
List<PowerNode> oldNodes = new ArrayList(network.links.size());
|
||||
oldNodes.addAll(network.links); // might prevent oddities related to joining - nvm it does nothing
|
||||
|
||||
for(PowerNode conductor : oldNodes) forceJoinLink(conductor);
|
||||
network.links.clear();
|
||||
|
||||
for(IEnergyReceiverMK2 connector : network.receiverEntries.keySet()) this.addReceiver(connector);
|
||||
for(IEnergyProviderMK2 connector : network.providerEntries.keySet()) this.addProvider(connector);
|
||||
network.destroy();
|
||||
}
|
||||
|
||||
/** Adds the power node as part of this network's links */
|
||||
public PowerNetMK2 joinLink(PowerNode node) {
|
||||
if(node.net != null) node.net.leaveLink(node);
|
||||
return forceJoinLink(node);
|
||||
}
|
||||
|
||||
/** Adds the power node as part of this network's links, skips the part about removing it from existing networks */
|
||||
public PowerNetMK2 forceJoinLink(PowerNode node) {
|
||||
this.links.add(node);
|
||||
node.setNet(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Removes the specified power node */
|
||||
public void leaveLink(PowerNode node) {
|
||||
node.setNet(null);
|
||||
this.links.remove(node);
|
||||
}
|
||||
|
||||
/// GENERAL POWER NET CONTROL ///
|
||||
public void invalidate() {
|
||||
this.valid = false;
|
||||
Nodespace.activePowerNets.remove(this);
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
this.invalidate();
|
||||
for(PowerNode link : this.links) if(link.net == this) link.setNet(null);
|
||||
this.links.clear();
|
||||
this.receiverEntries.clear();
|
||||
this.providerEntries.clear();
|
||||
}
|
||||
|
||||
public void resetEnergyTracker() {
|
||||
this.energyTracker = 0;
|
||||
}
|
||||
|
||||
protected static int timeout = 3_000;
|
||||
|
||||
public void transferPower() {
|
||||
@Override public void resetTrackers() { this.energyTracker = 0; }
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
if(providerEntries.isEmpty()) return;
|
||||
if(receiverEntries.isEmpty()) return;
|
||||
@ -129,15 +36,19 @@ public class PowerNetMK2 {
|
||||
List<Pair<IEnergyProviderMK2, Long>> providers = new ArrayList();
|
||||
long powerAvailable = 0;
|
||||
|
||||
// sum up available power
|
||||
Iterator<Entry<IEnergyProviderMK2, Long>> provIt = providerEntries.entrySet().iterator();
|
||||
while(provIt.hasNext()) {
|
||||
Entry<IEnergyProviderMK2, Long> entry = provIt.next();
|
||||
if(timestamp - entry.getValue() > timeout) { provIt.remove(); continue; }
|
||||
if(timestamp - entry.getValue() > timeout || isBadLink(entry.getKey())) { provIt.remove(); continue; }
|
||||
long src = Math.min(entry.getKey().getPower(), entry.getKey().getProviderSpeed());
|
||||
if(src > 0) {
|
||||
providers.add(new Pair(entry.getKey(), src));
|
||||
powerAvailable += src;
|
||||
}
|
||||
}
|
||||
|
||||
// sum up total demand, categorized by priority
|
||||
List<Pair<IEnergyReceiverMK2, Long>>[] receivers = new ArrayList[ConnectionPriority.values().length];
|
||||
for(int i = 0; i < receivers.length; i++) receivers[i] = new ArrayList();
|
||||
long[] demand = new long[ConnectionPriority.values().length];
|
||||
@ -147,24 +58,27 @@ public class PowerNetMK2 {
|
||||
|
||||
while(recIt.hasNext()) {
|
||||
Entry<IEnergyReceiverMK2, Long> entry = recIt.next();
|
||||
if(timestamp - entry.getValue() > timeout) { recIt.remove(); continue; }
|
||||
if(timestamp - entry.getValue() > timeout || isBadLink(entry.getKey())) { recIt.remove(); continue; }
|
||||
long rec = Math.min(entry.getKey().getMaxPower() - entry.getKey().getPower(), entry.getKey().getReceiverSpeed());
|
||||
if(rec > 0) {
|
||||
int p = entry.getKey().getPriority().ordinal();
|
||||
receivers[p].add(new Pair(entry.getKey(), rec));
|
||||
demand[p] += rec;
|
||||
totalDemand += rec;
|
||||
}
|
||||
}
|
||||
|
||||
long toTransfer = Math.min(powerAvailable, totalDemand);
|
||||
long energyUsed = 0;
|
||||
|
||||
// add power to receivers, ordered by priority
|
||||
for(int i = ConnectionPriority.values().length - 1; i >= 0; i--) {
|
||||
List<Pair<IEnergyReceiverMK2, Long>> list = receivers[i];
|
||||
long priorityDemand = demand[i];
|
||||
|
||||
for(Pair<IEnergyReceiverMK2, Long> entry : list) {
|
||||
double weight = (double) entry.getValue() / (double) (priorityDemand);
|
||||
long toSend = (long) Math.max(toTransfer * weight, 0D);
|
||||
long toSend = (long) Math.min(Math.max(toTransfer * weight, 0D), entry.getValue());
|
||||
energyUsed += (toSend - entry.getKey().transferPower(toSend)); //leftovers are subtracted from the intended amount to use up
|
||||
}
|
||||
|
||||
@ -174,6 +88,7 @@ public class PowerNetMK2 {
|
||||
this.energyTracker += energyUsed;
|
||||
long leftover = energyUsed;
|
||||
|
||||
// remove power from providers
|
||||
for(Pair<IEnergyProviderMK2, Long> entry : providers) {
|
||||
double weight = (double) entry.getValue() / (double) powerAvailable;
|
||||
long toUse = (long) Math.max(energyUsed * weight, 0D);
|
||||
@ -181,7 +96,7 @@ public class PowerNetMK2 {
|
||||
leftover -= toUse;
|
||||
}
|
||||
|
||||
//rounding error compensation, detects surplus that hasn't been used and removes it from random providers
|
||||
// rounding error compensation, detects surplus that hasn't been used and removes it from random providers
|
||||
int iterationsLeft = 100; // whiles without emergency brakes are a bad idea
|
||||
while(iterationsLeft > 0 && leftover > 0 && providers.size() > 0) {
|
||||
iterationsLeft--;
|
||||
@ -195,118 +110,6 @@ public class PowerNetMK2 {
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated public void transferPowerOld() {
|
||||
|
||||
if(providerEntries.isEmpty()) return;
|
||||
if(receiverEntries.isEmpty()) return;
|
||||
|
||||
long timestamp = System.currentTimeMillis();
|
||||
long transferCap = 100_000_000_000_000_00L; // that ought to be enough
|
||||
|
||||
long supply = 0;
|
||||
long demand = 0;
|
||||
long[] priorityDemand = new long[ConnectionPriority.values().length];
|
||||
|
||||
Iterator<Entry<IEnergyProviderMK2, Long>> provIt = providerEntries.entrySet().iterator();
|
||||
while(provIt.hasNext()) {
|
||||
Entry<IEnergyProviderMK2, Long> entry = provIt.next();
|
||||
if(timestamp - entry.getValue() > timeout) { provIt.remove(); continue; }
|
||||
supply += Math.min(entry.getKey().getPower(), entry.getKey().getProviderSpeed());
|
||||
}
|
||||
|
||||
if(supply <= 0) return;
|
||||
|
||||
Iterator<Entry<IEnergyReceiverMK2, Long>> recIt = receiverEntries.entrySet().iterator();
|
||||
while(recIt.hasNext()) {
|
||||
Entry<IEnergyReceiverMK2, Long> entry = recIt.next();
|
||||
if(timestamp - entry.getValue() > timeout) { recIt.remove(); continue; }
|
||||
long rec = Math.min(entry.getKey().getMaxPower() - entry.getKey().getPower(), entry.getKey().getReceiverSpeed());
|
||||
demand += rec;
|
||||
for(int i = 0; i <= entry.getKey().getPriority().ordinal(); i++) priorityDemand[i] += rec;
|
||||
}
|
||||
|
||||
if(demand <= 0) return;
|
||||
|
||||
long toTransfer = Math.min(supply, demand);
|
||||
if(toTransfer > transferCap) toTransfer = transferCap;
|
||||
if(toTransfer <= 0) return;
|
||||
|
||||
List<IEnergyProviderMK2> buffers = new ArrayList();
|
||||
List<IEnergyProviderMK2> providers = new ArrayList();
|
||||
Set<IEnergyReceiverMK2> receiverSet = receiverEntries.keySet();
|
||||
for(IEnergyProviderMK2 provider : providerEntries.keySet()) {
|
||||
if(receiverSet.contains(provider)) {
|
||||
buffers.add(provider);
|
||||
} else {
|
||||
providers.add(provider);
|
||||
}
|
||||
}
|
||||
providers.addAll(buffers); //makes buffers go last
|
||||
List<IEnergyReceiverMK2> receivers = new ArrayList() {{ addAll(receiverSet); }};
|
||||
|
||||
receivers.sort(COMP);
|
||||
|
||||
int maxIteration = 1000;
|
||||
|
||||
//how much the current sender/receiver have already sent/received
|
||||
long prevSrc = 0;
|
||||
long prevDest = 0;
|
||||
|
||||
while(!receivers.isEmpty() && !providers.isEmpty() && maxIteration > 0) {
|
||||
maxIteration--;
|
||||
|
||||
IEnergyProviderMK2 src = providers.get(0);
|
||||
IEnergyReceiverMK2 dest = receivers.get(0);
|
||||
|
||||
if(src.getPower() <= 0) { providers.remove(0); prevSrc = 0; continue; }
|
||||
|
||||
if(src == dest) { // STALEMATE DETECTED
|
||||
//if this happens, a buffer will waste both its share of transfer and receiving potential and do effectively nothing, essentially breaking
|
||||
|
||||
//try if placing the conflicting provider at the end of the list does anything
|
||||
//we do this first because providers have no priority, so we may shuffle those around as much as we want
|
||||
if(providers.size() > 1) {
|
||||
providers.add(providers.get(0));
|
||||
providers.remove(0);
|
||||
prevSrc = 0; //this might cause slight issues due to the tracking being effectively lost while there still might be pending operations
|
||||
continue;
|
||||
}
|
||||
//if that didn't work, try shifting the receiver by one place (to minimize priority breakage)
|
||||
if(receivers.size() > 1) {
|
||||
receivers.add(2, receivers.get(0));
|
||||
receivers.remove(0);
|
||||
prevDest = 0; //ditto
|
||||
continue;
|
||||
}
|
||||
|
||||
//if neither option could be performed, the only conclusion is that this buffer mode battery is alone in the power net, in which case: not my provlem
|
||||
}
|
||||
|
||||
long pd = priorityDemand[dest.getPriority().ordinal()];
|
||||
|
||||
long receiverShare = Math.min((long) Math.ceil((double) Math.min(dest.getMaxPower() - dest.getPower(), dest.getReceiverSpeed()) * (double) supply / (double) pd), dest.getReceiverSpeed()) - prevDest;
|
||||
long providerShare = Math.min((long) Math.ceil((double) Math.min(src.getPower(), src.getProviderSpeed()) * (double) demand / (double) supply), src.getProviderSpeed()) - prevSrc;
|
||||
|
||||
long toDrain = Math.min((long) (src.getPower()), providerShare);
|
||||
long toFill = Math.min(dest.getMaxPower() - dest.getPower(), receiverShare);
|
||||
|
||||
long finalTransfer = Math.min(toDrain, toFill);
|
||||
if(toFill <= 0) { receivers.remove(0); prevDest = 0; continue; }
|
||||
|
||||
finalTransfer -= dest.transferPower(finalTransfer);
|
||||
src.usePower(finalTransfer);
|
||||
|
||||
prevSrc += finalTransfer;
|
||||
prevDest += finalTransfer;
|
||||
|
||||
if(prevSrc >= src.getProviderSpeed()) { providers.remove(0); prevSrc = 0; continue; }
|
||||
if(prevDest >= dest.getReceiverSpeed()) { receivers.remove(0); prevDest = 0; continue; }
|
||||
|
||||
toTransfer -= finalTransfer;
|
||||
this.energyTracker += finalTransfer;
|
||||
}
|
||||
}
|
||||
|
||||
public long sendPowerDiode(long power) {
|
||||
|
||||
if(receiverEntries.isEmpty()) return power;
|
||||
@ -350,14 +153,4 @@ public class PowerNetMK2 {
|
||||
|
||||
return power - energyUsed;
|
||||
}
|
||||
|
||||
public static final ReceiverComparator COMP = new ReceiverComparator();
|
||||
|
||||
public static class ReceiverComparator implements Comparator<IEnergyReceiverMK2> {
|
||||
|
||||
@Override
|
||||
public int compare(IEnergyReceiverMK2 o1, IEnergyReceiverMK2 o2) {
|
||||
return o2.getPriority().ordinal() - o1.getPriority().ordinal();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
public interface IFluidConductor extends IFluidConnector {
|
||||
|
||||
public IPipeNet getPipeNet(FluidType type);
|
||||
|
||||
public void setPipeNet(FluidType type, IPipeNet network);
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, int pressure, long amount) {
|
||||
|
||||
if(this.getPipeNet(type) == null)
|
||||
return amount;
|
||||
|
||||
return this.getPipeNet(type).transferFluid(amount, pressure);
|
||||
}
|
||||
}
|
||||
@ -1,93 +1,6 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.util.Compat;
|
||||
import api.hbm.fluidmk2.IFluidConnectorMK2;
|
||||
|
||||
import api.hbm.tile.ILoadedTile;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidConnector extends ILoadedTile {
|
||||
|
||||
/**
|
||||
* Returns the amount of fluid that remains
|
||||
* @param power
|
||||
* @return
|
||||
*/
|
||||
public long transferFluid(FluidType type, int pressure, long fluid);
|
||||
|
||||
/**
|
||||
* Whether the given side can be connected to
|
||||
* @param dir
|
||||
* @return
|
||||
*/
|
||||
public default boolean canConnect(FluidType type, ForgeDirection dir) {
|
||||
return dir != ForgeDirection.UNKNOWN;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the amount of fluid that this machine is able to receive
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public long getDemand(FluidType type, int pressure);
|
||||
|
||||
/**
|
||||
* Basic implementation of subscribing to a nearby power grid
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
*/
|
||||
public default void trySubscribe(FluidType type, World world, int x, int y, int z, ForgeDirection dir) {
|
||||
|
||||
TileEntity te = Compat.getTileStandard(world, x, y, z);
|
||||
boolean red = false;
|
||||
|
||||
if(te instanceof IFluidConductor) {
|
||||
IFluidConductor con = (IFluidConductor) te;
|
||||
|
||||
if(!con.canConnect(type, dir))
|
||||
return;
|
||||
|
||||
if(con.getPipeNet(type) != null && !con.getPipeNet(type).isSubscribed(this))
|
||||
con.getPipeNet(type).subscribe(this);
|
||||
|
||||
if(con.getPipeNet(type) != null)
|
||||
red = true;
|
||||
}
|
||||
|
||||
if(particleDebug) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "network");
|
||||
data.setString("mode", "fluid");
|
||||
data.setInteger("color", type.getColor());
|
||||
double posX = x + 0.5 + dir.offsetX * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
|
||||
double posY = y + 0.5 + dir.offsetY * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
|
||||
double posZ = z + 0.5 + dir.offsetZ * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
|
||||
data.setDouble("mX", -dir.offsetX * (red ? 0.025 : 0.1));
|
||||
data.setDouble("mY", -dir.offsetY * (red ? 0.025 : 0.1));
|
||||
data.setDouble("mZ", -dir.offsetZ * (red ? 0.025 : 0.1));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.dimensionId, posX, posY, posZ, 25));
|
||||
}
|
||||
}
|
||||
|
||||
public default void tryUnsubscribe(FluidType type, World world, int x, int y, int z) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof IFluidConductor) {
|
||||
IFluidConductor con = (IFluidConductor) te;
|
||||
|
||||
if(con.getPipeNet(type) != null && con.getPipeNet(type).isSubscribed(this))
|
||||
con.getPipeNet(type).unsubscribe(this);
|
||||
}
|
||||
}
|
||||
|
||||
public static final boolean particleDebug = false;
|
||||
}
|
||||
@Deprecated
|
||||
public interface IFluidConnector extends IFluidConnectorMK2 { }
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import api.hbm.fluidmk2.IFluidConnectorBlockMK2;
|
||||
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidConnectorBlock {
|
||||
|
||||
/** dir is the face that is connected to, the direction going outwards from the block */
|
||||
public boolean canConnect(FluidType type, IBlockAccess world, int x, int y, int z, ForgeDirection dir);
|
||||
}
|
||||
@Deprecated
|
||||
public interface IFluidConnectorBlock extends IFluidConnectorBlockMK2 { }
|
||||
|
||||
@ -1,49 +1,35 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.uninos.GenNode;
|
||||
import com.hbm.uninos.UniNodespace;
|
||||
|
||||
/**
|
||||
* Uses default implementation to make the underlying interfaces easier to use for the most common fluid users.
|
||||
* Only handles a single input tank of the same type.
|
||||
* Uses standard FluidTanks which use int32.
|
||||
* Don't use this as part of the API!
|
||||
* @author hbm
|
||||
*
|
||||
*/
|
||||
public interface IFluidStandardReceiver extends IFluidUser {
|
||||
import api.hbm.fluidmk2.IFluidStandardReceiverMK2;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, int pressure, long amount) {
|
||||
@Deprecated
|
||||
public interface IFluidStandardReceiver extends IFluidStandardReceiverMK2 {
|
||||
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
tank.setFill(tank.getFill() + (int) amount);
|
||||
|
||||
if(tank.getFill() > tank.getMaxFill()) {
|
||||
long overshoot = tank.getFill() - tank.getMaxFill();
|
||||
tank.setFill(tank.getMaxFill());
|
||||
return overshoot;
|
||||
public default void subscribeToAllAround(FluidType type, TileEntity tile) {
|
||||
subscribeToAllAround(type, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord);
|
||||
}
|
||||
|
||||
return 0;
|
||||
public default void subscribeToAllAround(FluidType type, World world, int x, int y, int z) {
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
trySubscribe(type, world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir);
|
||||
}
|
||||
}
|
||||
|
||||
return amount;
|
||||
public default void tryUnsubscribe(FluidType type, World world, int x, int y, int z) {
|
||||
GenNode node = UniNodespace.getNode(world, x, y, z, type.getNetworkProvider());
|
||||
if(node != null && node.net != null) node.net.removeReceiver(this);
|
||||
}
|
||||
|
||||
public FluidTank[] getReceivingTanks();
|
||||
|
||||
@Override
|
||||
public default long getDemand(FluidType type, int pressure) {
|
||||
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
return tank.getMaxFill() - tank.getFill();
|
||||
public default void unsubscribeToAllAround(FluidType type, TileEntity tile) {
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
tryUnsubscribe(type, tile.getWorldObj(), tile.xCoord + dir.offsetX, tile.yCoord + dir.offsetY, tile.zCoord + dir.offsetZ);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,50 +1,22 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
|
||||
/**
|
||||
* Uses default implementation to make the underlying interfaces easier to use for the most common fluid users.
|
||||
* Only handles a single output tank of the same type.
|
||||
* Uses standard FluidTanks which use int32.
|
||||
* Don't use this as part of the API!
|
||||
* @author hbm
|
||||
*
|
||||
*/
|
||||
public interface IFluidStandardSender extends IFluidUser {
|
||||
import api.hbm.fluidmk2.IFluidStandardSenderMK2;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public FluidTank[] getSendingTanks();
|
||||
@Deprecated
|
||||
public interface IFluidStandardSender extends IFluidStandardSenderMK2 {
|
||||
|
||||
@Override
|
||||
public default long getTotalFluidForSend(FluidType type, int pressure) {
|
||||
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
return tank.getFill();
|
||||
}
|
||||
public default void sendFluid(FluidTank tank, World world, int x, int y, int z, ForgeDirection dir) {
|
||||
tryProvide(tank, world, x, y, z, dir);
|
||||
}
|
||||
|
||||
return 0;
|
||||
public default void sendFluidToAll(FluidTank tank, TileEntity tile) {
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
tryProvide(tank, tile.getWorldObj(), tile.xCoord + dir.offsetX, tile.yCoord + dir.offsetY, tile.zCoord + dir.offsetZ, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public default void removeFluidForTransfer(FluidType type, int pressure, long amount) {
|
||||
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
tank.setFill(tank.getFill() - (int) amount);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, int pressure, long fluid) {
|
||||
return fluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public default long getDemand(FluidType type, int pressure) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,79 +1,4 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
|
||||
/**
|
||||
* transceiver [trăn-sē′vər], noun
|
||||
*
|
||||
* 1. A transmitter and receiver housed together in a single unit and having some circuits in common, often for portable or mobile use.
|
||||
* 2. A combined radio transmitter and receiver.
|
||||
* 3. A device that performs transmitting and receiving functions, especially if using common components.
|
||||
*
|
||||
* The American Heritage® Dictionary of the English Language, 5th Edition.
|
||||
*
|
||||
* Only supports one tank per type (for in- and output separately)
|
||||
*
|
||||
* @author hbm
|
||||
*
|
||||
*/
|
||||
public interface IFluidStandardTransceiver extends IFluidUser {
|
||||
|
||||
public FluidTank[] getSendingTanks();
|
||||
public FluidTank[] getReceivingTanks();
|
||||
|
||||
@Override
|
||||
public default long getTotalFluidForSend(FluidType type, int pressure) {
|
||||
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
return tank.getFill();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public default void removeFluidForTransfer(FluidType type, int pressure, long amount) {
|
||||
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
tank.setFill(tank.getFill() - (int) amount);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public default long getDemand(FluidType type, int pressure) {
|
||||
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
return tank.getMaxFill() - tank.getFill();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, int pressure, long amount) {
|
||||
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
tank.setFill(tank.getFill() + (int) amount);
|
||||
|
||||
if(tank.getFill() > tank.getMaxFill()) {
|
||||
long overshoot = tank.getFill() - tank.getMaxFill();
|
||||
tank.setFill(tank.getMaxFill());
|
||||
return overshoot;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
}
|
||||
@Deprecated
|
||||
public interface IFluidStandardTransceiver extends IFluidStandardReceiver, IFluidStandardSender { }
|
||||
|
||||
@ -1,130 +0,0 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.util.Compat;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidUser extends IFluidConnector {
|
||||
|
||||
public default void sendFluid(FluidTank tank, World world, int x, int y, int z, ForgeDirection dir) {
|
||||
sendFluid(tank.getTankType(), tank.getPressure(), world, x, y, z, dir);
|
||||
}
|
||||
|
||||
public default void sendFluid(FluidType type, int pressure, World world, int x, int y, int z, ForgeDirection dir) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
boolean wasSubscribed = false;
|
||||
boolean red = false;
|
||||
|
||||
if(te instanceof IFluidConductor) {
|
||||
IFluidConductor con = (IFluidConductor) te;
|
||||
|
||||
if(con.getPipeNet(type) != null && con.getPipeNet(type).isSubscribed(this)) {
|
||||
con.getPipeNet(type).unsubscribe(this);
|
||||
wasSubscribed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(te instanceof IFluidConnector) {
|
||||
IFluidConnector con = (IFluidConnector) te;
|
||||
|
||||
if(con.canConnect(type, dir.getOpposite())) {
|
||||
long toSend = this.getTotalFluidForSend(type, pressure);
|
||||
|
||||
if(toSend > 0) {
|
||||
long transfer = toSend - con.transferFluid(type, pressure, toSend);
|
||||
this.removeFluidForTransfer(type, pressure, transfer);
|
||||
}
|
||||
red = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(wasSubscribed && te instanceof IFluidConductor) {
|
||||
IFluidConductor con = (IFluidConductor) te;
|
||||
|
||||
if(con.getPipeNet(type) != null && !con.getPipeNet(type).isSubscribed(this)) {
|
||||
con.getPipeNet(type).subscribe(this);
|
||||
}
|
||||
}
|
||||
|
||||
if(particleDebug) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "network");
|
||||
data.setString("mode", "fluid");
|
||||
data.setInteger("color", type.getColor());
|
||||
double posX = x + 0.5 - dir.offsetX * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
|
||||
double posY = y + 0.5 - dir.offsetY * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
|
||||
double posZ = z + 0.5 - dir.offsetZ * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
|
||||
data.setDouble("mX", dir.offsetX * (red ? 0.025 : 0.1));
|
||||
data.setDouble("mY", dir.offsetY * (red ? 0.025 : 0.1));
|
||||
data.setDouble("mZ", dir.offsetZ * (red ? 0.025 : 0.1));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.dimensionId, posX, posY, posZ, 25));
|
||||
}
|
||||
}
|
||||
|
||||
public static IPipeNet getPipeNet(World world, int x, int y, int z, FluidType type) {
|
||||
|
||||
TileEntity te = Compat.getTileStandard(world, x, y, z);
|
||||
|
||||
if(te instanceof IFluidConductor) {
|
||||
IFluidConductor con = (IFluidConductor) te;
|
||||
|
||||
if(con.getPipeNet(type) != null) {
|
||||
return con.getPipeNet(type);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Use more common conPos method instead */
|
||||
@Deprecated public default void sendFluidToAll(FluidTank tank, TileEntity te) {
|
||||
sendFluidToAll(tank.getTankType(), tank.getPressure(), te);
|
||||
}
|
||||
|
||||
/** Use more common conPos method instead */
|
||||
@Deprecated public default void sendFluidToAll(FluidType type, int pressure, TileEntity te) {
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
sendFluid(type, pressure, te.getWorldObj(), te.xCoord + dir.offsetX, te.yCoord + dir.offsetY, te.zCoord + dir.offsetZ, dir);
|
||||
}
|
||||
}
|
||||
|
||||
public default long getTotalFluidForSend(FluidType type, int pressure) { return 0; }
|
||||
public default void removeFluidForTransfer(FluidType type, int pressure, long amount) { }
|
||||
|
||||
public default void subscribeToAllAround(FluidType type, TileEntity te) {
|
||||
subscribeToAllAround(type, te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord);
|
||||
}
|
||||
|
||||
public default void subscribeToAllAround(FluidType type, World world, int x, int y, int z) {
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
this.trySubscribe(type, world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir);
|
||||
}
|
||||
|
||||
public default void unsubscribeToAllAround(FluidType type, TileEntity te) {
|
||||
unsubscribeToAllAround(type, te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord);
|
||||
}
|
||||
|
||||
public default void unsubscribeToAllAround(FluidType type, World world, int x, int y, int z) {
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
this.tryUnsubscribe(type, world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all internal tanks of this tile. Not used by the fluid network, it should only be used for display purposes or edge cases that can't be solved otherwise.
|
||||
* The array is either composed of the original tank or outright the original tank array, so changes done to this array will extend to the IFluidUser.
|
||||
* @return
|
||||
*/
|
||||
public FluidTank[] getAllTanks();
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
public interface IPipeNet {
|
||||
|
||||
public void joinNetworks(IPipeNet network);
|
||||
|
||||
public List<IFluidConductor> getLinks();
|
||||
public HashSet<IFluidConnector> getSubscribers();
|
||||
|
||||
public IPipeNet joinLink(IFluidConductor conductor);
|
||||
public void leaveLink(IFluidConductor conductor);
|
||||
|
||||
public void subscribe(IFluidConnector connector);
|
||||
public void unsubscribe(IFluidConnector connector);
|
||||
public boolean isSubscribed(IFluidConnector connector);
|
||||
|
||||
public void destroy();
|
||||
|
||||
public boolean isValid();
|
||||
|
||||
public long transferFluid(long fill, int pressure);
|
||||
public FluidType getType();
|
||||
public BigInteger getTotalTransfer();
|
||||
}
|
||||
@ -1,205 +0,0 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class PipeNet implements IPipeNet {
|
||||
|
||||
private boolean valid = true;
|
||||
private FluidType type;
|
||||
private List<IFluidConductor> links = new ArrayList();
|
||||
private HashSet<IFluidConnector> subscribers = new HashSet();
|
||||
|
||||
public static List<PipeNet> trackingInstances = null;
|
||||
protected BigInteger totalTransfer = BigInteger.ZERO;
|
||||
public List<String> debug = new ArrayList();
|
||||
|
||||
public PipeNet(FluidType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void joinNetworks(IPipeNet network) {
|
||||
|
||||
if(network == this)
|
||||
return;
|
||||
|
||||
for(IFluidConductor conductor : network.getLinks()) {
|
||||
conductor.setPipeNet(type, this);
|
||||
this.getLinks().add(conductor);
|
||||
}
|
||||
network.getLinks().clear();
|
||||
|
||||
for(IFluidConnector connector : network.getSubscribers()) {
|
||||
this.subscribe(connector);
|
||||
}
|
||||
|
||||
network.destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidConductor> getLinks() {
|
||||
return links;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashSet<IFluidConnector> getSubscribers() {
|
||||
return subscribers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPipeNet joinLink(IFluidConductor conductor) {
|
||||
|
||||
if(conductor.getPipeNet(type) != null)
|
||||
conductor.getPipeNet(type).leaveLink(conductor);
|
||||
|
||||
conductor.setPipeNet(type, this);
|
||||
this.links.add(conductor);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void leaveLink(IFluidConductor conductor) {
|
||||
conductor.setPipeNet(type, null);
|
||||
this.links.remove(conductor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subscribe(IFluidConnector connector) {
|
||||
this.subscribers.add(connector);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsubscribe(IFluidConnector connector) {
|
||||
this.subscribers.remove(connector);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSubscribed(IFluidConnector connector) {
|
||||
return this.subscribers.contains(connector);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long transferFluid(long fill, int pressure) {
|
||||
|
||||
subscribers.removeIf(x ->
|
||||
x == null || !(x instanceof TileEntity) || ((TileEntity)x).isInvalid() || !x.isLoaded()
|
||||
);
|
||||
|
||||
if(this.subscribers.isEmpty())
|
||||
return fill;
|
||||
|
||||
trackingInstances = new ArrayList();
|
||||
trackingInstances.add(this);
|
||||
List<IFluidConnector> subList = new ArrayList(subscribers);
|
||||
return fairTransfer(subList, type, pressure, fill);
|
||||
}
|
||||
|
||||
public static long fairTransfer(List<IFluidConnector> subList, FluidType type, int pressure, long fill) {
|
||||
|
||||
if(fill <= 0) return 0;
|
||||
|
||||
List<Long> weight = new ArrayList();
|
||||
long totalReq = 0;
|
||||
|
||||
for(IFluidConnector con : subList) {
|
||||
long req = con.getDemand(type, pressure);
|
||||
weight.add(req);
|
||||
totalReq += req;
|
||||
}
|
||||
|
||||
if(totalReq == 0)
|
||||
return fill;
|
||||
|
||||
long totalGiven = 0;
|
||||
|
||||
for(int i = 0; i < subList.size(); i++) {
|
||||
IFluidConnector con = subList.get(i);
|
||||
long req = weight.get(i);
|
||||
double fraction = (double)req / (double)totalReq;
|
||||
|
||||
long given = (long) Math.floor(fraction * fill);
|
||||
|
||||
if(given > 0) {
|
||||
|
||||
totalGiven += (given - con.transferFluid(type, pressure, given));
|
||||
|
||||
if(con instanceof TileEntity) {
|
||||
TileEntity tile = (TileEntity) con;
|
||||
tile.getWorldObj().markTileEntityChunkModified(tile.xCoord, tile.yCoord, tile.zCoord, tile);
|
||||
}
|
||||
|
||||
/* debug code
|
||||
if(trackingInstances != null) {
|
||||
for(int j = 0; j < trackingInstances.size(); j++) {
|
||||
PipeNet net = trackingInstances.get(j);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss:SSS");
|
||||
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
log(net, sdf.format(new Date(System.currentTimeMillis())) + " Sending " + given + "mB to " + conToString(con));
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
if(trackingInstances != null) {
|
||||
|
||||
for(int i = 0; i < trackingInstances.size(); i++) {
|
||||
PipeNet net = trackingInstances.get(i);
|
||||
net.totalTransfer = net.totalTransfer.add(BigInteger.valueOf(totalGiven));
|
||||
}
|
||||
}
|
||||
|
||||
return fill - totalGiven;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
this.valid = false;
|
||||
this.subscribers.clear();
|
||||
|
||||
for(IFluidConductor con : this.links)
|
||||
con.setPipeNet(type, null);
|
||||
|
||||
this.links.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigInteger getTotalTransfer() {
|
||||
return this.totalTransfer;
|
||||
}
|
||||
|
||||
public static void log(PipeNet net, String msg) {
|
||||
net.debug.add(msg);
|
||||
|
||||
while(net.debug.size() > 50) {
|
||||
net.debug.remove(0);
|
||||
}
|
||||
}
|
||||
|
||||
public static String conToString(IFluidConnector con) {
|
||||
|
||||
if(con instanceof TileEntity) {
|
||||
TileEntity tile = (TileEntity) con;
|
||||
return tile.getClass().getSimpleName() + " @ " + tile.xCoord + "/" + tile.yCoord + "/" + tile.zCoord;
|
||||
}
|
||||
|
||||
return "" + con;
|
||||
}
|
||||
}
|
||||
152
src/main/java/api/hbm/fluidmk2/FluidNetMK2.java
Normal file
152
src/main/java/api/hbm/fluidmk2/FluidNetMK2.java
Normal file
@ -0,0 +1,152 @@
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.uninos.NodeNet;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import api.hbm.energymk2.IEnergyReceiverMK2.ConnectionPriority;
|
||||
|
||||
public class FluidNetMK2 extends NodeNet<IFluidReceiverMK2, IFluidProviderMK2, FluidNode> {
|
||||
|
||||
public long fluidTracker = 0L;
|
||||
|
||||
protected static int timeout = 3_000;
|
||||
protected static long currentTime = 0;
|
||||
protected FluidType type;
|
||||
|
||||
public FluidNetMK2(FluidType type) {
|
||||
this.type = type;
|
||||
for(int i = 0; i < IFluidUserMK2.HIGHEST_VALID_PRESSURE + 1; i++) providers[i] = new ArrayList();
|
||||
for(int i = 0; i < IFluidUserMK2.HIGHEST_VALID_PRESSURE + 1; i++) for(int j = 0; j < ConnectionPriority.values().length; j++) receivers[i][j] = new ArrayList();
|
||||
}
|
||||
|
||||
@Override public void resetTrackers() { this.fluidTracker = 0; }
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
if(providerEntries.isEmpty()) return;
|
||||
if(receiverEntries.isEmpty()) return;
|
||||
currentTime = System.currentTimeMillis();
|
||||
|
||||
setupFluidProviders();
|
||||
setupFluidReceivers();
|
||||
transferFluid();
|
||||
|
||||
cleanUp();
|
||||
}
|
||||
|
||||
//this sucks ass, but it makes the code just a smidge more structured
|
||||
public long[] fluidAvailable = new long[IFluidUserMK2.HIGHEST_VALID_PRESSURE + 1];
|
||||
public List<Pair<IFluidProviderMK2, Long>>[] providers = new ArrayList[IFluidUserMK2.HIGHEST_VALID_PRESSURE + 1];
|
||||
public long[][] fluidDemand = new long[IFluidUserMK2.HIGHEST_VALID_PRESSURE + 1][ConnectionPriority.values().length];
|
||||
public List<Pair<IFluidReceiverMK2, Long>>[][] receivers = new ArrayList[IFluidUserMK2.HIGHEST_VALID_PRESSURE + 1][ConnectionPriority.values().length];
|
||||
public long[] transfered = new long[IFluidUserMK2.HIGHEST_VALID_PRESSURE + 1];
|
||||
|
||||
public void setupFluidProviders() {
|
||||
Iterator<Entry<IFluidProviderMK2, Long>> iterator = providerEntries.entrySet().iterator();
|
||||
|
||||
while(iterator.hasNext()) {
|
||||
Entry<IFluidProviderMK2, Long> entry = iterator.next();
|
||||
if(currentTime - entry.getValue() > timeout || isBadLink(entry.getKey())) { iterator.remove(); continue; }
|
||||
IFluidProviderMK2 provider = entry.getKey();
|
||||
int[] pressureRange = provider.getProvidingPressureRange(type);
|
||||
for(int p = pressureRange[0]; p <= pressureRange[1]; p++) {
|
||||
long available = Math.min(provider.getFluidAvailable(type, p), provider.getProviderSpeed(type, p));
|
||||
providers[p].add(new Pair(provider, available));
|
||||
fluidAvailable[p] += available;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setupFluidReceivers() {
|
||||
Iterator<Entry<IFluidReceiverMK2, Long>> iterator = receiverEntries.entrySet().iterator();
|
||||
|
||||
while(iterator.hasNext()) {
|
||||
Entry<IFluidReceiverMK2, Long> entry = iterator.next();
|
||||
if(currentTime - entry.getValue() > timeout || isBadLink(entry.getKey())) { iterator.remove(); continue; }
|
||||
IFluidReceiverMK2 receiver = entry.getKey();
|
||||
int[] pressureRange = receiver.getReceivingPressureRange(type);
|
||||
for(int p = pressureRange[0]; p <= pressureRange[1]; p++) {
|
||||
long required = Math.min(receiver.getDemand(type, p), receiver.getReceiverSpeed(type, p));
|
||||
int priority = receiver.getFluidPriority().ordinal();
|
||||
receivers[p][priority].add(new Pair(receiver, required));
|
||||
fluidDemand[p][priority] += required;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void transferFluid() {
|
||||
|
||||
long[] received = new long[IFluidUserMK2.HIGHEST_VALID_PRESSURE + 1];
|
||||
long[] notAccountedFor = new long[IFluidUserMK2.HIGHEST_VALID_PRESSURE + 1];
|
||||
|
||||
for(int p = 0; p <= IFluidUserMK2.HIGHEST_VALID_PRESSURE; p++) { // if the pressure range were ever to increase, we might have to rethink this
|
||||
|
||||
long totalAvailable = fluidAvailable[p];
|
||||
|
||||
for(int i = ConnectionPriority.values().length - 1; i >= 0; i--) {
|
||||
|
||||
long toTransfer = Math.min(fluidDemand[p][i], totalAvailable);
|
||||
if(toTransfer <= 0) continue;
|
||||
|
||||
long priorityDemand = fluidDemand[p][i];
|
||||
|
||||
for(Pair<IFluidReceiverMK2, Long> entry : receivers[p][i]) {
|
||||
double weight = (double) entry.getValue() / (double) (priorityDemand);
|
||||
long toSend = (long) Math.max(toTransfer * weight, 0D);
|
||||
toSend -= entry.getKey().transferFluid(type, p, toSend);
|
||||
received[p] += toSend;
|
||||
fluidTracker += toSend;
|
||||
}
|
||||
|
||||
totalAvailable -= received[p];
|
||||
}
|
||||
|
||||
notAccountedFor[p] = received[p];
|
||||
}
|
||||
|
||||
for(int p = 0; p <= IFluidUserMK2.HIGHEST_VALID_PRESSURE; p++) {
|
||||
|
||||
for(Pair<IFluidProviderMK2, Long> entry : providers[p]) {
|
||||
double weight = (double) entry.getValue() / (double) fluidAvailable[p];
|
||||
long toUse = (long) Math.max(received[p] * weight, 0D);
|
||||
entry.getKey().useUpFluid(type, p, toUse);
|
||||
notAccountedFor[p] -= toUse;
|
||||
}
|
||||
}
|
||||
|
||||
for(int p = 0; p <= IFluidUserMK2.HIGHEST_VALID_PRESSURE; p++) {
|
||||
|
||||
int iterationsLeft = 100;
|
||||
while(iterationsLeft > 0 && notAccountedFor[p] > 0 && providers[p].size() > 0) {
|
||||
iterationsLeft--;
|
||||
|
||||
Pair<IFluidProviderMK2, Long> selected = providers[p].get(rand.nextInt(providers[p].size()));
|
||||
IFluidProviderMK2 scapegoat = selected.getKey();
|
||||
|
||||
long toUse = Math.min(notAccountedFor[p], scapegoat.getFluidAvailable(type, p));
|
||||
scapegoat.useUpFluid(type, p, toUse);
|
||||
notAccountedFor[p] -= toUse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void cleanUp() {
|
||||
for(int i = 0; i < IFluidUserMK2.HIGHEST_VALID_PRESSURE + 1; i++) {
|
||||
fluidAvailable[i] = 0;
|
||||
providers[i].clear();
|
||||
transfered[i] = 0;
|
||||
|
||||
for(int j = 0; j < ConnectionPriority.values().length; j++) {
|
||||
fluidDemand[i][j] = 0;
|
||||
receivers[i][j].clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
19
src/main/java/api/hbm/fluidmk2/FluidNode.java
Normal file
19
src/main/java/api/hbm/fluidmk2/FluidNode.java
Normal file
@ -0,0 +1,19 @@
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
import com.hbm.uninos.GenNode;
|
||||
import com.hbm.uninos.INetworkProvider;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
public class FluidNode extends GenNode<FluidNetMK2> {
|
||||
|
||||
public FluidNode(INetworkProvider<FluidNetMK2> provider, BlockPos... positions) {
|
||||
super(provider, positions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidNode setConnections(DirPos... connections) {
|
||||
super.setConnections(connections);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package api.hbm.fluid;
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
12
src/main/java/api/hbm/fluidmk2/IFluidConnectorBlockMK2.java
Normal file
12
src/main/java/api/hbm/fluidmk2/IFluidConnectorBlockMK2.java
Normal file
@ -0,0 +1,12 @@
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidConnectorBlockMK2 {
|
||||
|
||||
/** dir is the face that is connected to, the direction going outwards from the block */
|
||||
public boolean canConnect(FluidType type, IBlockAccess world, int x, int y, int z, ForgeDirection dir);
|
||||
}
|
||||
17
src/main/java/api/hbm/fluidmk2/IFluidConnectorMK2.java
Normal file
17
src/main/java/api/hbm/fluidmk2/IFluidConnectorMK2.java
Normal file
@ -0,0 +1,17 @@
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidConnectorMK2 {
|
||||
|
||||
/**
|
||||
* Whether the given side can be connected to
|
||||
* @param dir
|
||||
* @return
|
||||
*/
|
||||
public default boolean canConnect(FluidType type, ForgeDirection dir) {
|
||||
return dir != ForgeDirection.UNKNOWN;
|
||||
}
|
||||
}
|
||||
27
src/main/java/api/hbm/fluidmk2/IFluidPipeMK2.java
Normal file
27
src/main/java/api/hbm/fluidmk2/IFluidPipeMK2.java
Normal file
@ -0,0 +1,27 @@
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
/**
|
||||
* IFluidConductorMK2 with added node creation method
|
||||
* @author hbm
|
||||
*/
|
||||
public interface IFluidPipeMK2 extends IFluidConnectorMK2 {
|
||||
|
||||
public default FluidNode createNode(FluidType type) {
|
||||
TileEntity tile = (TileEntity) this;
|
||||
return new FluidNode(type.getNetworkProvider(), new BlockPos(tile.xCoord, tile.yCoord, tile.zCoord)).setConnections(
|
||||
new DirPos(tile.xCoord + 1, tile.yCoord, tile.zCoord, Library.POS_X),
|
||||
new DirPos(tile.xCoord - 1, tile.yCoord, tile.zCoord, Library.NEG_X),
|
||||
new DirPos(tile.xCoord, tile.yCoord + 1, tile.zCoord, Library.POS_Y),
|
||||
new DirPos(tile.xCoord, tile.yCoord - 1, tile.zCoord, Library.NEG_Y),
|
||||
new DirPos(tile.xCoord, tile.yCoord, tile.zCoord + 1, Library.POS_Z),
|
||||
new DirPos(tile.xCoord, tile.yCoord, tile.zCoord - 1, Library.NEG_Z)
|
||||
);
|
||||
}
|
||||
}
|
||||
12
src/main/java/api/hbm/fluidmk2/IFluidProviderMK2.java
Normal file
12
src/main/java/api/hbm/fluidmk2/IFluidProviderMK2.java
Normal file
@ -0,0 +1,12 @@
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
public interface IFluidProviderMK2 extends IFluidUserMK2 {
|
||||
|
||||
public void useUpFluid(FluidType type, int pressure, long amount);
|
||||
public default long getProviderSpeed(FluidType type, int pressure) { return 1_000_000_000; }
|
||||
public long getFluidAvailable(FluidType type, int pressure);
|
||||
|
||||
public default int[] getProvidingPressureRange(FluidType type) { return DEFAULT_PRESSURE_RANGE; }
|
||||
}
|
||||
63
src/main/java/api/hbm/fluidmk2/IFluidReceiverMK2.java
Normal file
63
src/main/java/api/hbm/fluidmk2/IFluidReceiverMK2.java
Normal file
@ -0,0 +1,63 @@
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.uninos.GenNode;
|
||||
import com.hbm.uninos.UniNodespace;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energymk2.IEnergyReceiverMK2.ConnectionPriority;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidReceiverMK2 extends IFluidUserMK2 {
|
||||
|
||||
/** Sends fluid of the desired type and pressure to the receiver, returns the remainder */
|
||||
public long transferFluid(FluidType type, int pressure, long amount);
|
||||
public default long getReceiverSpeed(FluidType type, int pressure) { return 1_000_000_000; }
|
||||
public long getDemand(FluidType type, int pressure);
|
||||
|
||||
public default int[] getReceivingPressureRange(FluidType type) { return DEFAULT_PRESSURE_RANGE; }
|
||||
|
||||
public default void trySubscribe(FluidType type, World world, DirPos pos) { trySubscribe(type, world, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); }
|
||||
|
||||
public default void trySubscribe(FluidType type, World world, int x, int y, int z, ForgeDirection dir) {
|
||||
|
||||
TileEntity te = TileAccessCache.getTileOrCache(world, x, y, z);
|
||||
boolean red = false;
|
||||
|
||||
if(te instanceof IFluidConnectorMK2) {
|
||||
IFluidConnectorMK2 con = (IFluidConnectorMK2) te;
|
||||
if(!con.canConnect(type, dir.getOpposite())) return;
|
||||
|
||||
GenNode node = UniNodespace.getNode(world, x, y, z, type.getNetworkProvider());
|
||||
|
||||
if(node != null && node.net != null) {
|
||||
node.net.addReceiver(this);
|
||||
red = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(particleDebug) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "network");
|
||||
data.setString("mode", "fluid");
|
||||
data.setInteger("color", type.getColor());
|
||||
double posX = x + 0.5 + dir.offsetX * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
|
||||
double posY = y + 0.5 + dir.offsetY * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
|
||||
double posZ = z + 0.5 + dir.offsetZ * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
|
||||
data.setDouble("mX", -dir.offsetX * (red ? 0.025 : 0.1));
|
||||
data.setDouble("mY", -dir.offsetY * (red ? 0.025 : 0.1));
|
||||
data.setDouble("mZ", -dir.offsetZ * (red ? 0.025 : 0.1));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.dimensionId, posX, posY, posZ, 25));
|
||||
}
|
||||
}
|
||||
|
||||
public default ConnectionPriority getFluidPriority() {
|
||||
return ConnectionPriority.NORMAL;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
public interface IFluidRegisterListener {
|
||||
|
||||
/**
|
||||
* Called when the fluid registry initializes all fluids. Use CompatFluidRegistry to create new instances of FluidType, which are automatically registered.
|
||||
*/
|
||||
public void onFluidsLoad();
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
|
||||
/**
|
||||
* IFluidReceiverMK2 with standard implementation for transfer and demand getter.
|
||||
* @author hbm
|
||||
*/
|
||||
public interface IFluidStandardReceiverMK2 extends IFluidReceiverMK2 {
|
||||
|
||||
public FluidTank[] getReceivingTanks();
|
||||
|
||||
@Override
|
||||
public default long getDemand(FluidType type, int pressure) {
|
||||
long amount = 0;
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) amount += (tank.getMaxFill() - tank.getFill());
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, int pressure, long amount) {
|
||||
int tanks = 0;
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) tanks++;
|
||||
}
|
||||
if(tanks > 1) {
|
||||
int firstRound = (int) Math.floor((double) amount / (double) tanks);
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
int toAdd = Math.min(firstRound, tank.getMaxFill() - tank.getFill());
|
||||
tank.setFill(tank.getFill() + toAdd);
|
||||
amount -= toAdd;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(amount > 0) for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
int toAdd = (int) Math.min(amount, tank.getMaxFill() - tank.getFill());
|
||||
tank.setFill(tank.getFill() + toAdd);
|
||||
amount -= toAdd;
|
||||
}
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public default int[] getReceivingPressureRange(FluidType type) {
|
||||
int lowest = HIGHEST_VALID_PRESSURE;
|
||||
int highest = 0;
|
||||
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
if(tank.getPressure() < lowest) lowest = tank.getPressure();
|
||||
if(tank.getPressure() > highest) highest = tank.getPressure();
|
||||
}
|
||||
}
|
||||
|
||||
return lowest <= highest ? new int[] {lowest, highest} : DEFAULT_PRESSURE_RANGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public default long getReceiverSpeed(FluidType type, int pressure) {
|
||||
return 1_000_000_000;
|
||||
}
|
||||
}
|
||||
129
src/main/java/api/hbm/fluidmk2/IFluidStandardSenderMK2.java
Normal file
129
src/main/java/api/hbm/fluidmk2/IFluidStandardSenderMK2.java
Normal file
@ -0,0 +1,129 @@
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.uninos.GenNode;
|
||||
import com.hbm.uninos.UniNodespace;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/**
|
||||
* IFluidProviderMK2 with standard implementation for fluid provision and fluid removal.
|
||||
* @author hbm
|
||||
*/
|
||||
public interface IFluidStandardSenderMK2 extends IFluidProviderMK2 {
|
||||
|
||||
public default void tryProvide(FluidTank tank, World world, DirPos pos) { tryProvide(tank.getTankType(), tank.getPressure(), world, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); }
|
||||
public default void tryProvide(FluidType type, World world, DirPos pos) { tryProvide(type, 0, world, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); }
|
||||
public default void tryProvide(FluidType type, int pressure, World world, DirPos pos) { tryProvide(type, pressure, world, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); }
|
||||
|
||||
public default void tryProvide(FluidTank tank, World world, int x, int y, int z, ForgeDirection dir) { tryProvide(tank.getTankType(), tank.getPressure(), world, x, y, z, dir); }
|
||||
public default void tryProvide(FluidType type, World world, int x, int y, int z, ForgeDirection dir) { tryProvide(type, 0, world, x, y, z, dir); }
|
||||
|
||||
public default void tryProvide(FluidType type, int pressure, World world, int x, int y, int z, ForgeDirection dir) {
|
||||
|
||||
TileEntity te = TileAccessCache.getTileOrCache(world, x, y, z);
|
||||
boolean red = false;
|
||||
|
||||
if(te instanceof IFluidConnectorMK2) {
|
||||
IFluidConnectorMK2 con = (IFluidConnectorMK2) te;
|
||||
if(con.canConnect(type, dir.getOpposite())) {
|
||||
|
||||
GenNode<FluidNetMK2> node = UniNodespace.getNode(world, x, y, z, type.getNetworkProvider());
|
||||
|
||||
if(node != null && node.net != null) {
|
||||
node.net.addProvider(this);
|
||||
red = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(te != this && te instanceof IFluidReceiverMK2) {
|
||||
IFluidReceiverMK2 rec = (IFluidReceiverMK2) te;
|
||||
if(rec.canConnect(type, dir.getOpposite())) {
|
||||
long provides = Math.min(this.getFluidAvailable(type, pressure), this.getProviderSpeed(type, pressure));
|
||||
long receives = Math.min(rec.getDemand(type, pressure), rec.getReceiverSpeed(type, pressure));
|
||||
long toTransfer = Math.min(provides, receives);
|
||||
toTransfer -= rec.transferFluid(type, pressure, toTransfer);
|
||||
this.useUpFluid(type, pressure, toTransfer);
|
||||
}
|
||||
}
|
||||
|
||||
if(particleDebug) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "network");
|
||||
data.setString("mode", "fluid");
|
||||
data.setInteger("color", type.getColor());
|
||||
double posX = x + 0.5 - dir.offsetX * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
|
||||
double posY = y + 0.5 - dir.offsetY * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
|
||||
double posZ = z + 0.5 - dir.offsetZ * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
|
||||
data.setDouble("mX", dir.offsetX * (red ? 0.025 : 0.1));
|
||||
data.setDouble("mY", dir.offsetY * (red ? 0.025 : 0.1));
|
||||
data.setDouble("mZ", dir.offsetZ * (red ? 0.025 : 0.1));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.dimensionId, posX, posY, posZ, 25));
|
||||
}
|
||||
}
|
||||
|
||||
public FluidTank[] getSendingTanks();
|
||||
|
||||
@Override
|
||||
public default long getFluidAvailable(FluidType type, int pressure) {
|
||||
long amount = 0;
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) amount += tank.getFill();
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public default void useUpFluid(FluidType type, int pressure, long amount) {
|
||||
int tanks = 0;
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) tanks++;
|
||||
}
|
||||
if(tanks > 1) {
|
||||
int firstRound = (int) Math.floor((double) amount / (double) tanks);
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
int toRem = Math.min(firstRound, tank.getFill());
|
||||
tank.setFill(tank.getFill() - toRem);
|
||||
amount -= toRem;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(amount > 0) for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
int toRem = (int) Math.min(amount, tank.getFill());
|
||||
tank.setFill(tank.getFill() - toRem);
|
||||
amount -= toRem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public default int[] getProvidingPressureRange(FluidType type) {
|
||||
int lowest = HIGHEST_VALID_PRESSURE;
|
||||
int highest = 0;
|
||||
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
if(tank.getPressure() < lowest) lowest = tank.getPressure();
|
||||
if(tank.getPressure() > highest) highest = tank.getPressure();
|
||||
}
|
||||
}
|
||||
|
||||
return lowest <= highest ? new int[] {lowest, highest} : DEFAULT_PRESSURE_RANGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public default long getProviderSpeed(FluidType type, int pressure) {
|
||||
return 1_000_000_000;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
public interface IFluidStandardTransceiverMK2 extends IFluidStandardReceiverMK2, IFluidStandardSenderMK2 {
|
||||
|
||||
}
|
||||
15
src/main/java/api/hbm/fluidmk2/IFluidUserMK2.java
Normal file
15
src/main/java/api/hbm/fluidmk2/IFluidUserMK2.java
Normal file
@ -0,0 +1,15 @@
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
|
||||
import api.hbm.tile.ILoadedTile;
|
||||
|
||||
public interface IFluidUserMK2 extends IFluidConnectorMK2, ILoadedTile {
|
||||
|
||||
public static final int HIGHEST_VALID_PRESSURE = 5;
|
||||
public static final int[] DEFAULT_PRESSURE_RANGE = new int[] {0, 0};
|
||||
|
||||
public static final boolean particleDebug = false;
|
||||
|
||||
public FluidTank[] getAllTanks();
|
||||
}
|
||||
24
src/main/java/api/hbm/fluidmk2/package-info.java
Normal file
24
src/main/java/api/hbm/fluidmk2/package-info.java
Normal file
@ -0,0 +1,24 @@
|
||||
package api.hbm.fluidmk2;
|
||||
|
||||
/*
|
||||
|
||||
It's rather shrimple: the shiny new energy system using universal nodespace, but hit with a hammer until it works with fluids.
|
||||
Has a few extra bits and pieces for handling, but the concept is basically the same.
|
||||
Sounds good?
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
Quick explanation for implementing new fluids via addon:
|
||||
Fluids are subject to /ntmreload so they get wiped and rebuilt using the init function in Fluids, which means that if fluids
|
||||
are simply added externally during startup, they are removed permanently until the game restarts. Same concept as with recipes, really.
|
||||
To fix this we need to make sure that externally registered fluids are re-registered during reload, for that purpose we have
|
||||
IFluidRegisterListener, a simple interface with a small method that runs whenever the fluid list is reloaded. IFluidRegisterListeners
|
||||
need to be registered with CompatExternal.registerFluidRegisterListener to be used, make sure to do this during PreInit.
|
||||
Inside the IFluidRegisterListener, fluids can be added using CompatFluidRegistry.registerFluid, which will generate a Fluid instance
|
||||
using the supplied arguments and automatically register it. Do note that like with custom fluids, fluids need numeric IDs assigned manually.
|
||||
To prevent collisions with stock fluids when NTM updates, make sure to choose a high starting ID (e.g. 10,000).
|
||||
The fluid created by registerFluid can have traits added to them, just like how NTM does it with its stock fluids.
|
||||
|
||||
*/
|
||||
13
src/main/java/api/hbm/recipe/IRecipeRegisterListener.java
Normal file
13
src/main/java/api/hbm/recipe/IRecipeRegisterListener.java
Normal file
@ -0,0 +1,13 @@
|
||||
package api.hbm.recipe;
|
||||
|
||||
public interface IRecipeRegisterListener {
|
||||
|
||||
/**
|
||||
* Called during SerializableRecipe.initialize(), after the defaults are loaded but before the template is written.
|
||||
* Due to the way the recipes are handled, calling it once is not enough, it has to be called once for every SerializableRecipe
|
||||
* instance handled, therefore the load operation passes the type name of the recipe, so that the listeners know what type of recipe
|
||||
* to register at that point. Note that the actual SerializableRecipe instance is irrelevant, since recipes are static anyway,
|
||||
* and direct tampering with SerializableRecipes is not recommended.
|
||||
*/
|
||||
public void onRecipeLoad(String recipeClassName);
|
||||
}
|
||||
17
src/main/java/api/hbm/recipe/package-info.java
Normal file
17
src/main/java/api/hbm/recipe/package-info.java
Normal file
@ -0,0 +1,17 @@
|
||||
package api.hbm.recipe;
|
||||
|
||||
/*
|
||||
|
||||
Quick guide on how to make robust and safe recipe integration:
|
||||
* Implement IRecipeRegisterListener, the resulting class will handle all recipes, and the onRecipeLoad method is called every time the SerializableRecipe system updates
|
||||
* Register your IRecipeRegisterListener using CompatExternal.registerRecipeRegisterListener, this has to happen before the SerializableRecipe initializes, doing this during PreInit should be safe
|
||||
* In your IRecipeRegisterListener, check the supplied recipe type string (which will be the class name of the SerializableRecipe currently being registered) and register your custom recipes accordingly using CompatRecipeRegistry
|
||||
|
||||
Explanation:
|
||||
* Order of operations is important for the recipes to work, if recipes are loaded outside the scope of SerializableRecipe.initialize, they will not work correctly
|
||||
* If recipes are registered before the init, they are deleted, if they are registered after the init, they will not be part of the config template file, and get deleted when running /ntmreload
|
||||
* Machines change all the time, so the recipe classes should not be considered API, since the compat would break immediately if a machine is changed or removed
|
||||
* CompatRecipeRegistry promises to never change its method signatures, and have solid sanity checking when recipes are registered, allowing it to make the bst of whatever data is thrown at it
|
||||
* Using this dedicated registry class means that even if a machine is changed or removed, the recipes will continue to work to the best of its abilities
|
||||
|
||||
*/
|
||||
@ -7,15 +7,17 @@ public interface IRORInteractive extends IRORInfo {
|
||||
|
||||
public static String EX_NULL = "Exception: Null Command";
|
||||
public static String EX_NAME = "Exception: Multiple Name Separators";
|
||||
public static String EX_FORMAT = "Exception: Parameter in Invalid Format";
|
||||
|
||||
/** Runs a function on the ROR component, usually causing the component to change or do something. Returns are optional. */
|
||||
public Object runRORFunction(String name, String[] params);
|
||||
public String runRORFunction(String name, String[] params);
|
||||
|
||||
/** Extracts the command name from a full command string */
|
||||
public static String getCommand(String input) {
|
||||
if(input == null || input.isEmpty()) throw new RORFunctionException(EX_NULL);
|
||||
String[] parts = input.split(NAME_SEPARATOR);
|
||||
if(parts.length <= 0 || parts.length > 2) throw new RORFunctionException(EX_NAME);
|
||||
if(parts[0].isEmpty()) throw new RORFunctionException(EX_NULL);
|
||||
return parts[0];
|
||||
}
|
||||
|
||||
@ -29,4 +31,11 @@ public interface IRORInteractive extends IRORInfo {
|
||||
String[] params = paramList.split(PARAM_SEPARATOR);
|
||||
return params;
|
||||
}
|
||||
|
||||
public static int parseInt(String val, int min, int max) {
|
||||
int result = 0;
|
||||
try { result = Integer.parseInt(val); } catch(Exception x) { throw new RORFunctionException(EX_FORMAT); };
|
||||
if(result < min || result > max) throw new RORFunctionException(EX_FORMAT);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,5 +3,5 @@ package api.hbm.redstoneoverradio;
|
||||
public interface IRORValueProvider extends IRORInfo {
|
||||
|
||||
/** Grabs the specified value from this ROR component, operations should not cause any changes with the component itself */
|
||||
public Object provideRORValue(String name);
|
||||
public String provideRORValue(String name);
|
||||
}
|
||||
|
||||
@ -43,4 +43,7 @@ ROR programmers can indeed do everything that the readers and controllers can, b
|
||||
which are more time-consuming to set up and limits the amount of command channels available, hence why readers and controllers exist
|
||||
when only a simple solution is required
|
||||
|
||||
Addendum: While the RTTY system can support any arbitrary object as a signal, INDEX will strictly use strings, since that simplifies
|
||||
things regarding serialization and saving signals to NBT. Counters already use a parse to int32 function, so this still checks out.
|
||||
|
||||
*/
|
||||
@ -1,6 +1,55 @@
|
||||
package api.hbm.tile;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.hbm.util.Compat;
|
||||
import com.hbm.util.Tuple.Quartet;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/** For anything that should be removed off networks when considered unloaded, only affects providers and receivers, not links. Must not necessarily be a tile. */
|
||||
public interface ILoadedTile {
|
||||
|
||||
public boolean isLoaded();
|
||||
|
||||
// should we gunk this into the API? no, but i don't care
|
||||
public static class TileAccessCache {
|
||||
|
||||
public static Map<Quartet, TileAccessCache> cache = new HashMap();
|
||||
|
||||
public static int NULL_CACHE = 20;
|
||||
public static int NONNULL_CACHE = 60;
|
||||
|
||||
public TileEntity tile;
|
||||
public long expiresOn;
|
||||
|
||||
public TileAccessCache(TileEntity tile, long expiresOn) {
|
||||
this.tile = tile;
|
||||
this.expiresOn = expiresOn;
|
||||
}
|
||||
|
||||
public boolean hasExpired(long worldTime) {
|
||||
if(tile != null && tile.isInvalid()) return true;
|
||||
if(worldTime >= expiresOn) return true;
|
||||
if(tile instanceof ILoadedTile && !((ILoadedTile) tile).isLoaded()) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Quartet publicCumRag = new Quartet(0, 0, 0, 0);
|
||||
public static TileEntity getTileOrCache(World world, int x, int y, int z) {
|
||||
publicCumRag.mangle(x, y, z, world.provider.dimensionId);
|
||||
TileAccessCache cache = TileAccessCache.cache.get(publicCumRag);
|
||||
|
||||
if(cache == null || cache.hasExpired(world.getTotalWorldTime())) {
|
||||
TileEntity tile = Compat.getTileStandard(world, x, y, z);
|
||||
cache = new TileAccessCache(tile, world.getTotalWorldTime() + (tile == null ? NULL_CACHE : NONNULL_CACHE));
|
||||
TileAccessCache.cache.put(publicCumRag.clone(), cache);
|
||||
return tile;
|
||||
} else {
|
||||
return cache.tile;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,12 +5,15 @@ import com.hbm.handler.ThreeInts;
|
||||
import com.hbm.interfaces.ICopiable;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.world.gen.nbt.INBTBlockTransformable;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@ -23,6 +26,8 @@ import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
||||
@ -32,7 +37,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public abstract class BlockDummyable extends BlockContainer implements ICustomBlockHighlight, ICopiable {
|
||||
public abstract class BlockDummyable extends BlockContainer implements ICustomBlockHighlight, ICopiable, INBTBlockTransformable {
|
||||
|
||||
public BlockDummyable(Material mat) {
|
||||
super(mat);
|
||||
@ -72,27 +77,20 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
|
||||
super.onNeighborBlockChange(world, x, y, z, block);
|
||||
|
||||
if(world.isRemote || safeRem)
|
||||
if(safeRem)
|
||||
return;
|
||||
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
|
||||
// if it's an extra, remove the extra-ness
|
||||
if(metadata >= extra)
|
||||
metadata -= extra;
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(metadata).getOpposite();
|
||||
Block b = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
|
||||
|
||||
if(b != this) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
destroyIfOrphan(world, x, y, z);
|
||||
}
|
||||
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
super.updateTick(world, x, y, z, rand);
|
||||
|
||||
destroyIfOrphan(world, x, y, z);
|
||||
}
|
||||
|
||||
private void destroyIfOrphan(World world, int x, int y, int z) {
|
||||
if(world.isRemote)
|
||||
return;
|
||||
|
||||
@ -105,10 +103,32 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(metadata).getOpposite();
|
||||
Block b = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
|
||||
|
||||
if(b != this) {
|
||||
// An extra precaution against multiblocks on chunk borders being erroneously deleted.
|
||||
// Technically, this might be used to persist ghost dummy blocks by manipulating
|
||||
// loaded chunks and block destruction, but this gives no benefit to the player,
|
||||
// cannot be done accidentally, and is definitely preferable to multiblocks
|
||||
// just vanishing when their chunks are unloaded in an unlucky way.
|
||||
if(b != this && world.checkChunksExist(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1)) {
|
||||
if (isLegacyMonoblock(world, x, y, z)) {
|
||||
fixLegacyMonoblock(world, x, y, z);
|
||||
} else {
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Override this when turning a single block into a pseudo-multiblock.
|
||||
// If this returns true, instead of being deleted as an orphan, the block
|
||||
// will be promoted to a core of a dummyable, however without any dummies.
|
||||
// This is only called if the block is presumed an orphan, so you don't
|
||||
// need to check that here.
|
||||
protected boolean isLegacyMonoblock(World world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void fixLegacyMonoblock(World world, int x, int y, int z) {
|
||||
// Promote to a lone core block with the same effective rotation as before the change
|
||||
world.setBlockMetadataWithNotify(x, y, z, offset + world.getBlockMetadata(x, y, z), 3);
|
||||
}
|
||||
|
||||
public int[] findCore(World world, int x, int y, int z) {
|
||||
@ -116,7 +136,7 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
return findCoreRec(world, x, y, z);
|
||||
}
|
||||
|
||||
List<ThreeInts> positions = new ArrayList();
|
||||
List<ThreeInts> positions = new ArrayList<>();
|
||||
|
||||
public int[] findCoreRec(World world, int x, int y, int z) {
|
||||
|
||||
@ -216,11 +236,6 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
super.onBlockPlacedBy(world, x, y, z, player, itemStack);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
lastBlockSet = new BlockPos(x, y, z);
|
||||
}*/
|
||||
|
||||
/**
|
||||
* A bit more advanced than the dir modifier, but it is important that the resulting direction meta is in the core range.
|
||||
* Using the "extra" metas is technically possible but requires a bit of tinkering, e.g. preventing a recursive loop
|
||||
@ -267,9 +282,9 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
return;
|
||||
|
||||
// world.setBlockMetadataWithNotify(x, y, z, meta + extra, 3);
|
||||
this.safeRem = true;
|
||||
safeRem = true;
|
||||
world.setBlock(x, y, z, this, meta + extra, 3);
|
||||
this.safeRem = false;
|
||||
safeRem = false;
|
||||
}
|
||||
|
||||
public void removeExtra(World world, int x, int y, int z) {
|
||||
@ -283,9 +298,9 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
return;
|
||||
|
||||
// world.setBlockMetadataWithNotify(x, y, z, meta + extra, 3);
|
||||
this.safeRem = true;
|
||||
safeRem = true;
|
||||
world.setBlock(x, y, z, this, meta - extra, 3);
|
||||
this.safeRem = false;
|
||||
safeRem = false;
|
||||
}
|
||||
|
||||
// checks if the dummy metadata is within the extra range
|
||||
@ -423,8 +438,9 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
return !bounding.isEmpty();
|
||||
}
|
||||
|
||||
public List<AxisAlignedBB> bounding = new ArrayList();
|
||||
public List<AxisAlignedBB> bounding = new ArrayList<>();
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB entityBounding, List list, Entity entity) {
|
||||
|
||||
@ -442,8 +458,10 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
y = pos[1];
|
||||
z = pos[2];
|
||||
|
||||
for(AxisAlignedBB aabb :this.bounding) {
|
||||
AxisAlignedBB boxlet = getAABBRotationOffset(aabb, x + 0.5, y, z + 0.5, ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z) - this.offset).getRotation(ForgeDirection.UP));
|
||||
ForgeDirection rot = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z) - offset).getRotation(ForgeDirection.UP);
|
||||
|
||||
for(AxisAlignedBB aabb : this.bounding) {
|
||||
AxisAlignedBB boxlet = getAABBRotationOffset(aabb, x + 0.5, y, z + 0.5, rot);
|
||||
|
||||
if(entityBounding.intersectsWith(boxlet)) {
|
||||
list.add(boxlet);
|
||||
@ -468,6 +486,32 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
return AxisAlignedBB.getBoundingBox(aabb.minX, aabb.minY, aabb.minZ, aabb.maxX, aabb.maxY, aabb.maxZ).offset(x + 0.5, y + 0.5, z + 0.5);
|
||||
}
|
||||
|
||||
// Don't mutate the xyz parameters, or the interaction max distance will bite you
|
||||
@Override
|
||||
public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 startVec, Vec3 endVec) {
|
||||
if(!this.useDetailedHitbox()) {
|
||||
return super.collisionRayTrace(world, x, y, z, startVec, endVec);
|
||||
}
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return super.collisionRayTrace(world, x, y, z, startVec, endVec);
|
||||
|
||||
ForgeDirection rot = ForgeDirection.getOrientation(world.getBlockMetadata(pos[0], pos[1], pos[2]) - offset).getRotation(ForgeDirection.UP);
|
||||
|
||||
for(AxisAlignedBB aabb : this.bounding) {
|
||||
AxisAlignedBB boxlet = getAABBRotationOffset(aabb, pos[0] + 0.5, pos[1], pos[2] + 0.5, rot);
|
||||
|
||||
MovingObjectPosition intercept = boxlet.calculateIntercept(startVec, endVec);
|
||||
if(intercept != null) {
|
||||
return new MovingObjectPosition(x, y, z, intercept.sideHit, intercept.hitVec);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
if(!this.useDetailedHitbox()) {
|
||||
@ -501,10 +545,10 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
double dZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)interp;
|
||||
float exp = 0.002F;
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
ForgeDirection rot = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z) - offset).getRotation(ForgeDirection.UP);
|
||||
|
||||
ICustomBlockHighlight.setup();
|
||||
for(AxisAlignedBB aabb : this.bounding) event.context.drawOutlinedBoundingBox(getAABBRotationOffset(aabb.expand(exp, exp, exp), 0, 0, 0, ForgeDirection.getOrientation(meta - offset).getRotation(ForgeDirection.UP)).getOffsetBoundingBox(x - dX + 0.5, y - dY, z - dZ + 0.5), -1);
|
||||
for(AxisAlignedBB aabb : this.bounding) RenderGlobal.drawOutlinedBoundingBox(getAABBRotationOffset(aabb.expand(exp, exp, exp), 0, 0, 0, rot).getOffsetBoundingBox(x - dX + 0.5, y - dY, z - dZ + 0.5), -1);
|
||||
ICustomBlockHighlight.cleanup();
|
||||
}
|
||||
|
||||
@ -521,6 +565,7 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
@Override
|
||||
public void pasteSettings(NBTTagCompound nbt, int index, World world, EntityPlayer player, int x, int y, int z) {
|
||||
int[] pos = findCore(world, x, y, z);
|
||||
if(pos == null) return;
|
||||
TileEntity tile = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if (tile instanceof ICopiable)
|
||||
((ICopiable) tile).pasteSettings(nbt, index, world, player, pos[0], pos[1], pos[2]);
|
||||
@ -534,4 +579,27 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
return ((ICopiable) tile).infoForDisplay(world, x, y, z);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
boolean isOffset = meta >= 12; // squishing causes issues
|
||||
boolean isExtra = !isOffset && meta >= extra;
|
||||
|
||||
if(isOffset) {
|
||||
meta -= offset;
|
||||
} else if(isExtra) {
|
||||
meta -= extra;
|
||||
}
|
||||
|
||||
meta = INBTBlockTransformable.transformMetaDeco(meta, coordBaseMode);
|
||||
|
||||
if(isOffset) {
|
||||
meta += offset;
|
||||
} else if(isExtra) {
|
||||
meta += extra;
|
||||
}
|
||||
|
||||
return meta;
|
||||
}
|
||||
|
||||
}
|
||||
@ -58,6 +58,14 @@ public class BlockEnums {
|
||||
SMALL
|
||||
}
|
||||
|
||||
public static enum LightstoneType {
|
||||
UNREFINED,
|
||||
TILE,
|
||||
BRICKS,
|
||||
BRICKS_CHISELED,
|
||||
CHISELED
|
||||
}
|
||||
|
||||
public static enum DecoComputerEnum {
|
||||
IBM_300PL
|
||||
}
|
||||
@ -72,4 +80,5 @@ public class BlockEnums {
|
||||
FLUORESCENT,
|
||||
HALOGEN
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -11,4 +11,27 @@ public interface IBlockSideRotation {
|
||||
public static int getRenderType() {
|
||||
return renderID;
|
||||
}
|
||||
|
||||
// 0 1 3 2 becomes 0 2 3 1
|
||||
// I want to smoke that swedish kush because it clearly makes you fucking stupid
|
||||
public static int topToBottom(int topRotation) {
|
||||
switch(topRotation) {
|
||||
case 1: return 2;
|
||||
case 2: return 1;
|
||||
default: return topRotation;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isOpposite(int from, int to) {
|
||||
switch(from) {
|
||||
case 0: return to == 1;
|
||||
case 1: return to == 0;
|
||||
case 2: return to == 3;
|
||||
case 3: return to == 2;
|
||||
case 4: return to == 5;
|
||||
case 5: return to == 4;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import com.hbm.util.I18nUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
@ -8,6 +7,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ITooltipProvider {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,91 +1,77 @@
|
||||
package com.hbm.blocks.bomb;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.entity.logic.EntityBalefire;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.EntityProcessorCross;
|
||||
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
|
||||
import com.hbm.handler.threading.PacketThreading;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.particle.helper.ExplosionCreator;
|
||||
import com.hbm.tileentity.bomb.TileEntityCrashedBomb;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCrashedBomb extends BlockContainer implements IBomb {
|
||||
public class BlockCrashedBomb extends BlockEnumMulti implements ITileEntityProvider, IBomb {
|
||||
|
||||
public BlockCrashedBomb(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
public static enum EnumDudType {
|
||||
BALEFIRE, CONVENTIONAL, NUKE, SALTED
|
||||
}
|
||||
|
||||
public BlockCrashedBomb(Material mat) {
|
||||
super(mat, EnumDudType.class, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityCrashedBomb();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return Item.getItemFromBlock(ModBlocks.crashed_balefire);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if(i == 0) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
}
|
||||
if(i == 1) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
}
|
||||
if(i == 2) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
}
|
||||
if(i == 3) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
}
|
||||
}
|
||||
@Override public int getRenderType() { return -1; }
|
||||
@Override public boolean isOpaqueCube() { return false; }
|
||||
@Override public boolean renderAsNormalBlock() { return false; }
|
||||
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float fx, float fy, float fz) {
|
||||
|
||||
if(world.isRemote)
|
||||
return true;
|
||||
if(world.isRemote) return true;
|
||||
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.defuser) {
|
||||
|
||||
world.func_147480_a(x, y, z, false);
|
||||
EnumDudType type = EnumUtil.grabEnumSafely(EnumDudType.class, world.getBlockMetadata(x, y, z));
|
||||
|
||||
//TODO: make this less scummy
|
||||
if(type == type.BALEFIRE) {
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.egg_balefire_shard)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.plate_steel, 10 + world.rand.nextInt(15))));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.plate_titanium, 2 + world.rand.nextInt(7))));
|
||||
}
|
||||
if(type == type.CONVENTIONAL) {
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.ball_tnt, 16)));
|
||||
}
|
||||
if(type == type.NUKE) {
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.ball_tnt, 8)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.billet_plutonium, 4)));
|
||||
}
|
||||
if(type == type.SALTED) {
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.ball_tnt, 8)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.billet_plutonium, 2)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.ingot_cobalt, 12)));
|
||||
}
|
||||
|
||||
world.func_147480_a(x, y, z, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -97,21 +83,46 @@ public class BlockCrashedBomb extends BlockContainer implements IBomb {
|
||||
|
||||
if(!world.isRemote) {
|
||||
|
||||
EnumDudType type = EnumUtil.grabEnumSafely(EnumDudType.class, world.getBlockMetadata(x, y, z));
|
||||
world.setBlockToAir(x, y, z);
|
||||
|
||||
if(type == type.BALEFIRE) {
|
||||
EntityBalefire bf = new EntityBalefire(world);
|
||||
bf.posX = x;
|
||||
bf.posY = y;
|
||||
bf.posZ = z;
|
||||
bf.setPosition(x, y, z);
|
||||
bf.destructionRange = (int) (BombConfig.fatmanRadius * 1.25);
|
||||
world.spawnEntityInWorld(bf);
|
||||
spawnMush(world, x, y, z, true);
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "muke");
|
||||
data.setBoolean("balefire", true);
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x + 0.5, y + 0.5, z + 0.5), new TargetPoint(world.provider.dimensionId, x + 0.5, y + 0.5, z + 0.5, 250));
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:weapon.mukeExplosion", 15.0F, 1.0F);
|
||||
if(type == type.CONVENTIONAL) {
|
||||
ExplosionVNT xnt = new ExplosionVNT(world, x + 0.5, y + 0.5, z + 0.5, 35F);
|
||||
xnt.setBlockAllocator(new BlockAllocatorStandard(24));
|
||||
xnt.setBlockProcessor(new BlockProcessorStandard().setNoDrop());
|
||||
xnt.setEntityProcessor(new EntityProcessorCross(5D).withRangeMod(1.5F));
|
||||
xnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
xnt.explode();
|
||||
ExplosionCreator.composeEffectLarge(world, x + 0.5, y + 0.5, z + 0.5);
|
||||
}
|
||||
|
||||
if(type == type.NUKE) {
|
||||
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, 35, x + 0.5, y + 0.5, z + 0.5));
|
||||
spawnMush(world, x, y, z, MainRegistry.polaroidID == 11 || world.rand.nextInt(100) == 0);
|
||||
}
|
||||
|
||||
if(type == type.SALTED) {
|
||||
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, 25, x + 0.5, y + 0.5, z + 0.5).moreFallout(25));
|
||||
spawnMush(world, x, y, z, MainRegistry.polaroidID == 11 || world.rand.nextInt(100) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
return BombReturnCode.DETONATED;
|
||||
}
|
||||
|
||||
public static void spawnMush(World world, int x, int y, int z, boolean balefire) {
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:weapon.mukeExplosion", 15.0F, 1.0F);
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "muke");
|
||||
data.setBoolean("balefire", balefire);
|
||||
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(data, x + 0.5, y + 0.5, z + 0.5), new TargetPoint(world.provider.dimensionId, x + 0.5, y + 0.5, z + 0.5, 250));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.blocks.bomb;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.item.EntityTNTPrimedBase;
|
||||
import com.hbm.explosion.ExplosionNukeSmall;
|
||||
import com.hbm.world.biome.BiomeGenCraterBase;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
@ -16,6 +17,8 @@ public class BlockFissureBomb extends BlockTNTBase {
|
||||
|
||||
int range = 5;
|
||||
|
||||
boolean crater = world.getBiomeGenForCoords((int) Math.floor(x), (int) Math.floor(z)) instanceof BiomeGenCraterBase;
|
||||
|
||||
for(int i = -range; i <= range; i++) {
|
||||
for(int j = -range; j <= range; j++) {
|
||||
for(int k = -range; k <= range; k++) {
|
||||
@ -27,7 +30,7 @@ public class BlockFissureBomb extends BlockTNTBase {
|
||||
Block block = world.getBlock(a, b, c);
|
||||
|
||||
if(block == ModBlocks.ore_bedrock) {
|
||||
world.setBlock(a, b, c, ModBlocks.ore_volcano);
|
||||
world.setBlock(a, b, c, ModBlocks.ore_volcano, crater ? 1 : 0, 3);
|
||||
} else if(block == ModBlocks.ore_bedrock_oil) {
|
||||
world.setBlock(a, b, c, Blocks.bedrock);
|
||||
}
|
||||
|
||||
@ -4,169 +4,72 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.entity.mob.EntityTaintCrab;
|
||||
import com.hbm.entity.mob.EntityCreeperTainted;
|
||||
import com.hbm.entity.mob.EntityTeslaCrab;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityFallingBlock;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockTaint extends Block/*Container*/ {
|
||||
public class BlockTaint extends Block implements ITooltipProvider {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public BlockTaint(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
public BlockTaint(Material mat) {
|
||||
super(mat);
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityTaint();
|
||||
}*/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int meta)
|
||||
{
|
||||
return this.icons[meta % this.icons.length];
|
||||
}
|
||||
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int func_150032_b(int p_150032_0_)
|
||||
{
|
||||
return func_150031_c(p_150032_0_);
|
||||
}
|
||||
|
||||
public static int func_150031_c(int p_150031_0_)
|
||||
{
|
||||
return p_150031_0_ & 15;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_)
|
||||
{
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
p_149666_3_.add(new ItemStack(p_149666_1_, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister p_149651_1_)
|
||||
{
|
||||
this.icons = new IIcon[16];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i)
|
||||
{
|
||||
this.icons[i] = p_149651_1_.registerIcon("hbm:taint_" + i);
|
||||
}
|
||||
}
|
||||
|
||||
public MapColor getMapColor(int p_149728_1_)
|
||||
{
|
||||
return MapColor.purpleColor;
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
@Override public MapColor getMapColor(int meta) { return MapColor.grayColor; }
|
||||
@Override public Item getItemDropped(int i, Random rand, int j) { return null; }
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return renderID;
|
||||
}
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block b)
|
||||
{
|
||||
if(!hasPosNeightbour(world, x, y, z) && !world.isRemote)
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
public void updateTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if(!world.isRemote && meta < 15) {
|
||||
if(meta >= 15) return;
|
||||
|
||||
for(int i = 0; i < 15; i++) {
|
||||
int a = rand.nextInt(11) + x - 5;
|
||||
int b = rand.nextInt(11) + y - 5;
|
||||
int c = rand.nextInt(11) + z - 5;
|
||||
if(world.getBlock(a, b, c).isReplaceable(world, a, b, c) && hasPosNeightbour(world, a, b, c))
|
||||
world.setBlock(a, b, c, ModBlocks.taint, meta + 1, 2);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 85; i++) {
|
||||
int a = rand.nextInt(7) + x - 3;
|
||||
int b = rand.nextInt(7) + y - 3;
|
||||
int c = rand.nextInt(7) + z - 3;
|
||||
if(world.getBlock(a, b, c).isReplaceable(world, a, b, c) && hasPosNeightbour(world, a, b, c))
|
||||
world.setBlock(a, b, c, ModBlocks.taint, meta + 1, 2);
|
||||
for(int i = -3; i <= 3; i++) for(int j = -3; j <= 3; j++) for(int k = -3; k <= 3; k++) {
|
||||
if(Math.abs(i) + Math.abs(j) + Math.abs(k) > 4) continue;
|
||||
if(rand.nextFloat() > 0.25F) continue;
|
||||
Block b = world.getBlock(x + i, y + j, z + k);
|
||||
if(b.isAir(world, x + i, y + j, z + k) || b == Blocks.bedrock) continue;
|
||||
int targetMeta = meta + 1;
|
||||
boolean hasAir = false;
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if(world.getBlock(x + i + dir.offsetX, y + j + dir.offsetY, z + k + dir.offsetZ).isAir(world, x + i + dir.offsetX, y + j + dir.offsetY, z + k + dir.offsetZ)) {
|
||||
hasAir = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!hasAir) targetMeta = meta + 3;
|
||||
if(targetMeta > 15) continue;
|
||||
if(b == this && world.getBlockMetadata(x + i, y + j, z + k) >= targetMeta) continue;
|
||||
world.setBlock(x + i, y + j, z + k, this, targetMeta, 3);
|
||||
if(rand.nextFloat() < 0.25F && BlockFalling.func_149831_e(world, x + i, y + j - 1, z + k)) {
|
||||
EntityFallingBlock falling = new EntityFallingBlock(world, x + i + 0.5, y + j + 0.5, z + k + 0.5, this, targetMeta);
|
||||
world.spawnEntityInWorld(falling);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasPosNeightbour(World world, int x, int y, int z) {
|
||||
Block b0 = world.getBlock(x + 1, y, z);
|
||||
Block b1 = world.getBlock(x, y + 1, z);
|
||||
Block b2 = world.getBlock(x, y, z + 1);
|
||||
Block b3 = world.getBlock(x - 1, y, z);
|
||||
Block b4 = world.getBlock(x, y - 1, z);
|
||||
Block b5 = world.getBlock(x, y, z - 1);
|
||||
boolean b = (b0.renderAsNormalBlock() && b0.getMaterial().isOpaque()) ||
|
||||
(b1.renderAsNormalBlock() && b1.getMaterial().isOpaque()) ||
|
||||
(b2.renderAsNormalBlock() && b2.getMaterial().isOpaque()) ||
|
||||
(b3.renderAsNormalBlock() && b3.getMaterial().isOpaque()) ||
|
||||
(b4.renderAsNormalBlock() && b4.getMaterial().isOpaque()) ||
|
||||
(b5.renderAsNormalBlock() && b5.getMaterial().isOpaque());
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return AxisAlignedBB.getBoundingBox(par2, par3, par4, par2, par3, par4);
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 0.75, z + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -175,13 +78,16 @@ public class BlockTaint extends Block/*Container*/ {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
int level = 15 - meta;
|
||||
|
||||
entity.motionX *= 0.6;
|
||||
entity.motionZ *= 0.6;
|
||||
|
||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||
PotionEffect effect = new PotionEffect(HbmPotion.taint.id, 15 * 20, level);
|
||||
effect.setCurativeItems(list);
|
||||
|
||||
if(entity instanceof EntityLivingBase) {
|
||||
if(world.rand.nextInt(50) == 0) {
|
||||
((EntityLivingBase)entity).addPotionEffect(effect);
|
||||
((EntityLivingBase) entity).addPotionEffect(effect);
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,4 +112,8 @@ public class BlockTaint extends Block/*Container*/ {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
list.add("DO NOT TOUCH, BREATHE OR STARE AT.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.projectile.EntityShrapnel;
|
||||
import com.hbm.explosion.ExplosionNT;
|
||||
import com.hbm.explosion.ExplosionNT.ExAttrib;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.handler.threading.PacketThreading;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -151,7 +151,7 @@ public class BlockVolcano extends BlockContainer implements ITooltipProvider, IB
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("tier", this.volcanoTimer);
|
||||
nbt.setInteger("timer", this.volcanoTimer);
|
||||
}
|
||||
|
||||
private boolean shouldGrow() {
|
||||
@ -283,7 +283,7 @@ public class BlockVolcano extends BlockContainer implements ITooltipProvider, IB
|
||||
NBTTagCompound dPart = new NBTTagCompound();
|
||||
dPart.setString("type", "vanillaExt");
|
||||
dPart.setString("mode", "volcano");
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(dPart, xCoord + 0.5, yCoord + 10, zCoord + 0.5), new TargetPoint(worldObj.provider.dimensionId, xCoord + 0.5, yCoord + 10, zCoord + 0.5, 250));
|
||||
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(dPart, xCoord + 0.5, yCoord + 10, zCoord + 0.5), new TargetPoint(worldObj.provider.dimensionId, xCoord + 0.5, yCoord + 10, zCoord + 0.5, 250));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
package com.hbm.blocks.bomb;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.EntityProcessorCrossSmooth;
|
||||
import com.hbm.explosion.vanillant.standard.ExplosionEffectTiny;
|
||||
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.particle.helper.ExplosionCreator;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -17,9 +23,7 @@ public class BombFlameWar extends Block implements IBomb {
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
|
||||
if(world.isBlockIndirectlyGettingPowered(x, y, z)) {
|
||||
ExplosionChaos.explode(world, x, y, z, 15);
|
||||
ExplosionChaos.spawnExplosion(world, x, y, z, 75);
|
||||
ExplosionChaos.flameDeath(world, x, y, z, 100);
|
||||
explode(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,9 +31,24 @@ public class BombFlameWar extends Block implements IBomb {
|
||||
public BombReturnCode explode(World world, int x, int y, int z) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
ExplosionChaos.explode(world, x, y, z, 15);
|
||||
ExplosionChaos.spawnExplosion(world, x, y, z, 75);
|
||||
ExplosionChaos.flameDeath(world, x, y, z, 100);
|
||||
|
||||
world.func_147480_a(x, y, z, false);
|
||||
|
||||
for(int i = 0; i < 150; i++) {
|
||||
ExplosionVNT vnt = new ExplosionVNT(world, x + world.rand.nextInt(51) - 25, y + world.rand.nextInt(11) - 5, z + world.rand.nextInt(51) - 25, 4, null);
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, 25));
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.setSFX(new ExplosionEffectTiny());
|
||||
vnt.explode();
|
||||
}
|
||||
|
||||
ExplosionVNT xnt = new ExplosionVNT(world, x + 0.5, y + 0.5, z + 0.5, 15F);
|
||||
xnt.setBlockAllocator(new BlockAllocatorStandard(32));
|
||||
xnt.setBlockProcessor(new BlockProcessorStandard().setNoDrop());
|
||||
xnt.setEntityProcessor(new EntityProcessorCrossSmooth(2, 200));
|
||||
xnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
xnt.explode();
|
||||
ExplosionCreator.composeEffectSmall(world, x + 0.5, y + 0.5, z + 0.5);
|
||||
}
|
||||
|
||||
return BombReturnCode.DETONATED;
|
||||
|
||||
@ -18,10 +18,12 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.effect.EntityMist;
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.bomb.TileEntityBombMulti;
|
||||
|
||||
@ -169,7 +171,11 @@ public class BombMulti extends BlockContainer implements IBomb {
|
||||
}
|
||||
|
||||
if(gasCloud > 0) {
|
||||
ExplosionChaos.spawnChlorine(world, x, y, z, gasCloud, gasCloud / 50, 0);
|
||||
EntityMist mist = new EntityMist(world);
|
||||
mist.setType(Fluids.CHLORINE);
|
||||
mist.setPosition(x + 0.5, y + 0.5, z + 0.5);
|
||||
mist.setArea(gasCloud * 15F / 50F, gasCloud * 7.5F / 50F);
|
||||
world.spawnEntityInWorld(mist);
|
||||
}
|
||||
|
||||
return BombReturnCode.DETONATED;
|
||||
|
||||
@ -69,7 +69,7 @@ public class ExplosiveCharge extends BlockDetonatable implements IBomb, IDetConn
|
||||
}
|
||||
if(this == ModBlocks.det_nuke) {
|
||||
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.missileRadius, x + 0.5, y + 0.5, z + 0.5));
|
||||
EntityNukeTorex.statFac(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.missileRadius);
|
||||
EntityNukeTorex.statFacStandard(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.missileRadius);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,26 +3,29 @@ package com.hbm.blocks.bomb;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.ServerConfig;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.explosion.ExplosionNukeSmall;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.EntityProcessorCrossSmooth;
|
||||
import com.hbm.explosion.vanillant.standard.ExplosionEffectWeapon;
|
||||
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.*;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.factory.XFactoryCatapult;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.tileentity.bomb.TileEntityLandmine;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
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.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@ -61,8 +64,7 @@ public class Landmine extends BlockContainer implements IBomb {
|
||||
if(this == ModBlocks.mine_ap) this.setBlockBounds(5 * f, 0.0F, 5 * f, 11 * f, 1 * f, 11 * f);
|
||||
if(this == ModBlocks.mine_he) this.setBlockBounds(4 * f, 0.0F, 4 * f, 12 * f, 2 * f, 12 * f);
|
||||
if(this == ModBlocks.mine_shrap) this.setBlockBounds(5 * f, 0.0F, 5 * f, 11 * f, 1 * f, 11 * f);
|
||||
if(this == ModBlocks.mine_fat) this.setBlockBounds(5 * f, 0.0F, 4 * f, 11 * f, 6 * f, 12 * f);
|
||||
}
|
||||
if(this == ModBlocks.mine_fat) this.setBlockBounds(5 * f, 0.0F, 4 * f, 11 * f, 6 * f, 12 * f);}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
@ -127,6 +129,18 @@ public class Landmine extends BlockContainer implements IBomb {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isWaterAbove(World world, int x, int y, int z) {
|
||||
for(int xo = -1; xo <= 1; xo++) {
|
||||
for(int zo = -1; zo <= 1; zo++) {
|
||||
Block blockAbove = world.getBlock(x + xo, y + 1, z + zo);
|
||||
if(blockAbove == Blocks.water || blockAbove == Blocks.flowing_water) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BombReturnCode explode(World world, int x, int y, int z) {
|
||||
|
||||
@ -138,7 +152,7 @@ public class Landmine extends BlockContainer implements IBomb {
|
||||
|
||||
if(this == ModBlocks.mine_ap) {
|
||||
ExplosionVNT vnt = new ExplosionVNT(world, x + 0.5, y + 0.5, z + 0.5, 3F);
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(0.5, 10F).setupPiercing(5F, 0.2F));
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(0.5, ServerConfig.MINE_AP_DAMAGE.get()).setupPiercing(5F, 0.2F));
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.setSFX(new ExplosionEffectWeapon(5, 1F, 0.5F));
|
||||
vnt.explode();
|
||||
@ -146,21 +160,52 @@ public class Landmine extends BlockContainer implements IBomb {
|
||||
ExplosionVNT vnt = new ExplosionVNT(world, x + 0.5, y + 0.5, z + 0.5, 4F);
|
||||
vnt.setBlockAllocator(new BlockAllocatorStandard());
|
||||
vnt.setBlockProcessor(new BlockProcessorStandard());
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, 35).setupPiercing(15F, 0.2F));
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, ServerConfig.MINE_HE_DAMAGE.get()).setupPiercing(15F, 0.2F));
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.setSFX(new ExplosionEffectWeapon(15, 3.5F, 1.25F));
|
||||
vnt.explode();
|
||||
} else if(this == ModBlocks.mine_shrap) {
|
||||
ExplosionVNT vnt = new ExplosionVNT(world, x + 0.5, y + 0.5, z + 0.5, 3F);
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(0.5, 7.5F));
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(0.5, ServerConfig.MINE_SHRAP_DAMAGE.get()));
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.setSFX(new ExplosionEffectWeapon(5, 1F, 0.5F));
|
||||
vnt.explode();
|
||||
|
||||
ExplosionLarge.spawnShrapnelShower(world, x + 0.5, y + 0.5, z + 0.5, 0, 1D, 0, 45, 0.2D);
|
||||
ExplosionLarge.spawnShrapnels(world, x + 0.5, y + 0.5, z + 0.5, 5);
|
||||
} else if(this == ModBlocks.mine_naval) {
|
||||
ExplosionVNT vnt = new ExplosionVNT(world, x + 5, y + 5, z + 5, 25F);
|
||||
vnt.setBlockAllocator(new BlockAllocatorWater(32));
|
||||
vnt.setBlockProcessor(new BlockProcessorStandard());
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(0.5, ServerConfig.MINE_NAVAL_DAMAGE.get()).setupPiercing(5F, 0.2F));
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.setSFX(new ExplosionEffectWeapon(10, 1F, 0.5F));
|
||||
vnt.explode();
|
||||
|
||||
ExplosionLarge.spawnParticlesRadial(world, x + 0.5, y + 2, z + 0.5, 30);
|
||||
ExplosionLarge.spawnRubble(world,x + 0.5, y + 0.5, z + 0.5, 5 );
|
||||
|
||||
// Only spawn water effects if there's water above the mine
|
||||
if (isWaterAbove(world, x, y, z)) {
|
||||
ExplosionLarge.spawnFoam(world, x + 0.5, y + 0.5, z + 0.5, 60);
|
||||
}
|
||||
|
||||
} else if(this == ModBlocks.mine_fat) {
|
||||
ExplosionNukeSmall.explode(world, x + 0.5, y + 0.5, z + 0.5, ExplosionNukeSmall.PARAMS_MEDIUM);
|
||||
|
||||
ExplosionVNT vnt = new ExplosionVNT(world, x + 0.5, y + 0.5, z + 0.5, 10);
|
||||
vnt.setBlockAllocator(new BlockAllocatorStandard(64));
|
||||
vnt.setBlockProcessor(new BlockProcessorStandard());
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(2, ServerConfig.MINE_NUKE_DAMAGE.get()).withRangeMod(1.5F));
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.explode();
|
||||
|
||||
XFactoryCatapult.incrementRad(world, x, y, z, 1.5F);
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "muke");
|
||||
data.setBoolean("balefire", MainRegistry.polaroidID == 11 || world.rand.nextInt(100) == 0);
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x + 0.5, y + 0.5, z + 0.5), new TargetPoint(world.provider.dimensionId, x + 0.5, y + 0.5, z + 0.5, 250));
|
||||
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:weapon.mukeExplosion", 25.0F, 0.9F); // this has to be the single worst solution ever
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,16 +3,17 @@ package com.hbm.blocks.bomb;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.entity.effect.EntityCloudFleija;
|
||||
import com.hbm.entity.effect.EntityCloudFleijaRainbow;
|
||||
import com.hbm.entity.effect.EntityNukeTorex;
|
||||
import com.hbm.entity.grenade.EntityGrenadeZOMG;
|
||||
import com.hbm.entity.logic.EntityBalefire;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK3;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
||||
import com.hbm.entity.projectile.EntityFallingNuke;
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.interfaces.NotableComments;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeCustom;
|
||||
|
||||
@ -30,10 +31,10 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
// this entire class sucks ass
|
||||
@NotableComments
|
||||
public class NukeCustom extends BlockContainer implements IBomb {
|
||||
|
||||
public TileEntityNukeCustom tetn = new TileEntityNukeCustom();
|
||||
|
||||
private static boolean keepInventory = false;
|
||||
private final static Random field_149933_a = new Random();
|
||||
|
||||
@ -134,6 +135,7 @@ public class NukeCustom extends BlockContainer implements IBomb {
|
||||
public static final int maxAmat = 350;
|
||||
public static final int maxSchrab = 250;
|
||||
|
||||
// genuinely some of the worst fucking code i've ever written
|
||||
public static void explodeCustom(World worldObj, double xCoord, double yCoord, double zCoord, float tnt, float nuke, float hydro, float amat, float dirty, float schrab, float euph) {
|
||||
|
||||
dirty = Math.min(dirty, 100);
|
||||
@ -141,8 +143,23 @@ public class NukeCustom extends BlockContainer implements IBomb {
|
||||
/// EUPHEMIUM ///
|
||||
if(euph > 0) {
|
||||
|
||||
EntityGrenadeZOMG zomg = new EntityGrenadeZOMG(worldObj, xCoord, yCoord, zCoord);
|
||||
ExplosionChaos.zomgMeSinPi(worldObj, xCoord, yCoord, zCoord, 1000, null, zomg);
|
||||
EntityNukeExplosionMK3 ex = new EntityNukeExplosionMK3(worldObj);
|
||||
ex.posX = xCoord;
|
||||
ex.posY = yCoord;
|
||||
ex.posZ = zCoord;
|
||||
ex.destructionRange = 150;
|
||||
ex.speed = BombConfig.blastSpeed;
|
||||
ex.coefficient = 1.0F;
|
||||
ex.waste = false;
|
||||
worldObj.spawnEntityInWorld(ex);
|
||||
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.explode", 100000.0F, 1.0F);
|
||||
|
||||
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(worldObj, 50);
|
||||
cloud.posX = xCoord;
|
||||
cloud.posY = yCoord;
|
||||
cloud.posZ = zCoord;
|
||||
worldObj.spawnEntityInWorld(cloud);
|
||||
|
||||
// SCHRABIDIUM ///
|
||||
} else if(schrab > 0) {
|
||||
@ -179,7 +196,7 @@ public class NukeCustom extends BlockContainer implements IBomb {
|
||||
dirty *= 0.25F;
|
||||
|
||||
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, (int)hydro, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).moreFallout((int)dirty));
|
||||
EntityNukeTorex.statFac(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, hydro);
|
||||
EntityNukeTorex.statFacStandard(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, hydro);
|
||||
|
||||
/// NUCLEAR ///
|
||||
} else if(nuke > 0) {
|
||||
@ -188,7 +205,7 @@ public class NukeCustom extends BlockContainer implements IBomb {
|
||||
nuke = Math.min(nuke, maxNuke);
|
||||
|
||||
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, (int)nuke, xCoord + 0.5, yCoord + 5, zCoord + 0.5).moreFallout((int)dirty));
|
||||
EntityNukeTorex.statFac(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, nuke);
|
||||
EntityNukeTorex.statFacStandard(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, nuke);
|
||||
|
||||
/// NON-NUCLEAR ///
|
||||
} else if(tnt >= 75) {
|
||||
@ -196,7 +213,7 @@ public class NukeCustom extends BlockContainer implements IBomb {
|
||||
tnt = Math.min(tnt, maxTnt);
|
||||
|
||||
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(worldObj, (int)tnt, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5));
|
||||
EntityNukeTorex.statFac(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, tnt);
|
||||
EntityNukeTorex.statFacStandard(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, tnt);
|
||||
} else if(tnt > 0) {
|
||||
|
||||
ExplosionLarge.explode(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, tnt, true, true, true);
|
||||
|
||||
@ -131,7 +131,7 @@ public class NukeGadget extends BlockContainer implements IBomb {
|
||||
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
||||
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.gadgetRadius, x + 0.5, y + 0.5, z + 0.5));
|
||||
EntityNukeTorex.statFac(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.gadgetRadius);
|
||||
EntityNukeTorex.statFacStandard(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.gadgetRadius);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@ -124,7 +124,7 @@ public class NukeMan extends BlockContainer implements IBomb {
|
||||
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
||||
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.manRadius, x + 0.5, y + 0.5, z + 0.5));
|
||||
EntityNukeTorex.statFac(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.manRadius);
|
||||
EntityNukeTorex.statFacStandard(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.manRadius);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@ -131,7 +131,7 @@ public class NukeMike extends BlockContainer implements IBomb {
|
||||
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
||||
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.mikeRadius, x + 0.5, y + 0.5, z + 0.5));
|
||||
EntityNukeTorex.statFac(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.mikeRadius);
|
||||
EntityNukeTorex.statFacStandard(world, x + 0.5, y + 0.5, z + 0.5, BombConfig.mikeRadius);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@ -120,7 +120,7 @@ public class NukeN2 extends BlockContainer implements IBomb {
|
||||
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
||||
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(world, r, x + 0.5, y + 0.5, z + 0.5));
|
||||
EntityNukeTorex.statFac(world, x + 0.5, y + 0.5, z + 0.5, r);
|
||||
EntityNukeTorex.statFacStandard(world, x + 0.5, y + 0.5, z + 0.5, r);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@ -129,7 +129,7 @@ public class NukeTsar extends BlockContainer implements IBomb {
|
||||
tetn.clearSlots();
|
||||
world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F);
|
||||
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, r, x + 0.5, y + 0.5, z + 0.5));
|
||||
EntityNukeTorex.statFac(world, x + 0.5, y + 0.5, z + 0.5, r);
|
||||
EntityNukeTorex.statFacStandard(world, x + 0.5, y + 0.5, z + 0.5, r);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@ -60,7 +60,14 @@ public class CoriumFinite extends GenericFiniteFluid {
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
// COFH core apparently replaces the water block class with an incompatible type which breaks
|
||||
// the finite fluid implementation. can't recreate the issue, but according to the provided log
|
||||
// it seems like this shitty band aid might work
|
||||
try {
|
||||
super.updateTick(world, x, y, z, rand);
|
||||
} catch(ClassCastException ex) {
|
||||
if(!world.isRemote) world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
if(!world.isRemote && rand.nextInt(10) == 0 && world.getBlock(x, y - 1, z) != this) {
|
||||
|
||||
|
||||
@ -2,38 +2,79 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.blocks.IBlockMulti;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockAbsorber extends Block {
|
||||
public class BlockAbsorber extends BlockEnumMulti implements IBlockMulti {
|
||||
|
||||
float absorb = 0;
|
||||
// Enum for tiers they are in order of meta data, 0, 1, 2, 3 for Base, Red, Green, Pink
|
||||
public static enum EnumAbsorberTier {
|
||||
|
||||
public BlockAbsorber(Material mat, float ab) {
|
||||
super(mat);
|
||||
BASE(2.5F, "absorber"), RED(10F, "absorber_red"), GREEN(100F, "absorber_green"), PINK(10000F, "absorber_pink");
|
||||
|
||||
public final float absorbAmount;
|
||||
public final String textureName;
|
||||
|
||||
private EnumAbsorberTier(float absorb, String texture) {
|
||||
this.absorbAmount = absorb;
|
||||
this.textureName = texture;
|
||||
}
|
||||
}
|
||||
|
||||
public BlockAbsorber(Material mat) {
|
||||
super(mat, EnumAbsorberTier.class, true, true);
|
||||
this.setTickRandomly(true);
|
||||
absorb = ab;
|
||||
this.setBlockName("rad_absorber");
|
||||
}
|
||||
|
||||
public EnumAbsorberTier getTier(int meta) {
|
||||
return EnumAbsorberTier.values()[rectify(meta)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World world) {
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
EnumAbsorberTier tier = getTier(stack.getItemDamage());
|
||||
String tierName = net.minecraft.util.StatCollector.translateToLocal("tile.rad_absorber." + tier.name().toLowerCase());
|
||||
return tierName;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(net.minecraft.client.renderer.texture.IIconRegister reg) {
|
||||
icons = new IIcon[EnumAbsorberTier.values().length];
|
||||
for(int i = 0; i < icons.length; i++) {
|
||||
icons[i] = reg.registerIcon(RefStrings.MODID + ":" + EnumAbsorberTier.values()[i].textureName);
|
||||
}
|
||||
}
|
||||
|
||||
// All that rad math shit that was on there already, did not touch this
|
||||
// -Wolf
|
||||
|
||||
@Override
|
||||
public int tickRate(World world) {
|
||||
return 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
ChunkRadiationManager.proxy.decrementRad(world, x, y, z, absorb);
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
EnumAbsorberTier tier = getTier(world.getBlockMetadata(x, y, z));
|
||||
ChunkRadiationManager.proxy.decrementRad(world, x, y, z, tier.absorbAmount);
|
||||
world.scheduleBlockUpdate(x, y, z, this, tickRate(world));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
world.scheduleBlockUpdate(x, y, z, this, tickRate(world));
|
||||
}
|
||||
}
|
||||
|
||||
161
src/main/java/com/hbm/blocks/generic/BlockBarrier.java
Normal file
161
src/main/java/com/hbm/blocks/generic/BlockBarrier.java
Normal file
@ -0,0 +1,161 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.render.block.ISBRHUniversal;
|
||||
import com.hbm.render.util.RenderBlocksNT;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockBarrier extends Block implements ISBRHUniversal {
|
||||
|
||||
public BlockBarrier(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override public int getRenderType() { return renderID; }
|
||||
@Override public boolean isOpaqueCube() { return false; }
|
||||
@Override public boolean renderAsNormalBlock() { return false; }
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
|
||||
if(world.getBlockMetadata(x, y, z) != 0) return;
|
||||
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float fX, float fY, float fZ, int meta) {
|
||||
return side >= 2 && side <= 5 ? side : meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
|
||||
if(meta == Library.POS_X.ordinal()) setBlockBounds(0, 0, 0, 0.125F, 1, 1);
|
||||
if(meta == Library.POS_Z.ordinal()) setBlockBounds(0, 0, 0, 1, 1, 0.125F);
|
||||
if(meta == Library.NEG_X.ordinal()) setBlockBounds(0.875F, 0, 0, 1, 1, 1);
|
||||
if(meta == Library.NEG_Z.ordinal()) setBlockBounds(0, 0, 0.875F, 1, 1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity collider) {
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
List<AxisAlignedBB> bbs = new ArrayList();
|
||||
|
||||
Block nx = world.getBlock(x - 1, y, z);
|
||||
Block px = world.getBlock(x + 1, y, z);
|
||||
Block nz = world.getBlock(x, y, z - 1);
|
||||
Block pz = world.getBlock(x, y, z + 1);
|
||||
|
||||
if(nx.isOpaqueCube() || nx.isNormalCube() || meta == Library.POS_X.ordinal()) bbs.add(AxisAlignedBB.getBoundingBox(x, y, z, x + 0.125, y + 1, z + 1));
|
||||
if(nz.isOpaqueCube() || nz.isNormalCube() || meta == Library.POS_Z.ordinal()) bbs.add(AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 0.125));
|
||||
if(px.isOpaqueCube() || px.isNormalCube() || meta == Library.NEG_X.ordinal()) bbs.add(AxisAlignedBB.getBoundingBox(x + 0.875, y, z, x + 1, y + 1, z + 1));
|
||||
if(pz.isOpaqueCube() || pz.isNormalCube() || meta == Library.NEG_Z.ordinal()) bbs.add(AxisAlignedBB.getBoundingBox(x, y, z + 0.875, x + 1, y + 1, z + 1));
|
||||
|
||||
for(AxisAlignedBB bb : bbs) {
|
||||
if(aabb.intersectsWith(bb)) {
|
||||
list.add(bb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int meta, int modelId, Object renderBlocks) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
RenderBlocks renderer = (RenderBlocks) renderBlocks;
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
|
||||
renderer.setRenderBounds(0.4375, 0D, 0.4375D, 0.5625D, 1D, 0.5625D); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
renderer.setRenderBounds(0.5D, 0.0625D, 0D, 0.5625D, 0.4725, 1D); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
renderer.setRenderBounds(0.5D, 0.5625D, 0D, 0.5625D, 0.9375, 1D); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, Object renderBlocks) {
|
||||
|
||||
RenderBlocksNT renderer = RenderBlocksNT.INSTANCE.setWorld(world);
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
Block nx = world.getBlock(x - 1, y, z);
|
||||
Block px = world.getBlock(x + 1, y, z);
|
||||
Block nz = world.getBlock(x, y, z - 1);
|
||||
Block pz = world.getBlock(x, y, z + 1);
|
||||
Block py = world.getBlock(x, y + 1, z);
|
||||
|
||||
boolean negX = nx.isOpaqueCube() || nx.isNormalCube() || meta == Library.POS_X.ordinal();
|
||||
boolean negZ = nz.isOpaqueCube() || nz.isNormalCube() || meta == Library.POS_Z.ordinal();
|
||||
boolean posX = px.isOpaqueCube() || px.isNormalCube() || meta == Library.NEG_X.ordinal();
|
||||
boolean posZ = pz.isOpaqueCube() || pz.isNormalCube() || meta == Library.NEG_Z.ordinal();
|
||||
boolean posY = py.isOpaqueCube() || py.isNormalCube();
|
||||
|
||||
if(negX) {
|
||||
renderer.setRenderBounds(0D, 0D, 0.4375D, 0.125D, 1D, 0.5625D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0D, 0.0625D, negZ ? 0.125D : 0D, 0.0625D, 0.4375D, posZ ? 0.875D : 1D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0D, 0.5625D, negZ ? 0.125D : 0D, 0.0625D, 0.9375D, posZ ? 0.875D : 1D); renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
if(negZ) {
|
||||
renderer.setRenderBounds(0.4375D, 0D, 0D, 0.5625D, 1D, 0.125D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(negX ? 0.125D : 0D, 0.0625D, 0D, posX ? 0.875D : 1D, 0.4375D, 0.0625D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(negX ? 0.125D : 0D, 0.5625D, 0D, posX ? 0.875D : 1D, 0.9375D, 0.0625D); renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
if(posX) {
|
||||
renderer.setRenderBounds(0.875D, 0D, 0.4375D, 1D, 1D, 0.5625D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.9375D, 0.0625D, negZ ? 0.125D : 0D, 1D, 0.4375D, posZ ? 0.875D : 1D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.9375D, 0.5625D, negZ ? 0.125D : 0D, 1D, 0.9375D, posZ ? 0.875D : 1D); renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
if(posZ) {
|
||||
renderer.setRenderBounds(0.4375D, 0D, 0.875D, 0.5625D, 1D, 1D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(negX ? 0.125D : 0D, 0.0625D, 0.9375D, posX ? 0.875D : 1D, 0.4375D, 1D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(negX ? 0.125D : 0D, 0.5625D, 0.9375D, posX ? 0.875D : 1D, 0.9375D, 1D); renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
if(posY) {
|
||||
renderer.setRenderBounds(0D, 0.875D, 0D, 0.125D, 0.9375D, 1D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.875D, 0.875D, 0D, 1D, 0.9375D, 1D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0D, 0.9375D, 0.0625D, 1D, 1D, 0.4375D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0D, 0.9375D, 0.5625D, 1D, 1D, 0.9375D); renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -16,9 +16,9 @@ import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.render.block.RenderBlockMultipass;
|
||||
import com.hbm.util.EnumUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
import api.hbm.fluid.IFillableItem;
|
||||
import api.hbm.fluidmk2.IFillableItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
|
||||
@ -4,6 +4,9 @@ import com.hbm.inventory.gui.GUIScreenBobble;
|
||||
import com.hbm.items.special.ItemPlasticScrap.ScrapType;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.world.gen.nbt.INBTTileEntityTransformable;
|
||||
import com.hbm.world.gen.nbt.INBTBlockTransformable;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -31,7 +34,7 @@ import net.minecraft.world.World;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
public class BlockBobble extends BlockContainer implements IGUIProvider, INBTBlockTransformable {
|
||||
|
||||
public BlockBobble() {
|
||||
super(Material.iron);
|
||||
@ -136,12 +139,17 @@ public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return (meta + coordBaseMode * 4) % 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityBobble();
|
||||
}
|
||||
|
||||
public static class TileEntityBobble extends TileEntity {
|
||||
public static class TileEntityBobble extends TileEntity implements INBTTileEntityTransformable {
|
||||
|
||||
public BobbleType type = BobbleType.NONE;
|
||||
|
||||
@ -173,6 +181,11 @@ public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setByte("type", (byte) type.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transformTE(World world, int coordBaseMode) {
|
||||
type = BobbleType.values()[world.rand.nextInt(BobbleType.values().length - 1) + 1];
|
||||
}
|
||||
}
|
||||
|
||||
public static enum BobbleType {
|
||||
@ -200,7 +213,8 @@ public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
CIRNO( "Cirno", "Cirno", "the only multi layered skin i had", "No brain. Head empty.", true, ScrapType.BOARD_BLANK),
|
||||
MICROWAVE( "Microwave", "Microwave", "OC Compatibility and massive RBMK/packet optimizations", "they call me the food heater$john optimization", true, ScrapType.BOARD_CONVERTER),
|
||||
PEEP( "Peep", "LePeeperSauvage", "Coilgun, Leadburster and Congo Lake models, BDCL QC", "Fluffy ears can't hide in ash, nor snow.", true, ScrapType.CARD_BOARD),
|
||||
MELLOW( "MELLOWARPEGGIATION", "Mellow", "Industrial lighting, animation tools", "Make something cool now, ask for permission later.", true, ScrapType.CARD_PROCESSOR);
|
||||
MELLOW( "MELLOWARPEGGIATION", "Mellow", "NBT Structures, industrial lighting, animation tools", "Make something cool now, ask for permission later.", true, ScrapType.CARD_PROCESSOR),
|
||||
ABEL( "Abel1502", "Abel1502", "Abilities GUI, optimizations and many QoL improvements", "NANTO SUBARASHII", true, ScrapType.CPU_REGISTER);
|
||||
|
||||
public String name; //the title of the tooltip
|
||||
public String label; //the name engraved in the socket
|
||||
|
||||
@ -7,6 +7,7 @@ import static net.minecraftforge.common.util.ForgeDirection.WEST;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import com.hbm.world.gen.nbt.INBTBlockTransformable;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -20,7 +21,7 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockChain extends Block {
|
||||
public class BlockChain extends Block implements INBTBlockTransformable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconEnd;
|
||||
@ -201,4 +202,12 @@ public class BlockChain extends Block {
|
||||
|
||||
super.onNeighborBlockChange(world, x, y, z, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
if (coordBaseMode == 0) return meta;
|
||||
if (meta == 0) return meta;
|
||||
if (meta == 1) return meta;
|
||||
return INBTBlockTransformable.transformMetaDeco(meta, coordBaseMode);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,26 +1,15 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import api.hbm.block.IDrillInteraction;
|
||||
import api.hbm.block.IMiningDrill;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
|
||||
public class BlockCluster extends Block implements IDrillInteraction, ITooltipProvider {
|
||||
public class BlockCluster extends Block {
|
||||
|
||||
public BlockCluster(Material mat) {
|
||||
super(mat);
|
||||
@ -28,32 +17,7 @@ public class BlockCluster extends Block implements IDrillInteraction, ITooltipPr
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
|
||||
if(player instanceof FakePlayer || player == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!world.isRemote && world.getGameRules().getGameRuleBooleanValue("doTileDrops") && !world.restoringBlockSnapshots) {
|
||||
|
||||
Item drop = getDrop();
|
||||
|
||||
if(drop == null)
|
||||
return;
|
||||
|
||||
float f = 0.7F;
|
||||
double mX = (double) (world.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
|
||||
double mY = (double) (world.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
|
||||
double mZ = (double) (world.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
|
||||
|
||||
EntityItem entityitem = new EntityItem(world, (double) x + mX, (double) y + mY, (double) z + mZ, new ItemStack(drop));
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
return getDrop();
|
||||
}
|
||||
|
||||
private Item getDrop() {
|
||||
@ -65,24 +29,4 @@ public class BlockCluster extends Block implements IDrillInteraction, ITooltipPr
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBreak(World world, int x, int y, int z, int meta, IMiningDrill drill) {
|
||||
return drill.getDrillRating() > 70 || world.rand.nextFloat() < 0.05;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack extractResource(World world, int x, int y, int z, int meta, IMiningDrill drill) {
|
||||
return drill.getDrillRating() <= 70 ? new ItemStack(getDrop()) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRelativeHardness(World world, int x, int y, int z, int meta, IMiningDrill drill) {
|
||||
return this.getBlockHardness(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("trait.tile.cluster"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,78 +0,0 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockCoalBurning extends BlockOutgas {
|
||||
|
||||
public BlockCoalBurning(Material mat) {
|
||||
super(mat, false, 1, false);
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
super.randomDisplayTick(world, x, y, z, rand);
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
|
||||
if(dir == ForgeDirection.DOWN)
|
||||
continue;
|
||||
|
||||
if(world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ).getMaterial() == Material.air) {
|
||||
|
||||
double ix = x + 0.5F + dir.offsetX + rand.nextDouble() - 0.5D;
|
||||
double iy = y + 0.5F + dir.offsetY + rand.nextDouble() - 0.5D;
|
||||
double iz = z + 0.5F + dir.offsetZ + rand.nextDouble() - 0.5D;
|
||||
|
||||
if(dir.offsetX != 0)
|
||||
ix = x + 0.5F + dir.offsetX * 0.5 + rand.nextDouble() * 0.125 * dir.offsetX;
|
||||
if(dir.offsetY != 0)
|
||||
iy = y + 0.5F + dir.offsetY * 0.5 + rand.nextDouble() * 0.125 * dir.offsetY;
|
||||
if(dir.offsetZ != 0)
|
||||
iz = z + 0.5F + dir.offsetZ * 0.5 + rand.nextDouble() * 0.125 * dir.offsetZ;
|
||||
|
||||
world.spawnParticle("flame", ix, iy, iz, 0.0, 0.0, 0.0);
|
||||
world.spawnParticle("smoke", ix, iy, iz, 0.0, 0.0, 0.0);
|
||||
world.spawnParticle("smoke", ix, iy, iz, 0.0, 0.1, 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int i) {
|
||||
super.breakBlock(world, x, y, z, block, i);
|
||||
|
||||
world.setBlock(x, y, z, Blocks.fire);
|
||||
|
||||
for(int ix = -2; ix <= 2; ix++) {
|
||||
for(int iy = -2; iy <= 2; iy++) {
|
||||
for(int iz = -2; iz <= 2; iz++) {
|
||||
|
||||
if(Math.abs(ix + iy + iz) < 5 && world.getBlock(x + ix, y + iy, z + iz) == Blocks.air) {
|
||||
world.setBlock(x + ix, y + iy, z + iz, this.getGas());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
|
||||
entity.setFire(3);
|
||||
}
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCoalOil extends Block {
|
||||
|
||||
public BlockCoalOil(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
world.setBlock(x, y, z, ModBlocks.ore_coal_oil_burning);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
return Items.coal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random rand) {
|
||||
return 2 + rand.nextInt(2);
|
||||
}
|
||||
}
|
||||
@ -5,8 +5,10 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBatteryPack.EnumBatteryPack;
|
||||
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -16,6 +18,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Spaghetti("this is implemented in the most braindead fucking way imaginable") // TODO: rework this unholy abomination using configurable loot pools
|
||||
public class BlockCrate extends BlockFalling {
|
||||
|
||||
List<ItemStack> crateList;
|
||||
@ -69,22 +72,16 @@ public class BlockCrate extends BlockFalling {
|
||||
|
||||
// Lead Crate
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_uranium, 10);
|
||||
// BlockCrate.addToListWithWeight(leadList, ModItems.ingot_u235, 5);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_u238, 8);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_plutonium, 7);
|
||||
// BlockCrate.addToListWithWeight(leadList, ModItems.ingot_pu238, 5);
|
||||
// BlockCrate.addToListWithWeight(leadList, ModItems.ingot_pu239, 4);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_pu240, 6);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_neptunium, 7);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_uranium_fuel, 8);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_plutonium_fuel, 7);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_mox_fuel, 6);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_uranium, 10);
|
||||
// BlockCrate.addToListWithWeight(leadList, ModItems.nugget_u235, 5);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_u238, 8);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_plutonium, 7);
|
||||
// BlockCrate.addToListWithWeight(leadList, ModItems.nugget_pu238, 5);
|
||||
// BlockCrate.addToListWithWeight(leadList, ModItems.nugget_pu239, 4);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_pu240, 6);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_neptunium, 7);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_uranium_fuel, 8);
|
||||
@ -96,29 +93,25 @@ public class BlockCrate extends BlockFalling {
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.cell_puf6, 8);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.pellet_rtg, 6);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.pellet_rtg_weak, 7);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.tritium_deuterium_cake, 5);
|
||||
BlockCrate.addToListWithWeight(leadList, ModItems.powder_yellowcake, 10);
|
||||
|
||||
// Metal Crate
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_press), 10);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 9);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_reactor_breeding), 6);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off), 7);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_wood_burner), 10);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_diesel), 8);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_rtg_grey), 4);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.red_pylon), 9);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_battery), 8);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_lithium_battery), 5);
|
||||
BlockCrate.addToListWithWeight(metalList, new ItemStack(ModItems.battery_pack, 1, EnumBatteryPack.BATTERY_LEAD.ordinal()), 10);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off), 8);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_assembler), 10);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_assembly_machine), 10);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_fluidtank), 7);
|
||||
BlockCrate.addToListWithWeight(metalList, ModItems.centrifuge_element, 6);
|
||||
BlockCrate.addToListWithWeight(metalList, ModItems.motor, 8);
|
||||
BlockCrate.addToListWithWeight(metalList, ModItems.coil_tungsten, 7);
|
||||
BlockCrate.addToListWithWeight(metalList, ModItems.photo_panel, 3);
|
||||
BlockCrate.addToListWithWeight(metalList, ModItems.coil_copper, 10);
|
||||
BlockCrate.addToListWithWeight(metalList, ModItems.tank_steel, 9);
|
||||
BlockCrate.addToListWithWeight(metalList, ModItems.blade_titanium, 3);
|
||||
BlockCrate.addToListWithWeight(metalList, ModItems.piston_selenium, 6);
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.BlockMulti;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.world.gen.nbt.INBTBlockTransformable;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -14,7 +15,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDecoCRT extends BlockMulti {
|
||||
public class BlockDecoCRT extends BlockMulti implements INBTBlockTransformable {
|
||||
|
||||
protected String[] variants = new String[] {"crt_clean", "crt_broken", "crt_blinking", "crt_bsod"};
|
||||
@SideOnly(Side.CLIENT) protected IIcon[] icons;
|
||||
@ -73,4 +74,10 @@ public class BlockDecoCRT extends BlockMulti {
|
||||
public int getSubCount() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTBlockTransformable.transformMetaDecoModel(meta, coordBaseMode);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,17 +1,19 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.render.block.ct.CT;
|
||||
import com.hbm.render.block.ct.CTStitchReceiver;
|
||||
import com.hbm.render.block.ct.IBlockCT;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockDecoCT extends BlockOre implements IBlockCT{
|
||||
public class BlockDecoCT extends BlockOre implements IBlockCT {
|
||||
|
||||
public BlockDecoCT(Material mat) {
|
||||
super(mat);
|
||||
@ -35,4 +37,12 @@ public class BlockDecoCT extends BlockOre implements IBlockCT{
|
||||
public IIcon[] getFragments(IBlockAccess world, int x, int y, int z) {
|
||||
return rec.fragCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(IBlockAccess world, int x, int y, int z, Block block) {
|
||||
// i don't care
|
||||
if(this == ModBlocks.deco_steel && block == ModBlocks.deco_rusty_steel) return true;
|
||||
if(this == ModBlocks.deco_rusty_steel && block == ModBlocks.deco_steel) return true;
|
||||
return this == block;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.world.gen.nbt.INBTBlockTransformable;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -11,7 +12,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDecoModel extends BlockEnumMulti {
|
||||
public class BlockDecoModel extends BlockEnumMulti implements INBTBlockTransformable {
|
||||
|
||||
public BlockDecoModel(Material mat, Class<? extends Enum> theEnum, boolean multiName, boolean multiTexture) {
|
||||
super(mat, theEnum, multiName, multiTexture);
|
||||
@ -104,4 +105,34 @@ public class BlockDecoModel extends BlockEnumMulti {
|
||||
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
if(coordBaseMode == 0) return meta;
|
||||
//N: 0b00, S: 0b01, W: 0b10, E: 0b11
|
||||
int rot = meta >> 2;
|
||||
int type = meta & 3;
|
||||
|
||||
switch(coordBaseMode) {
|
||||
default: //South
|
||||
break;
|
||||
case 1: //West
|
||||
if((rot & 3) < 2) //N & S can just have bits toggled
|
||||
rot = rot ^ 3;
|
||||
else //W & E can just have first bit set to 0
|
||||
rot = rot ^ 2;
|
||||
break;
|
||||
case 2: //North
|
||||
rot = rot ^ 1; //N, W, E & S can just have first bit toggled
|
||||
break;
|
||||
case 3: //East
|
||||
if((rot & 3) < 2)//N & S can just have second bit set to 1
|
||||
rot = rot ^ 2;
|
||||
else //W & E can just have bits toggled
|
||||
rot = rot ^ 3;
|
||||
break;
|
||||
}
|
||||
//genuinely like. why did i do that
|
||||
return (rot << 2) | type; //To accommodate for BlockDecoModel's shift in the rotation bits; otherwise, simply bit-shift right and or any non-rotation meta after
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.BlockMulti;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.world.gen.nbt.INBTBlockTransformable;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -16,7 +17,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDecoToaster extends BlockMulti {
|
||||
public class BlockDecoToaster extends BlockMulti implements INBTBlockTransformable {
|
||||
|
||||
protected String[] variants = new String[] {"toaster_iron", "toaster_steel", "toaster_wood"};
|
||||
@SideOnly(Side.CLIENT) protected IIcon[] icons;
|
||||
@ -90,4 +91,10 @@ public class BlockDecoToaster extends BlockMulti {
|
||||
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTBlockTransformable.transformMetaDecoModel(meta, coordBaseMode);
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,7 +3,7 @@ package com.hbm.blocks.generic;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
import api.hbm.item.IDepthRockTool;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
@ -17,6 +17,8 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@ -92,7 +94,7 @@ public class BlockDoorGeneric extends BlockDummyable implements IBomb {
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB entityBox, List collidingBoxes, Entity entityIn) {
|
||||
AxisAlignedBB box = getBoundingBox(worldIn, x, y ,z);
|
||||
AxisAlignedBB box = getBoundingBox(worldIn, x, y, z, true);
|
||||
box = AxisAlignedBB.getBoundingBox(
|
||||
Math.min(box.minX, box.maxX), Math.min(box.minY, box.maxY), Math.min(box.minZ, box.maxZ),
|
||||
Math.max(box.minX, box.maxX), Math.max(box.minY, box.maxY), Math.max(box.minZ, box.maxZ));
|
||||
@ -111,11 +113,27 @@ public class BlockDoorGeneric extends BlockDummyable implements IBomb {
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
AxisAlignedBB aabb = this.getBoundingBox(world, x, y, z);
|
||||
AxisAlignedBB aabb = this.getBoundingBox(world, x, y, z, true);
|
||||
if(aabb.minX == aabb.maxX && aabb.minY == aabb.maxY && aabb.minZ == aabb.maxZ) return null;
|
||||
return aabb;
|
||||
}
|
||||
|
||||
// Enables clicking through the open door
|
||||
@Override
|
||||
public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 startVec, Vec3 endVec) {
|
||||
AxisAlignedBB box = getBoundingBox(world, x, y, z, false);
|
||||
box = AxisAlignedBB.getBoundingBox(
|
||||
Math.min(box.minX, box.maxX), Math.min(box.minY, box.maxY), Math.min(box.minZ, box.maxZ),
|
||||
Math.max(box.minX, box.maxX), Math.max(box.minY, box.maxY), Math.max(box.minZ, box.maxZ)
|
||||
);
|
||||
|
||||
MovingObjectPosition intercept = box.calculateIntercept(startVec, endVec);
|
||||
if(intercept != null) {
|
||||
return new MovingObjectPosition(x, y, z, intercept.sideHit, intercept.hitVec);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override //should fix AI pathfinding
|
||||
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z) { //btw the method name is the exact opposite of that it's doing, check net.minecraft.pathfinding.PathNavigate#512
|
||||
return hasExtra(world.getBlockMetadata(x, y, z)); //if it's open
|
||||
@ -140,11 +158,11 @@ public class BlockDoorGeneric extends BlockDummyable implements IBomb {
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
return getBoundingBox(world, x, y, z);
|
||||
return getBoundingBox(world, x, y, z, false);
|
||||
//return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
|
||||
}
|
||||
|
||||
public AxisAlignedBB getBoundingBox(World world, int x, int y, int z) {
|
||||
public AxisAlignedBB getBoundingBox(World world, int x, int y, int z, boolean forCollision) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
int[] core = this.findCore(world, x, y, z);
|
||||
@ -155,7 +173,7 @@ public class BlockDoorGeneric extends BlockDummyable implements IBomb {
|
||||
TileEntity te2 = world.getTileEntity(core[0], core[1], core[2]);
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(te2.getBlockMetadata() - BlockDummyable.offset);
|
||||
BlockPos pos = new BlockPos(x - core[0], y - core[1], z - core[2]).rotate(Rotation.getBlockRotation(dir).add(Rotation.COUNTERCLOCKWISE_90));
|
||||
AxisAlignedBB box = type.getBlockBound(pos.getX(), pos.getY(), pos.getZ(), open);
|
||||
AxisAlignedBB box = type.getBlockBound(pos.getX(), pos.getY(), pos.getZ(), open, forCollision);
|
||||
|
||||
switch(te2.getBlockMetadata() - offset){
|
||||
case 2: return AxisAlignedBB.getBoundingBox(x + 1 - box.minX, y + box.minY, z + 1 - box.minZ, x + 1 - box.maxX, y + box.maxY, z + 1 - box.maxZ);
|
||||
|
||||
@ -4,7 +4,7 @@ import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.handler.threading.PacketThreading;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
@ -169,7 +169,7 @@ public class BlockEmitter extends BlockContainer implements IToolable, ITooltipP
|
||||
data.setFloat("yaw", 90);
|
||||
}
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x, y, z),
|
||||
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(data, x, y, z),
|
||||
new TargetPoint(worldObj.provider.dimensionId, x, y, z, 100));
|
||||
|
||||
color = prevColor;
|
||||
|
||||
@ -2,21 +2,28 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardSender;
|
||||
import com.hbm.blocks.IBlockMultiPass;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.block.RenderBlockMultipass;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockFissure extends Block implements IBlockMultiPass {
|
||||
public class BlockFissure extends BlockContainer implements IBlockMultiPass {
|
||||
|
||||
private IIcon overlay;
|
||||
|
||||
@ -48,7 +55,8 @@ public class BlockFissure extends Block implements IBlockMultiPass {
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
if(world.getBlock(x, y + 1, z).isReplaceable(world, x, y + 1, z)) world.setBlock(x, y + 1, z, ModBlocks.volcanic_lava_block);
|
||||
boolean crater = world.getBlockMetadata(x, y, z) != 0;
|
||||
if(world.getBlock(x, y + 1, z).isReplaceable(world, x, y + 1, z)) world.setBlock(x, y + 1, z, crater ? ModBlocks.rad_lava_block : ModBlocks.volcanic_lava_block);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,4 +73,31 @@ public class BlockFissure extends Block implements IBlockMultiPass {
|
||||
public int getRenderType(){
|
||||
return IBlockMultiPass.getRenderType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityFissure();
|
||||
}
|
||||
|
||||
public static class TileEntityFissure extends TileEntityLoadedBase implements IFluidStandardSender {
|
||||
|
||||
public FluidTank lava = new FluidTank(Fluids.LAVA, 1_000);
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
lava.setFill(1_000);
|
||||
this.sendFluid(lava, worldObj, xCoord, yCoord + 1, zCoord, ForgeDirection.UP);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(FluidType type, ForgeDirection dir) {
|
||||
return dir == ForgeDirection.DOWN && type == Fluids.LAVA;
|
||||
}
|
||||
|
||||
@Override public FluidTank[] getAllTanks() { return new FluidTank[] {lava}; }
|
||||
@Override public FluidTank[] getSendingTanks() { return new FluidTank[] {lava}; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,6 +18,6 @@ public class BlockGenericStairs extends BlockStairs {
|
||||
|
||||
recipeGen.add(new Object[] {block, meta, this});
|
||||
|
||||
this.setBlockTextureName(RefStrings.MODID + ":concrete_smooth");
|
||||
this.setBlockTextureName(RefStrings.MODID + ":concrete");
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import java.util.List;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@ -53,7 +53,7 @@ public class BlockLanternBehemoth extends BlockDummyable implements IToolable, I
|
||||
|
||||
if(didRepair) {
|
||||
HbmPlayerProps data = HbmPlayerProps.getData(player);
|
||||
data.reputation++;
|
||||
if(data.reputation < 25) data.reputation++;
|
||||
}
|
||||
|
||||
return didRepair;
|
||||
|
||||
39
src/main/java/com/hbm/blocks/generic/BlockLightstone.java
Normal file
39
src/main/java/com/hbm/blocks/generic/BlockLightstone.java
Normal file
@ -0,0 +1,39 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockLightstone extends BlockEnumMulti {
|
||||
|
||||
public BlockLightstone(Material mat, Class<? extends Enum> theEnum, boolean multiName, boolean multiTexture) {
|
||||
super(mat, theEnum, multiName, multiTexture);
|
||||
}
|
||||
|
||||
protected IIcon[] topIcons;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
|
||||
Enum[] enums = theEnum.getEnumConstants();
|
||||
this.icons = new IIcon[enums.length];
|
||||
this.topIcons = new IIcon[enums.length];
|
||||
|
||||
for(int i = 0; i < icons.length; i++) {
|
||||
Enum num = enums[i];
|
||||
this.icons[i] = reg.registerIcon(this.getTextureMultiName(num));
|
||||
if(i >= 3) this.topIcons[i] = reg.registerIcon(this.getTextureMultiName(num) + ".top");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return (side == 0 || side == 1) && this.topIcons[meta % this.icons.length] != null ? this.topIcons[meta % this.icons.length] : this.icons[meta % this.icons.length];
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,7 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.world.gen.nbt.INBTBlockTransformable;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -20,7 +21,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockModDoor extends Block {
|
||||
public class BlockModDoor extends Block implements INBTBlockTransformable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] field_150017_a;
|
||||
@SideOnly(Side.CLIENT)
|
||||
@ -396,4 +397,9 @@ public class BlockModDoor extends Block {
|
||||
p_149681_1_.setBlockToAir(p_149681_2_, p_149681_3_ - 1, p_149681_4_);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTBlockTransformable.transformMetaDoor(meta, coordBaseMode);
|
||||
}
|
||||
}
|
||||
@ -35,11 +35,15 @@ public class BlockMultiSlab extends BlockSlab implements IStepTickReceiver {
|
||||
|
||||
if(single == null) {
|
||||
for(int i = 0; i < slabMaterials.length; i++) {
|
||||
recipeGen.add(new Object[] {slabMaterials[i], this, i});
|
||||
recipeGen.add(new Object[] {slabMaterials[i], 0, this, i});
|
||||
}
|
||||
}
|
||||
|
||||
this.setBlockTextureName(RefStrings.MODID + ":concrete_smooth");
|
||||
this.setBlockTextureName(RefStrings.MODID + ":concrete");
|
||||
}
|
||||
|
||||
public BlockMultiSlab(boolean b, Material mat) {
|
||||
super(b, mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -60,6 +64,7 @@ public class BlockMultiSlab extends BlockSlab implements IStepTickReceiver {
|
||||
return new ItemStack(Item.getItemFromBlock(single != null ? single : this), 2, (meta & 7) % slabMaterials.length);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z) {
|
||||
return Item.getItemFromBlock(single != null ? single : this);
|
||||
@ -77,6 +82,7 @@ public class BlockMultiSlab extends BlockSlab implements IStepTickReceiver {
|
||||
return (super.getDamageValue(world, x, y, z) & 7) % slabMaterials.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
|
||||
|
||||
48
src/main/java/com/hbm/blocks/generic/BlockMultiSlabMeta.java
Normal file
48
src/main/java/com/hbm/blocks/generic/BlockMultiSlabMeta.java
Normal file
@ -0,0 +1,48 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockMultiSlabMeta extends BlockMultiSlab {
|
||||
|
||||
public int[] metas;
|
||||
|
||||
public BlockMultiSlabMeta(Block single, Material mat, Block[] slabMaterials, int...metas) {
|
||||
super(single != null, mat);
|
||||
this.single = single;
|
||||
this.slabMaterials = slabMaterials;
|
||||
this.metas = new int[slabMaterials.length]; //initialized to 0s
|
||||
for(int i = 0; i < metas.length; i++) {
|
||||
this.metas[i] = metas[i];
|
||||
}
|
||||
|
||||
this.useNeighborBrightness = true;
|
||||
|
||||
if(single == null) {
|
||||
for(int i = 0; i < slabMaterials.length; i++) {
|
||||
recipeGen.add(new Object[] {slabMaterials[i], metas[i], this, i});
|
||||
}
|
||||
}
|
||||
|
||||
this.setBlockTextureName(RefStrings.MODID + ":concrete");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
meta = (meta & 7) % slabMaterials.length;
|
||||
Block block = slabMaterials[meta];
|
||||
return block.getIcon(side, metas[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String func_150002_b(int meta) {
|
||||
meta = (meta & 7) % slabMaterials.length;
|
||||
return super.func_150002_b(meta) + "." + metas[meta];
|
||||
}
|
||||
}
|
||||
@ -9,6 +9,8 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockDeadPlant.EnumDeadPlantType;
|
||||
import com.hbm.blocks.generic.BlockTallPlant.EnumTallFlower;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -16,6 +18,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.ColorizerGrass;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
@ -199,6 +202,43 @@ public class BlockNTMFlower extends BlockEnumMulti implements IPlantable, IGrowa
|
||||
this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(int meta)
|
||||
{
|
||||
if (meta == 1 || meta == 3) {
|
||||
return ColorizerGrass.getGrassColor(0.5D, 1.0D);
|
||||
} else return 0xFFFFFF;
|
||||
}
|
||||
// if you need to make another tinted plant just throw the metadata value
|
||||
// into the if statements above and below i really do not want to make this more
|
||||
// complicated than it needs to be
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
int l = 0;
|
||||
int i1 = 0;
|
||||
int j1 = 0;
|
||||
|
||||
for (int k1 = -1; k1 <= 1; ++k1)
|
||||
{
|
||||
for (int l1 = -1; l1 <= 1; ++l1)
|
||||
{
|
||||
int i2 = world.getBiomeGenForCoords(x + l1, z + k1).getBiomeFoliageColor(x + l1, y, z + k1);
|
||||
l += (i2 & 16711680) >> 16;
|
||||
i1 += (i2 & 65280) >> 8;
|
||||
j1 += i2 & 255;
|
||||
}
|
||||
}
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta == 1 || meta == 3) {
|
||||
return ((l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255);
|
||||
} else return 0xFFFFFF;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { }
|
||||
}
|
||||
|
||||
79
src/main/java/com/hbm/blocks/generic/BlockNTMSand.java
Normal file
79
src/main/java/com/hbm/blocks/generic/BlockNTMSand.java
Normal file
@ -0,0 +1,79 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityFallingBlock;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockNTMSand extends BlockEnumMulti {
|
||||
|
||||
public BlockNTMSand(Material mat) {
|
||||
super(mat, EnumSandType.class, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block b) {
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
if(!world.isRemote) {
|
||||
this.fall(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
private void fall(World world, int x, int y, int z) {
|
||||
if(BlockFalling.func_149831_e(world, x, y - 1, z) && y >= 0) {
|
||||
byte b0 = 32;
|
||||
|
||||
if(!BlockFalling.fallInstantly && world.checkChunksExist(x - b0, y - b0, z - b0, x + b0, y + b0, z + b0)) {
|
||||
if(!world.isRemote) {
|
||||
EntityFallingBlock entityfallingblock = new EntityFallingBlock(world, x + 0.5, y + 0.5, z + 0.5, this, world.getBlockMetadata(x, y, z));
|
||||
world.spawnEntityInWorld(entityfallingblock);
|
||||
}
|
||||
} else {
|
||||
world.setBlockToAir(x, y, z);
|
||||
|
||||
while(BlockFalling.func_149831_e(world, x, y - 1, z) && y > 0) {
|
||||
--y;
|
||||
}
|
||||
|
||||
if(y > 0) {
|
||||
world.setBlock(x, y, z, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World p_149738_1_) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureMultiName(Enum num) {
|
||||
return RefStrings.MODID + ":sand_" + num.name().toLowerCase(Locale.US);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedMultiName(Enum num) {
|
||||
return "tile.sand_" + num.name().toLowerCase(Locale.US);
|
||||
}
|
||||
|
||||
public static enum EnumSandType {
|
||||
BORON, LEAD, URANIUM, POLONIUM, QUARTZ
|
||||
}
|
||||
}
|
||||
60
src/main/java/com/hbm/blocks/generic/BlockNTMTrapdoor.java
Normal file
60
src/main/java/com/hbm/blocks/generic/BlockNTMTrapdoor.java
Normal file
@ -0,0 +1,60 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockTrapDoor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockNTMTrapdoor extends BlockTrapDoor {
|
||||
public BlockNTMTrapdoor(Material material) {
|
||||
super(material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
// isOpen
|
||||
if (!func_150118_d(meta))
|
||||
return false;
|
||||
|
||||
Block blockBelow = world.getBlock(x, y - 1, z);
|
||||
return blockBelow != null && blockBelow.isLadder(world, x, y - 1, z, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
// Make the hitbox in-line with ladders, if relevant
|
||||
if (isLadder(world, x, y, z, null)) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
float thickness = 0.125F;
|
||||
|
||||
if ((meta & 3) == 0)
|
||||
return AxisAlignedBB.getBoundingBox(x, y, z + 1F - thickness, x + 1F, y + 1F, z + 1F);
|
||||
|
||||
if ((meta & 3) == 1)
|
||||
return AxisAlignedBB.getBoundingBox(x, y, z, x + 1F, y + 1F, z + thickness);
|
||||
|
||||
if ((meta & 3) == 2)
|
||||
return AxisAlignedBB.getBoundingBox(x + 1F - thickness, y, z, x + 1F, y + 1F, z + 1F);
|
||||
|
||||
if ((meta & 3) == 3)
|
||||
return AxisAlignedBB.getBoundingBox(x, y, z, x + thickness, y + 1F, z + 1F);
|
||||
}
|
||||
|
||||
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
// The original code prevented manual operation of Material.iron trapdoors. This bypasses that behavior
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta ^ 4, 2);
|
||||
world.playAuxSFXAtEntity(player, 1003, x, y, z, 0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -68,9 +68,6 @@ public class BlockOre extends Block {
|
||||
if(this == ModBlocks.ore_nether_fire) {
|
||||
return rand.nextInt(10) == 0 ? ModItems.ingot_phosphorus : ModItems.powder_fire;
|
||||
}
|
||||
if(this == ModBlocks.block_meteor) {
|
||||
return rand.nextInt(10) == 0 ? ModItems.plate_dalekanium : Item.getItemFromBlock(ModBlocks.block_meteor);
|
||||
}
|
||||
if(this == ModBlocks.block_meteor_cobble) {
|
||||
return ModItems.fragment_meteorite;
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.Random;
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -29,11 +30,18 @@ public class BlockOreBasalt extends BlockEnumMulti {
|
||||
}
|
||||
|
||||
public static enum EnumBasaltOreType {
|
||||
SULFUR,
|
||||
FLUORITE,
|
||||
ASBESTOS,
|
||||
GEM,
|
||||
MOLYSITE
|
||||
SULFUR(ModItems.sulfur),
|
||||
FLUORITE(ModItems.fluorite),
|
||||
ASBESTOS(ModItems.ingot_asbestos),
|
||||
GEM(ModItems.gem_volcanic),
|
||||
MOLYSITE(ModItems.powder_molysite);
|
||||
|
||||
public Item drop;
|
||||
|
||||
private EnumBasaltOreType(Item drop) {
|
||||
this.drop = drop;
|
||||
if(drop == null) throw new IllegalStateException("EnumBasaltOreType initialized before ModItems!");
|
||||
}
|
||||
}
|
||||
|
||||
public String getTextureMultiName(Enum num) {
|
||||
@ -46,12 +54,8 @@ public class BlockOreBasalt extends BlockEnumMulti {
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
if(meta == EnumBasaltOreType.SULFUR.ordinal()) return ModItems.sulfur;
|
||||
if(meta == EnumBasaltOreType.FLUORITE.ordinal()) return ModItems.fluorite;
|
||||
if(meta == EnumBasaltOreType.ASBESTOS.ordinal()) return ModItems.ingot_asbestos;
|
||||
if(meta == EnumBasaltOreType.GEM.ordinal()) return ModItems.gem_volcanic;
|
||||
if(meta == EnumBasaltOreType.MOLYSITE.ordinal()) return ModItems.powder_molysite;
|
||||
return super.getItemDropped(meta, rand, fortune);
|
||||
EnumBasaltOreType type = EnumUtil.grabEnumSafely(EnumBasaltOreType.class, meta);
|
||||
return type.drop;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -50,7 +50,7 @@ public class BlockOutgas extends BlockOre {
|
||||
if(this == ModBlocks.ancient_scrap)
|
||||
return ModBlocks.gas_radon_tomb;
|
||||
|
||||
if(this == ModBlocks.ore_coal_oil_burning || this == ModBlocks.ore_nether_coal) {
|
||||
if(this == ModBlocks.ore_nether_coal) {
|
||||
return ModBlocks.gas_monoxide;
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,12 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.inventory.recipes.PedestalRecipes;
|
||||
import com.hbm.inventory.recipes.PedestalRecipes.PedestalRecipe;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.particle.helper.ExplosionSmallCreator;
|
||||
import com.hbm.util.Compat;
|
||||
|
||||
@ -21,6 +25,7 @@ import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@ -54,41 +59,26 @@ public class BlockPedestal extends BlockContainer {
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
@Override public int getRenderType() { return renderID; }
|
||||
@Override public boolean isOpaqueCube() { return false; }
|
||||
@Override public boolean renderAsNormalBlock() { return false; }
|
||||
@Override @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { return true; }
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) return true;
|
||||
if(player.isSneaking()) return false;
|
||||
|
||||
TileEntityPedestal pedestal = (TileEntityPedestal) world.getTileEntity(x, y, z);
|
||||
|
||||
if(pedestal.item == null && player.getHeldItem() != null) {
|
||||
if(world.isRemote) return true;
|
||||
pedestal.item = player.getHeldItem().copy();
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = null;
|
||||
pedestal.markDirty();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
} else if(pedestal.item != null && player.getHeldItem() == null) {
|
||||
if(world.isRemote) return true;
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = pedestal.item.copy();
|
||||
pedestal.item = null;
|
||||
pedestal.markDirty();
|
||||
@ -129,9 +119,11 @@ public class BlockPedestal extends BlockContainer {
|
||||
TileEntityPedestal se = castOrNull(Compat.getTileStandard(world, x + ForgeDirection.SOUTH.offsetX * 2 + ForgeDirection.EAST.offsetX * 2, y, z + ForgeDirection.SOUTH.offsetZ * 2 + ForgeDirection.EAST.offsetZ * 2));
|
||||
|
||||
TileEntityPedestal[] tileArray = new TileEntityPedestal[] {nw, n, ne, w, center, e, sw, s, se};
|
||||
List<EntityPlayer> nearbyPlayers = world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(20, 20, 20));
|
||||
|
||||
outer: for(PedestalRecipe recipe : PedestalRecipes.recipes) {
|
||||
|
||||
/// EXTRA CONDITIONS ///
|
||||
if(recipe.extra == recipe.extra.FULL_MOON) {
|
||||
if(world.getCelestialAngle(0) < 0.35 || world.getCelestialAngle(0) > 0.65) continue;
|
||||
if(world.provider.getMoonPhase(world.getWorldInfo().getWorldTime()) != 0) continue;
|
||||
@ -146,6 +138,19 @@ public class BlockPedestal extends BlockContainer {
|
||||
if(world.getCelestialAngle(0) > 0.15 && world.getCelestialAngle(0) < 0.85) continue;
|
||||
}
|
||||
|
||||
if(recipe.extra == recipe.extra.BAD_KARMA) {
|
||||
boolean matches = false;
|
||||
for(EntityPlayer player : nearbyPlayers) if(HbmPlayerProps.getData(player).reputation <= -10) { matches = true; break; }
|
||||
if(!matches) continue;
|
||||
}
|
||||
|
||||
if(recipe.extra == recipe.extra.GOOD_KARMA) {
|
||||
boolean matches = false;
|
||||
for(EntityPlayer player : nearbyPlayers) if(HbmPlayerProps.getData(player).reputation >= 10) { matches = true; break; }
|
||||
if(!matches) continue;
|
||||
}
|
||||
|
||||
/// CHECK ITEMS ///
|
||||
for(int i = 0; i < 9; i++) {
|
||||
ItemStack pedestal = tileArray[i] != null ? tileArray[i].item : null;
|
||||
if(pedestal == null && recipe.input[i] != null) continue outer;
|
||||
@ -155,6 +160,7 @@ public class BlockPedestal extends BlockContainer {
|
||||
if(!recipe.input[i].matchesRecipe(pedestal, true) || recipe.input[i].stacksize != pedestal.stackSize) continue outer;
|
||||
}
|
||||
|
||||
/// REMOVE ITEMS ///
|
||||
for(int i = 0; i < 9; i++) {
|
||||
if(i == 4) continue;
|
||||
ItemStack pedestal = tileArray[i] != null ? tileArray[i].item : null;
|
||||
@ -164,11 +170,15 @@ public class BlockPedestal extends BlockContainer {
|
||||
world.markBlockForUpdate(tileArray[i].xCoord, tileArray[i].yCoord, tileArray[i].zCoord);
|
||||
}
|
||||
|
||||
/// PRODUCE RESULT ///
|
||||
center.item = recipe.output.copy();
|
||||
center.markDirty();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
ExplosionSmallCreator.composeEffect(world, x + 0.5, y + 1.5, z + 0.5, 10, 2.5F, 1F);
|
||||
|
||||
List<EntityPlayer> players = world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x + 0.5, y, z + 0.5, x + 0.5, y, z + 0.5).expand(50, 50, 50));
|
||||
for(EntityPlayer player : players) player.addStat(MainRegistry.statLegendary, 1);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -184,10 +194,7 @@ public class BlockPedestal extends BlockContainer {
|
||||
|
||||
public ItemStack item;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
@Override public boolean canUpdate() { return false; }
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.world.gen.nbt.INBTBlockTransformable;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -16,7 +17,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPipe extends Block implements ITooltipProvider {
|
||||
public class BlockPipe extends Block implements ITooltipProvider, INBTBlockTransformable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon sideIcon;
|
||||
@ -92,4 +93,10 @@ public class BlockPipe extends Block implements ITooltipProvider {
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
list.add("Purely decorative");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTBlockTransformable.transformMetaPillar(meta, coordBaseMode);
|
||||
}
|
||||
|
||||
}
|
||||
@ -10,6 +10,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Deprecated
|
||||
public class BlockPlasma extends Block {
|
||||
|
||||
public BlockPlasma(Material p_i45394_1_) {
|
||||
@ -18,41 +19,24 @@ public class BlockPlasma extends Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
if (world.getGameRules().getGameRuleBooleanValue("doFireTick"))
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
if(world.getGameRules().getGameRuleBooleanValue("doFireTick"))
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
|
||||
{
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_)
|
||||
{
|
||||
public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) {
|
||||
p_149670_5_.setFire(10);
|
||||
p_149670_5_.setInWeb();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override public boolean isOpaqueCube() { return false; }
|
||||
@Override public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return null; }
|
||||
@Override public boolean renderAsNormalBlock() { return false; }
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,8 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.IBlockMulti;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.world.gen.nbt.INBTTileEntityTransformable;
|
||||
import com.hbm.world.gen.nbt.INBTBlockTransformable;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -27,7 +29,7 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPlushie extends BlockContainer implements IBlockMulti, ITooltipProvider {
|
||||
public class BlockPlushie extends BlockContainer implements IBlockMulti, ITooltipProvider, INBTBlockTransformable {
|
||||
|
||||
public BlockPlushie() {
|
||||
super(Material.cloth);
|
||||
@ -94,17 +96,26 @@ public class BlockPlushie extends BlockContainer implements IBlockMulti, IToolti
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(world.isRemote) {
|
||||
TileEntityPlushie plushie = (TileEntityPlushie) world.getTileEntity(x, y, z);
|
||||
if(world.isRemote) {
|
||||
plushie.squishTimer = 11;
|
||||
return true;
|
||||
} else {
|
||||
if(plushie.type == PlushieType.HUNDUN) {
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:block.hunduns_magnificent_howl", 100F, 1F);
|
||||
} else {
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:block.squeakyToy", 0.25F, 1F);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static class TileEntityPlushie extends TileEntity {
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return (meta + coordBaseMode * 4) % 16;
|
||||
}
|
||||
|
||||
public static class TileEntityPlushie extends TileEntity implements INBTTileEntityTransformable {
|
||||
|
||||
public PlushieType type = PlushieType.NONE;
|
||||
public int squishTimer;
|
||||
@ -137,13 +148,19 @@ public class BlockPlushie extends BlockContainer implements IBlockMulti, IToolti
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setByte("type", (byte) type.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transformTE(World world, int coordBaseMode) {
|
||||
type = PlushieType.values()[world.rand.nextInt(PlushieType.values().length - 1) + 1];
|
||||
}
|
||||
}
|
||||
|
||||
public static enum PlushieType {
|
||||
NONE( "NONE", null),
|
||||
YOMI( "Yomi", "Hi! Can I be your rabbit friend?"),
|
||||
NUMBERNINE( "Number Nine", "None of y'all deserve coal."),
|
||||
POOH( "Winnie the Pooh", "Beloved children's character with no malicious intent.");
|
||||
HUNDUN( "Hundun", "混沌"),
|
||||
DERG( "Dragon", "Squeeze him.");
|
||||
|
||||
public String label;
|
||||
public String inscription;
|
||||
|
||||
497
src/main/java/com/hbm/blocks/generic/BlockRebar.java
Normal file
497
src/main/java/com/hbm/blocks/generic/BlockRebar.java
Normal file
@ -0,0 +1,497 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.ClientConfig;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.tool.ItemRebarPlacer;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ServerProxy;
|
||||
import com.hbm.render.block.ISBRHUniversal;
|
||||
import com.hbm.render.util.RenderBlocksNT;
|
||||
import com.hbm.tileentity.IBufPacketReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.tileentity.network.TileEntityPipeBaseNT;
|
||||
import com.hbm.uninos.GenNode;
|
||||
import com.hbm.uninos.INetworkProvider;
|
||||
import com.hbm.uninos.UniNodespace;
|
||||
import com.hbm.uninos.networkproviders.RebarNetwork;
|
||||
import com.hbm.uninos.networkproviders.RebarNetworkProvider;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.Compat;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluidmk2.IFluidReceiverMK2;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockRebar extends BlockContainer implements ISBRHUniversal {
|
||||
|
||||
@SideOnly(Side.CLIENT) protected IIcon concrete;
|
||||
|
||||
public BlockRebar() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
super.registerBlockIcons(reg);
|
||||
this.concrete = reg.registerIcon(RefStrings.MODID + ":concrete_liquid");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityRebar();
|
||||
}
|
||||
|
||||
@Override public int getRenderType() { return renderID; }
|
||||
@Override public boolean isOpaqueCube() { return false; }
|
||||
@Override public boolean renderAsNormalBlock() { return false; }
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(!(tile instanceof TileEntityRebar)) return;
|
||||
|
||||
TileEntityRebar rebar = (TileEntityRebar) tile;
|
||||
rebar.hasConnection = false;
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
TileEntity neighbor = Compat.getTileStandard(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
|
||||
if(neighbor instanceof TileEntityPipeBaseNT) {
|
||||
rebar.hasConnection = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class TileEntityRebar extends TileEntityLoadedBase implements IFluidReceiverMK2, IBufPacketReceiver {
|
||||
|
||||
public Block concrete;
|
||||
public int concreteMeta;
|
||||
public int progress;
|
||||
public int prevProgress;
|
||||
protected RebarNode node;
|
||||
public boolean hasConnection = false;
|
||||
|
||||
public TileEntityRebar setup(Block b, int m) {
|
||||
this.concrete = b;
|
||||
this.concreteMeta = m;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
long time = worldObj.getTotalWorldTime();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(prevProgress != progress) {
|
||||
worldObj.markTileEntityChunkModified(xCoord, yCoord, zCoord, this);
|
||||
prevProgress = progress;
|
||||
}
|
||||
|
||||
if(this.progress >= 1_000) {
|
||||
if(concrete != null && ItemRebarPlacer.isValidConk(Item.getItemFromBlock(concrete), concreteMeta)) {
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, concrete, concreteMeta, 3);
|
||||
} else {
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, ModBlocks.concrete_rebar);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(time % 60 == 0) {
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
this.trySubscribe(Fluids.CONCRETE, worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.node == null || this.node.expired) {
|
||||
|
||||
this.node = (RebarNode) UniNodespace.getNode(worldObj, xCoord, yCoord, zCoord, RebarNetworkProvider.THE_PROVIDER);
|
||||
|
||||
if(this.node == null || this.node.expired) {
|
||||
this.node = this.createNode();
|
||||
UniNodespace.createNode(worldObj, this.node);
|
||||
}
|
||||
}
|
||||
|
||||
this.networkPackNT(100);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if(this.node != null) {
|
||||
UniNodespace.destroyNode(worldObj, xCoord, yCoord, zCoord, RebarNetworkProvider.THE_PROVIDER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void serialize(ByteBuf buf) { buf.writeInt(progress); }
|
||||
@Override public void deserialize(ByteBuf buf) { this.progress = buf.readInt(); }
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.progress = nbt.getInteger("progress");
|
||||
this.hasConnection = nbt.getBoolean("hasConnection");
|
||||
|
||||
if(nbt.hasKey("block")) {
|
||||
this.concrete = Block.getBlockById(nbt.getInteger("block"));
|
||||
this.concreteMeta = nbt.getInteger("meta");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("progress", this.progress);
|
||||
nbt.setBoolean("hasConnection", this.hasConnection);
|
||||
|
||||
if(this.concrete != null) {
|
||||
nbt.setInteger("block", Block.getIdFromBlock(this.concrete));
|
||||
nbt.setInteger("meta", this.concreteMeta);
|
||||
}
|
||||
}
|
||||
|
||||
public RebarNode createNode() {
|
||||
TileEntity tile = (TileEntity) this;
|
||||
return new RebarNode(RebarNetworkProvider.THE_PROVIDER, new BlockPos(tile.xCoord, tile.yCoord, tile.zCoord)).setConnections(
|
||||
new DirPos(tile.xCoord + 1, tile.yCoord, tile.zCoord, Library.POS_X),
|
||||
new DirPos(tile.xCoord - 1, tile.yCoord, tile.zCoord, Library.NEG_X),
|
||||
new DirPos(tile.xCoord, tile.yCoord + 1, tile.zCoord, Library.POS_Y),
|
||||
new DirPos(tile.xCoord, tile.yCoord - 1, tile.zCoord, Library.NEG_Y),
|
||||
new DirPos(tile.xCoord, tile.yCoord, tile.zCoord + 1, Library.POS_Z),
|
||||
new DirPos(tile.xCoord, tile.yCoord, tile.zCoord - 1, Library.NEG_Z)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
FluidTank tank = new FluidTank(Fluids.CONCRETE, 1_000);
|
||||
tank.setFill(progress);
|
||||
return new FluidTank[] {tank};
|
||||
}
|
||||
|
||||
@Override
|
||||
public long transferFluid(FluidType type, int pressure, long amount) {
|
||||
if(type != Fluids.CONCRETE) return amount;
|
||||
if(this.node == null || this.node.expired || !this.node.hasValidNet()) return amount;
|
||||
|
||||
List<TileEntityRebar> lowestLinks = new ArrayList();
|
||||
int lowestY = 256;
|
||||
int progress = 0;
|
||||
int capacity = 0;
|
||||
|
||||
for(Object o : this.node.net.links) {
|
||||
RebarNode node = (RebarNode) o;
|
||||
int y = node.positions[0].getY(); //rebar can only have one pos, there's no multiblock rebar
|
||||
|
||||
if(y < lowestY) {
|
||||
lowestY = y;
|
||||
progress = 0;
|
||||
capacity = 0;
|
||||
lowestLinks.clear();
|
||||
}
|
||||
|
||||
if(y == lowestY) {
|
||||
TileEntity tile = worldObj.getTileEntity(node.positions[0].getX(), y, node.positions[0].getZ());
|
||||
if(!(tile instanceof TileEntityRebar)) continue;
|
||||
|
||||
TileEntityRebar rebar = (TileEntityRebar) tile;
|
||||
|
||||
progress += rebar.progress;
|
||||
capacity += 1_000;
|
||||
lowestLinks.add(rebar);
|
||||
}
|
||||
}
|
||||
|
||||
if(capacity > 0 && !lowestLinks.isEmpty()) {
|
||||
int maxSpeed = 50;
|
||||
int maxAccept = (int) BobMathUtil.min(capacity - progress, amount, maxSpeed * lowestLinks.size());
|
||||
int target = Math.min((progress + maxAccept) / lowestLinks.size(), 1_000);
|
||||
|
||||
for(TileEntityRebar rebar : lowestLinks) {
|
||||
if(rebar.progress >= target) continue;
|
||||
int delta = target - rebar.progress;
|
||||
if(delta > amount) continue;
|
||||
|
||||
rebar.progress += delta;
|
||||
amount -= delta;
|
||||
}
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDemand(FluidType type, int pressure) {
|
||||
return 10_000;
|
||||
}
|
||||
}
|
||||
|
||||
public static class RebarNode extends GenNode<RebarNetwork> {
|
||||
|
||||
public RebarNode(INetworkProvider<RebarNetwork> provider, BlockPos... positions) {
|
||||
super(provider, positions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RebarNode setConnections(DirPos... connections) {
|
||||
super.setConnections(connections);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int meta, int modelId, Object renderBlocks) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
RenderBlocks renderer = (RenderBlocks) renderBlocks;
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
|
||||
double o = 0.25D;
|
||||
renderer.setRenderBounds(0.4375D - o, 0D, 0.4375D - o, 0.5625D - o, 1D, 0.5625D - o); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
renderer.setRenderBounds(0.4375D - o, 0D, 0.4375D + o, 0.5625D - o, 1D, 0.5625D + o); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
renderer.setRenderBounds(0.4375D + o, 0D, 0.4375D - o, 0.5625D + o, 1D, 0.5625D - o); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
renderer.setRenderBounds(0.4375D + o, 0D, 0.4375D + o, 0.5625D + o, 1D, 0.5625D + o); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
|
||||
renderer.setRenderBounds(0D, 0.4375D - o, 0.4375D - o, 1D, 0.5625D - o, 0.5625D - o); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
renderer.setRenderBounds(0D, 0.4375D - o, 0.4375D + o, 1D, 0.5625D - o, 0.5625D + o); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
renderer.setRenderBounds(0D, 0.4375D + o, 0.4375D - o, 1D, 0.5625D + o, 0.5625D - o); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
renderer.setRenderBounds(0D, 0.4375D + o, 0.4375D + o, 1D, 0.5625D + o, 0.5625D + o); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
|
||||
renderer.setRenderBounds(0.4375D - o, 0.4375D - o, 0D, 0.5625D - o, 0.5625D - o, 1D); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
renderer.setRenderBounds(0.4375D - o, 0.4375D + o, 0D, 0.5625D - o, 0.5625D + o, 1D); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
renderer.setRenderBounds(0.4375D + o, 0.4375D - o, 0D, 0.5625D + o, 0.5625D - o, 1D); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
renderer.setRenderBounds(0.4375D + o, 0.4375D + o, 0D, 0.5625D + o, 0.5625D + o, 1D); RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, Object renderBlocks) {
|
||||
|
||||
RenderBlocksNT renderer = RenderBlocksNT.INSTANCE.setWorld(world);
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
double o = 0.25D;
|
||||
double min = -0.001;
|
||||
double max = 1.001;
|
||||
|
||||
if(ClientConfig.RENDER_REBAR_SIMPLE.get()) {
|
||||
renderer.setRenderBounds(0.4375D, min, 0.4375D, 0.5625D, max, 0.5625D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(min, 0.4375D, 0.4375D, max, 0.5625D, 0.5625D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.4375D, 0.4375D, min, 0.5625D, 0.5625D, max); renderer.renderStandardBlock(block, x, y, z);
|
||||
} else {
|
||||
renderer.setRenderBounds(0.4375D - o, min, 0.4375D - o, 0.5625D - o, max, 0.5625D - o); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.4375D - o, min, 0.4375D + o, 0.5625D - o, max, 0.5625D + o); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.4375D + o, min, 0.4375D - o, 0.5625D + o, max, 0.5625D - o); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.4375D + o, min, 0.4375D + o, 0.5625D + o, max, 0.5625D + o); renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
renderer.setRenderBounds(min, 0.4375D - o, 0.4375D - o, max, 0.5625D - o, 0.5625D - o); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(min, 0.4375D - o, 0.4375D + o, max, 0.5625D - o, 0.5625D + o); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(min, 0.4375D + o, 0.4375D - o, max, 0.5625D + o, 0.5625D - o); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(min, 0.4375D + o, 0.4375D + o, max, 0.5625D + o, 0.5625D + o); renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
renderer.setRenderBounds(0.4375D - o, 0.4375D - o, min, 0.5625D - o, 0.5625D - o, max); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.4375D - o, 0.4375D + o, min, 0.5625D - o, 0.5625D + o, max); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.4375D + o, 0.4375D - o, min, 0.5625D + o, 0.5625D - o, max); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.4375D + o, 0.4375D + o, min, 0.5625D + o, 0.5625D + o, max); renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
/*TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(tile instanceof TileEntityRebar) {
|
||||
TileEntityRebar rebar = (TileEntityRebar) tile;
|
||||
if(rebar.progress > 0) {
|
||||
double height = rebar.progress / 1000D;
|
||||
renderer.setOverrideBlockTexture(concrete);
|
||||
renderer.setRenderBounds(0, 0, 0, 1, height, 1); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.clearOverrideBlockTexture();
|
||||
}
|
||||
}*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// from ModEventHandlerClient.onRenderWorldLastEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void renderRebar(List tiles, float interp) {
|
||||
|
||||
List<TileEntityRebar> rebars = new ArrayList();
|
||||
for(Object o : tiles) {
|
||||
if(!(o instanceof TileEntityRebar)) continue;
|
||||
TileEntityRebar rebar = (TileEntityRebar) o;
|
||||
if(rebar.progress > 0) rebars.add(rebar);
|
||||
if(rebars.size() >= ClientConfig.RENDER_REBAR_LIMIT.get()) break;
|
||||
}
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
World world = mc.theWorld;
|
||||
|
||||
double dx = player.prevPosX + (player.posX - player.prevPosX) * interp;
|
||||
double dy = player.prevPosY + (player.posY - player.prevPosY) * interp;
|
||||
double dz = player.prevPosZ + (player.posZ - player.prevPosZ) * interp;
|
||||
|
||||
if(!rebars.isEmpty()) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
//RenderHelper.enableStandardItemLighting();
|
||||
|
||||
EntityRenderer entityRenderer = mc.entityRenderer;
|
||||
entityRenderer.enableLightmap(interp);
|
||||
|
||||
RenderBlocksNT renderer = RenderBlocksNT.INSTANCE.setWorld(world);
|
||||
renderer.setOverrideBlockTexture(((BlockRebar) ModBlocks.rebar).concrete);
|
||||
mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
|
||||
for(TileEntityRebar rebar : rebars) {
|
||||
tess.setTranslation(-dx, -dy, -dz);
|
||||
tess.setColorRGBA_F(1F, 1F, 1F, 1F);
|
||||
renderer.setRenderBounds(0, 0, 0, 1, rebar.progress / 1000D, 1);
|
||||
renderer.renderStandardBlock(ModBlocks.rebar, rebar.xCoord, rebar.yCoord, rebar.zCoord);
|
||||
}
|
||||
|
||||
tess.draw();
|
||||
tess.setTranslation(0, 0, 0);
|
||||
renderer.clearOverrideBlockTexture();
|
||||
entityRenderer.disableLightmap(interp);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.rebar_placer && player.getHeldItem().hasTagCompound() &&
|
||||
player.getHeldItem().stackTagCompound.hasKey("pos") && mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectType.BLOCK) {
|
||||
|
||||
int[] pos = player.getHeldItem().stackTagCompound.getIntArray("pos");
|
||||
MovingObjectPosition mop = mc.objectMouseOver;
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(mop.sideHit);
|
||||
int iX = mop.blockX + dir.offsetX;
|
||||
int iY = mop.blockY + dir.offsetY;
|
||||
int iZ = mop.blockZ + dir.offsetZ;
|
||||
|
||||
double minX = Math.min(pos[0], iX) + 0.125;
|
||||
double maxX = Math.max(pos[0], iX) + 0.875;
|
||||
double minY = Math.min(pos[1], iY) + 0.125;
|
||||
double maxY = Math.max(pos[1], iY) + 0.875;
|
||||
double minZ = Math.min(pos[2], iZ) + 0.125;
|
||||
double maxZ = Math.max(pos[2], iZ) + 0.875;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.setTranslation(-dx, -dy, -dz);
|
||||
tess.startDrawing(GL11.GL_LINES);
|
||||
tess.setBrightness(240);
|
||||
tess.setColorRGBA_F(1F, 1F, 1F, 1F);
|
||||
|
||||
// top
|
||||
tess.addVertex(minX, maxY, minZ);
|
||||
tess.addVertex(minX, maxY, maxZ);
|
||||
|
||||
tess.addVertex(minX, maxY, maxZ);
|
||||
tess.addVertex(maxX, maxY, maxZ);
|
||||
|
||||
tess.addVertex(maxX, maxY, maxZ);
|
||||
tess.addVertex(maxX, maxY, minZ);
|
||||
|
||||
tess.addVertex(maxX, maxY, minZ);
|
||||
tess.addVertex(minX, maxY, minZ);
|
||||
|
||||
// bottom
|
||||
tess.addVertex(minX, minY, minZ);
|
||||
tess.addVertex(minX, minY, maxZ);
|
||||
|
||||
tess.addVertex(minX, minY, maxZ);
|
||||
tess.addVertex(maxX, minY, maxZ);
|
||||
|
||||
tess.addVertex(maxX, minY, maxZ);
|
||||
tess.addVertex(maxX, minY, minZ);
|
||||
|
||||
tess.addVertex(maxX, minY, minZ);
|
||||
tess.addVertex(minX, minY, minZ);
|
||||
|
||||
// sides
|
||||
tess.addVertex(minX, minY, minZ);
|
||||
tess.addVertex(minX, maxY, minZ);
|
||||
|
||||
tess.addVertex(maxX, minY, minZ);
|
||||
tess.addVertex(maxX, maxY, minZ);
|
||||
|
||||
tess.addVertex(maxX, minY, maxZ);
|
||||
tess.addVertex(maxX, maxY, maxZ);
|
||||
|
||||
tess.addVertex(minX, minY, maxZ);
|
||||
tess.addVertex(minX, maxY, maxZ);
|
||||
|
||||
tess.draw();
|
||||
tess.setTranslation(0, 0, 0);
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
int rebarLeft = InventoryUtil.countAStackMatches(player, new ComparableStack(ModBlocks.rebar), true);
|
||||
int rebarRequired = (Math.max(pos[0], iX) - Math.min(pos[0], iX) + 1) * (Math.max(pos[1], iY) - Math.min(pos[1], iY) + 1) * (Math.max(pos[2], iZ) - Math.min(pos[2], iZ) + 1);
|
||||
MainRegistry.proxy.displayTooltip((rebarRequired > rebarLeft ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + (rebarLeft + " / " + rebarRequired), 1_000, ServerProxy.ID_CABLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -11,6 +11,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
@ -66,7 +67,7 @@ public class BlockReeds extends Block {
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
return null;
|
||||
return Items.stick;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
84
src/main/java/com/hbm/blocks/generic/BlockSandbags.java
Normal file
84
src/main/java/com/hbm/blocks/generic/BlockSandbags.java
Normal file
@ -0,0 +1,84 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.render.block.ISBRHUniversal;
|
||||
import com.hbm.render.util.RenderBlocksNT;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockSandbags extends Block implements ISBRHUniversal {
|
||||
|
||||
public BlockSandbags(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override public int getRenderType() { return renderID; }
|
||||
@Override public boolean isOpaqueCube() { return false; }
|
||||
@Override public boolean renderAsNormalBlock() { return false; }
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
|
||||
float min = 0.25F;
|
||||
float max = 0.75F;
|
||||
|
||||
Block nx = world.getBlock(x - 1, y, z);
|
||||
Block px = world.getBlock(x + 1, y, z);
|
||||
Block nz = world.getBlock(x, y, z - 1);
|
||||
Block pz = world.getBlock(x, y, z + 1);
|
||||
|
||||
float minX = (nx.isOpaqueCube() || nx.isNormalCube() || nx == this) ? 0F : min;
|
||||
float minZ = (nz.isOpaqueCube() || nz.isNormalCube() || nz == this) ? 0F : min;
|
||||
float maxX = (px.isOpaqueCube() || px.isNormalCube() || px == this) ? 1F : max;
|
||||
float maxZ = (pz.isOpaqueCube() || pz.isNormalCube() || pz == this) ? 1F : max;
|
||||
|
||||
this.setBlockBounds(minX, 0, minZ, maxX, 1, maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int meta, int modelId, Object renderBlocks) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
RenderBlocks renderer = (RenderBlocks) renderBlocks;
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
renderer.setRenderBounds(0.125D, 0D, 0.125D, 0.875D, 1D, 0.875D);
|
||||
RenderBlocksNT.renderStandardInventoryBlock(block, meta, renderer);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, Object renderBlocks) {
|
||||
|
||||
RenderBlocksNT renderer = RenderBlocksNT.INSTANCE.setWorld(world);
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
115
src/main/java/com/hbm/blocks/generic/BlockSkeletonHolder.java
Normal file
115
src/main/java/com/hbm/blocks/generic/BlockSkeletonHolder.java
Normal file
@ -0,0 +1,115 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockSkeletonHolder extends BlockContainer {
|
||||
|
||||
public BlockSkeletonHolder() {
|
||||
super(Material.rock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntitySkeletonHolder();
|
||||
}
|
||||
|
||||
@Override public int getRenderType() { return -1; }
|
||||
@Override public boolean isOpaqueCube() { return false; }
|
||||
@Override public boolean renderAsNormalBlock() { return false; }
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
} //I hope you change this shit to not be hardcoded because im not doing it
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(player.isSneaking()) return false;
|
||||
|
||||
TileEntitySkeletonHolder pedestal = (TileEntitySkeletonHolder) world.getTileEntity(x, y, z);
|
||||
|
||||
if(pedestal.item == null && player.getHeldItem() != null) {
|
||||
if(world.isRemote) return true;
|
||||
pedestal.item = player.getHeldItem().copy();
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = null;
|
||||
pedestal.markDirty();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
} else if(pedestal.item != null && player.getHeldItem() == null) {
|
||||
if(world.isRemote) return true;
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = pedestal.item.copy();
|
||||
pedestal.item = null;
|
||||
pedestal.markDirty();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
TileEntitySkeletonHolder entity = (TileEntitySkeletonHolder) world.getTileEntity(x, y, z);
|
||||
if(entity != null && entity.item != null) {
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y, z + 0.5, entity.item.copy());
|
||||
world.spawnEntityInWorld(item);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
public static class TileEntitySkeletonHolder extends TileEntity {
|
||||
|
||||
public ItemStack item;
|
||||
|
||||
@Override public boolean canUpdate() { return false; }
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
this.writeToNBT(nbt);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
this.readFromNBT(pkt.func_148857_g());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.item = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("item"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
if(this.item != null) {
|
||||
NBTTagCompound stack = new NBTTagCompound();
|
||||
this.item.writeToNBT(stack);
|
||||
nbt.setTag("item", stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user