Compare commits
1041 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4b2caf33d3 | |||
|
|
7b77b268bf | ||
|
|
910f991734 | ||
|
|
a55fdbfd0f | ||
|
|
0dd1f1b293 | ||
|
|
dc7a19c2f3 | ||
|
|
04ec4b3d2d | ||
|
|
68ff8f6921 | ||
|
|
499c7d91d8 | ||
|
|
7c7129914a | ||
|
|
60bc8090f2 | ||
|
|
20db828ac0 | ||
|
|
12a2a8eb0d | ||
|
|
e793493331 | ||
|
|
7f99801e1b | ||
|
|
8544aa17ee | ||
|
|
b20a0a74d2 | ||
|
|
fb1713ae0e | ||
|
|
eff7abcbbc | ||
|
|
2c7435585d | ||
|
|
349f162a7c | ||
|
|
107aa4b7f2 | ||
|
|
1bf1f4f78c | ||
|
|
29c8a09218 | ||
|
|
71e7fdaafc | ||
|
|
1f59dc17d9 | ||
|
|
79bd5102ba | ||
|
|
b197237dfd | ||
|
|
85ff28298e | ||
|
|
782c6d5e50 | ||
|
|
c00c65eeee | ||
|
|
c22479c0e8 | ||
|
|
8da0339c78 | ||
|
|
83998969f6 | ||
|
|
c4abae8fdd | ||
|
|
1106319f8c | ||
|
|
2904ec146d | ||
|
|
7d840ff895 | ||
|
|
52bae00dc6 | ||
|
|
dc55359aaf | ||
|
|
58d5f6dd14 | ||
|
|
b40141f99d | ||
|
|
06cf72f9f7 | ||
|
|
100fa38c52 | ||
|
|
17a770eaf0 | ||
|
|
16f0a8303a | ||
|
|
1e3b32a15c | ||
|
|
4d53ae5f6a | ||
|
|
d3860119e9 | ||
|
|
f64768ed16 | ||
|
|
c1e58c25cc | ||
|
|
805e9dd040 | ||
|
|
972a67de76 | ||
|
|
592aabf627 | ||
|
|
b4a58f5c88 | ||
|
|
80bb87dac6 | ||
|
|
c5a77268fc | ||
|
|
262595ff4d | ||
|
|
c29db9b729 | ||
|
|
689df1ad6d | ||
|
|
ec290b0dc1 | ||
|
|
3d88e72ecb | ||
|
|
b2e086e7c1 | ||
|
|
e3665c09dd | ||
|
|
fb4643d7cf | ||
|
|
5ba58dc91b | ||
|
|
dea76b1a7e | ||
|
|
42568a1864 | ||
|
|
e40168954f | ||
|
|
59f335ac8c | ||
|
|
444b862b12 | ||
|
|
a0629b51a3 | ||
|
|
364ba11f81 | ||
|
|
96238d6b53 | ||
|
|
448890207f | ||
|
|
46f55b22d9 | ||
|
|
9baceb8e3c | ||
|
|
fe035f6677 | ||
|
|
4192270ef3 | ||
|
|
0029d9dac0 | ||
|
|
eff8379325 | ||
|
|
96d84ed2fa | ||
|
|
0f3d40ba60 | ||
|
|
794310bd98 | ||
|
|
a4d0f39390 | ||
|
|
e4e84644ac | ||
|
|
660ff4255e | ||
|
|
1410d4b251 | ||
|
|
161da193ad | ||
|
|
4d39d13703 | ||
|
|
18666f58b1 | ||
|
|
9e720cb458 | ||
|
|
968653e4ab | ||
|
|
eeb5f9aea1 | ||
|
|
117ed69bf7 | ||
|
|
0d53f6c029 | ||
|
|
dccb12116d | ||
|
|
e8fa928c50 | ||
|
|
f9331e4f2d | ||
|
|
7da3b7fc62 | ||
|
|
77241e6f90 | ||
|
|
844950b39e | ||
|
|
16d7bfcda6 | ||
|
|
d8fecd07b3 | ||
|
|
86cfcdeee8 | ||
|
|
3f6e32dcbf | ||
|
|
3fcc55b5e1 | ||
|
|
ef860e295e | ||
|
|
8f9dfea947 | ||
|
|
ac9b3d73e8 | ||
|
|
8d1028ccb5 | ||
|
|
d020dd384b | ||
|
|
8562456203 | ||
|
|
af77f8b2dc | ||
|
|
3a2c87cce9 | ||
|
|
03ab75b80c | ||
|
|
f4efa7dca2 | ||
|
|
79edf1004b | ||
|
|
aab818d948 | ||
|
|
68f2654000 | ||
|
|
f427e66f6e | ||
|
|
472704fe51 | ||
|
|
928adab4cf | ||
|
|
ef2e9cc561 | ||
|
|
7cabf75128 | ||
|
|
9003d924ea | ||
|
|
b15a8af299 | ||
|
|
19be17fa44 | ||
|
|
871d2ff1c2 | ||
|
|
3664e707cf | ||
|
|
be7cd9d186 | ||
|
|
d86433ef46 | ||
|
|
0da8247f61 | ||
|
|
642db248c3 | ||
|
|
ffe45c729e | ||
|
|
ae4dbb24e4 | ||
|
|
4dca0eb82b | ||
|
|
9ecfb686aa | ||
|
|
a2ef6ef905 | ||
|
|
d192dae945 | ||
|
|
18460348af | ||
|
|
56e522a61a | ||
|
|
d98b6279de | ||
|
|
99476f8d70 | ||
|
|
aa7ee3c8fe | ||
|
|
41fbcfe0ff | ||
|
|
582db26cdc | ||
|
|
92875c754d | ||
|
|
71fccfc1e4 | ||
|
|
0491b55f40 | ||
|
|
cc2def03fd | ||
|
|
41b77c639c | ||
|
|
1de34d1c2d | ||
|
|
19bc9eec99 | ||
|
|
248ac1ecf4 | ||
|
|
35c5943faf | ||
|
|
f682ba6a2b | ||
|
|
3a292d7eac | ||
|
|
9914666639 | ||
|
|
76e9fce9d4 | ||
|
|
42f0656b1b | ||
|
|
12e0fee70a | ||
|
|
d6b07db3d6 | ||
|
|
e5adb43f77 | ||
|
|
da579bc23d | ||
|
|
bf2f5da672 | ||
|
|
687bb73fae | ||
|
|
7258ffa7dc | ||
|
|
8ebaa0f493 | ||
|
|
5c44ddefe9 | ||
|
|
4fecf092a3 | ||
|
|
ac8874f96a | ||
|
|
484a44a063 | ||
|
|
ddcb0ff42e | ||
|
|
3d8a9aaf27 | ||
|
|
300228ea24 | ||
|
|
c980c797e8 | ||
|
|
b1b1035b5f | ||
|
|
f8982a871d | ||
|
|
a92b07d976 | ||
|
|
f4b619635e | ||
|
|
3966f420db | ||
|
|
151f1a93a5 | ||
|
|
1e5e8dcf2b | ||
|
|
188ec6d68b | ||
|
|
cfd48e796a | ||
|
|
84eee1b155 | ||
|
|
4f2f86535b | ||
|
|
d06ca4843c | ||
|
|
d1a2476a4e | ||
|
|
befef486c6 | ||
|
|
7e8fe10c7d | ||
|
|
cc46d90ed4 | ||
|
|
7a043dfa65 | ||
|
|
941cecb372 | ||
|
|
01fe9cc87e | ||
|
|
f40e1e0a91 | ||
|
|
f1eff42a33 | ||
|
|
3a91d9a6ec | ||
|
|
8d28dc1517 | ||
|
|
5db2b35850 | ||
|
|
73cb5ccb6c | ||
|
|
836eb8a7e0 | ||
|
|
946ac37a27 | ||
|
|
b393c763a9 | ||
|
|
3b9b839b7d | ||
|
|
7b4d1cc2f1 | ||
|
|
576ac0aae2 | ||
|
|
ee72f3248e | ||
|
|
db91dfce5a | ||
|
|
b68de9eabd | ||
|
|
89baf624eb | ||
|
|
baa5555547 | ||
|
|
60c2cc4710 | ||
|
|
6f3d03b660 | ||
|
|
c2ffc36b75 | ||
|
|
b2dfb35a72 | ||
|
|
62bd3bd19e | ||
|
|
a8e37da4bc | ||
|
|
05378f41e2 | ||
|
|
bbd0b1d0fe | ||
|
|
9bba789f0b | ||
|
|
43ff30f3f5 | ||
|
|
f01222afee | ||
|
|
87452e783c | ||
|
|
196e79f437 | ||
|
|
4ec84f9b86 | ||
|
|
aea1a9a7c5 | ||
|
|
6152f39791 | ||
|
|
88656f5ad4 | ||
|
|
cd7cf4e7ca | ||
|
|
8cb651030a | ||
|
|
310efb9781 | ||
|
|
0b14dbf453 | ||
|
|
06bb624cd0 | ||
|
|
175fa41318 | ||
|
|
93f2f6c701 | ||
|
|
47f7e280a7 | ||
|
|
6a5fff3b5a | ||
|
|
a920a7d65b | ||
|
|
4889b94b8b | ||
|
|
7e964adb7a | ||
|
|
afcf62b95b | ||
|
|
09010f9fef | ||
|
|
55a8719748 | ||
|
|
bc6b323b57 | ||
|
|
78d7db0f75 | ||
|
|
1dc7ee7a29 | ||
|
|
18c11ee24e | ||
|
|
ac7dbab39f | ||
|
|
d725ce6b5e | ||
|
|
c935156b71 | ||
|
|
ca42be0a5e | ||
|
|
c830a8e812 | ||
|
|
792979d4f1 | ||
|
|
523025365a | ||
|
|
d52f0ed2c7 | ||
|
|
7700d72a99 | ||
|
|
415a3c29d7 | ||
|
|
1705182c67 | ||
|
|
d921982c75 | ||
|
|
12225d8214 | ||
|
|
4271d47d9d | ||
|
|
b105d002c5 | ||
|
|
a13fc069eb | ||
|
|
f36767b07b | ||
|
|
d8038a7165 | ||
|
|
149e0319f1 | ||
|
|
dd30dc619c | ||
|
|
30d789518d | ||
|
|
bc3438d995 | ||
|
|
f6a6b1d374 | ||
|
|
3079e546a1 | ||
|
|
d6dd9349f9 | ||
|
|
8d372fadff | ||
|
|
ffa033496d | ||
|
|
4e85dbec7e | ||
|
|
70795b6475 | ||
|
|
1971b97dc4 | ||
|
|
ce0d4f9bf9 | ||
|
|
f31eb5a2ef | ||
|
|
47f9048d44 | ||
|
|
876e3eb4e6 | ||
|
|
5d80170b52 | ||
|
|
26c8581857 | ||
|
|
fba4a1195a | ||
|
|
465449abf2 | ||
|
|
8cba2d9f6c | ||
|
|
ced9543f11 | ||
|
|
ed77f096c2 | ||
|
|
357db5e34d | ||
|
|
fba62d7ab5 | ||
|
|
7a30151a8c | ||
|
|
6bf70aebdb | ||
|
|
ed92dc04dc | ||
|
|
f02cffb925 | ||
|
|
9350c97533 | ||
|
|
3ea8db6bf8 | ||
|
|
f061b072fd | ||
|
|
c68d9635d3 | ||
|
|
b947154b2d | ||
|
|
b788458c4f | ||
|
|
238661158e | ||
|
|
81386a08e5 | ||
|
|
ad1f928db0 | ||
|
|
1d44bf2983 | ||
|
|
b31cf9abd6 | ||
|
|
30a9dcf2c7 | ||
|
|
9fe071368e | ||
|
|
ee1db9aa99 | ||
|
|
3b557aa88b | ||
|
|
e469d2f7dc | ||
|
|
026c0b4331 | ||
|
|
2ea7fe731b | ||
|
|
8b108688f1 | ||
|
|
439c13cc9f | ||
|
|
9aa9651a6d | ||
|
|
3026432895 | ||
|
|
ea2be9b803 | ||
|
|
37a10e5795 | ||
|
|
15cfe6fc33 | ||
|
|
80d828c252 | ||
|
|
0fcf02e75f | ||
|
|
21267309a1 | ||
|
|
0e4e36c454 | ||
|
|
8416d650b1 | ||
|
|
5df79bb206 | ||
|
|
75db61e951 | ||
|
|
1b2a119aa7 | ||
|
|
76f515e207 | ||
|
|
e45f9c389f | ||
|
|
a1a5c0908a | ||
|
|
9f00345065 | ||
|
|
5f7d4ce971 | ||
|
|
7dadef953d | ||
|
|
1104961c54 | ||
|
|
73e3753d3b | ||
|
|
ad92b1c2c4 | ||
|
|
997e5ffda7 | ||
|
|
3369352143 | ||
|
|
e6090d1a5f | ||
|
|
d479f40993 | ||
|
|
6a0cf4706a | ||
|
|
a8c3dfb524 | ||
|
|
39f6d297cd | ||
|
|
25f446a05b | ||
|
|
a5e5ea3921 | ||
|
|
ab17a959bb | ||
|
|
cdc93317dd | ||
|
|
1211644f55 | ||
|
|
ff24ce4de6 | ||
|
|
92801f1346 | ||
|
|
7ebc4e6ead | ||
|
|
7aeaa46a47 | ||
|
|
714120f96a | ||
|
|
ab5ce1e652 | ||
|
|
394f92d5fc | ||
|
|
4ebae55b17 | ||
|
|
c0dec4caa3 | ||
|
|
d0aadd0eea | ||
|
|
e3f22ee4df | ||
|
|
7d3c429c96 | ||
|
|
d71e28bbcd | ||
|
|
72bf14cc70 | ||
|
|
e5da1754c5 | ||
|
|
2f8292faab | ||
|
|
63879b1851 | ||
|
|
f779915279 | ||
|
|
ed65a75e99 | ||
|
|
5e60960661 | ||
|
|
3e33b94c98 | ||
|
|
70ae2fd407 | ||
|
|
3574b0468b | ||
|
|
7afcfedbde | ||
|
|
27b21f6674 | ||
|
|
d2da74ea76 | ||
|
|
3eaf6cdfb8 | ||
|
|
cee4005513 | ||
|
|
22ab4e3639 | ||
|
|
cd432c532f | ||
|
|
31f0c1ca0c | ||
|
|
81bac5d1c2 | ||
|
|
28cb2e5e74 | ||
|
|
a9f0bc5069 | ||
|
|
a0d0f6e19b | ||
|
|
82da53b992 | ||
|
|
820e72f17a | ||
|
|
180720c04b | ||
|
|
8a7761aa7c | ||
|
|
cf8be344c9 | ||
|
|
ef367847da | ||
|
|
3924d6d1d6 | ||
|
|
56d40aec1f | ||
|
|
9a0ee7c210 | ||
|
|
d45a257edc | ||
|
|
2355c92102 | ||
|
|
c3b3db4ca0 | ||
|
|
72196c6afd | ||
|
|
65ed1de6ee | ||
|
|
6d2c645ce9 | ||
|
|
06d2dcaa74 | ||
|
|
6d64a54b75 | ||
|
|
399bb0ea9e | ||
|
|
b929724781 | ||
|
|
b6669183bc | ||
|
|
82a17a2981 | ||
|
|
f40f42298f | ||
|
|
e7dcc20fad | ||
|
|
cfb370ad1f | ||
|
|
a6048c6c29 | ||
|
|
b3349ac3e3 | ||
|
|
9bd9cfb700 | ||
|
|
4e0b7fa977 | ||
|
|
f88c314922 | ||
|
|
9f2d1b1109 | ||
|
|
2cc0b7e2ca | ||
|
|
75e103aa65 | ||
|
|
833e5d4e1c | ||
|
|
13458029b4 | ||
|
|
51bd96dbe4 | ||
|
|
3e7ffe0d79 | ||
|
|
2ec43fc7d0 | ||
|
|
b83a766695 | ||
|
|
8d19d71d8a | ||
|
|
f28f071095 | ||
|
|
a8baba9430 | ||
|
|
6eedb45ded | ||
|
|
31fc929170 | ||
|
|
505b182af9 | ||
|
|
602b55111f | ||
|
|
fd01d4e198 | ||
|
|
1931f7988c | ||
|
|
81cc7053de | ||
|
|
d9609ea60b | ||
|
|
1205e85861 | ||
|
|
1e6a4a8b4a | ||
|
|
7dc51a8e56 | ||
|
|
2388be2681 | ||
|
|
e825cb74b9 | ||
|
|
7687a77332 | ||
|
|
b818038fd6 | ||
|
|
b18fe877de | ||
|
|
8fbb41a588 | ||
|
|
a1628ff341 | ||
|
|
8dd1d85e6e | ||
|
|
9b6aefa6ad | ||
|
|
9907ce1ce8 | ||
|
|
c48e2307c7 | ||
|
|
c2bab6cc93 | ||
|
|
db9f422824 | ||
|
|
4486ef62fe | ||
|
|
51f7e10834 | ||
|
|
5cd5a323e0 | ||
|
|
20ea00a0a7 | ||
|
|
841fcffcb1 | ||
|
|
0f49c8c28f | ||
|
|
da608462d7 | ||
|
|
6b3b2d6471 | ||
|
|
bb7cd95dcc | ||
|
|
f2f1ee7af9 | ||
|
|
4a6d166ba5 | ||
|
|
51ee6d9c5e | ||
|
|
bef91e2ce6 | ||
|
|
7769a6e6a5 | ||
|
|
4cfd5475de | ||
|
|
b4e0d53509 | ||
|
|
d849071e8e | ||
|
|
52fcfdaf49 | ||
|
|
e4ee4a3cee | ||
|
|
a3b38a2c05 | ||
|
|
e271dd2fda | ||
|
|
59489f290f | ||
|
|
e3df3cad08 | ||
|
|
d4fc43482d | ||
|
|
7d13c3afc0 | ||
|
|
a3a6c80fe5 | ||
|
|
c39e2b34ab | ||
|
|
6383c4f5ff | ||
|
|
a04a266c17 | ||
|
|
df79aafd14 | ||
|
|
1bfc3f2eea | ||
|
|
a204cbd04e | ||
|
|
a0224e8f14 | ||
|
|
5873d20f91 | ||
|
|
58842048d4 | ||
|
|
69809df4c3 | ||
|
|
b1503be63e | ||
|
|
cbfb64622e | ||
|
|
2f7b713f5e | ||
|
|
9418ed59df | ||
|
|
3376c1d772 | ||
|
|
c08fa15f40 | ||
|
|
2f98bf91e8 | ||
|
|
3e74f60807 | ||
|
|
be89913263 | ||
|
|
7a36e78769 | ||
|
|
5bfd40f2b2 | ||
|
|
b0c7c03fc6 | ||
|
|
9420b8edf2 | ||
|
|
b9bd42a345 | ||
|
|
66ad5a798f | ||
|
|
e421987338 | ||
|
|
69864ea9ad | ||
|
|
eef5117c04 | ||
|
|
d046bd88ea | ||
|
|
ca07a38eff | ||
|
|
491dc3b615 | ||
|
|
ee35c365e2 | ||
|
|
e859d2c12e | ||
|
|
76e564486d | ||
|
|
0484040e26 | ||
|
|
94bbc2d658 | ||
|
|
2203239c81 | ||
|
|
f47a9d8b99 | ||
|
|
25446453cb | ||
|
|
b5973f58eb | ||
|
|
a92cd2fba7 | ||
|
|
c2fa4964f8 | ||
|
|
670b9a2902 | ||
|
|
1d3038288b | ||
|
|
6f905050f2 | ||
|
|
78785047af | ||
|
|
b73e79e5c2 | ||
|
|
08b36054ce | ||
|
|
687e66e23f | ||
|
|
52aa836f75 | ||
|
|
b9edf3326d | ||
|
|
79349e9add | ||
|
|
678b5dac73 | ||
|
|
46fc5a34f2 | ||
|
|
9d42565452 | ||
|
|
17450dff60 | ||
|
|
51e396aa6b | ||
|
|
a368d85b54 | ||
|
|
498e087d0a | ||
|
|
027b329af8 | ||
|
|
2d085f60b8 | ||
|
|
a50650848c | ||
|
|
7dbc6896b1 | ||
|
|
9fec41f906 | ||
|
|
156c61a772 | ||
|
|
fc6dd63573 | ||
|
|
4501e9373f | ||
|
|
de5ef3b85f | ||
|
|
37b0510676 | ||
|
|
72213de437 | ||
|
|
672c19b032 | ||
|
|
44b39be7b7 | ||
|
|
8dc47e8bef | ||
|
|
f83841a142 | ||
|
|
7280b54c47 | ||
|
|
fb59a3dacb | ||
|
|
b5d4df8f6a | ||
|
|
703ec03d29 | ||
|
|
a0f9dfff4a | ||
|
|
665bcb3a0b | ||
|
|
3a63f8965b | ||
|
|
87343b45ee | ||
|
|
1d1d0a767c | ||
|
|
921b6e88af | ||
|
|
fd4b9b5086 | ||
|
|
07a5e2a64d | ||
|
|
06c90572f1 | ||
|
|
25d3931210 | ||
|
|
26d4287b49 | ||
|
|
2ce8dbff7b | ||
|
|
ac8c13f81c | ||
|
|
bac3caa5cc | ||
|
|
a0454351d5 | ||
|
|
f2ff5f79cc | ||
|
|
c57b001fe2 | ||
|
|
9587f914c2 | ||
|
|
cff13e9bb5 | ||
|
|
6512327ee8 | ||
|
|
23efc90765 | ||
|
|
b795c411be | ||
|
|
03660699cf | ||
|
|
3ce380ad5e | ||
|
|
1dfa5817bf | ||
|
|
64cc95f92b | ||
|
|
a82c7ce4c2 | ||
|
|
1138f6733e | ||
|
|
22b7ed147a | ||
|
|
6a816bbca7 | ||
|
|
b4cb8f8610 | ||
|
|
ebb92f8f84 | ||
|
|
e8e0cdf8ad | ||
|
|
fa33fa95c8 | ||
|
|
8d5a3ac72e | ||
|
|
70eb276086 | ||
|
|
b3847a62b7 | ||
|
|
4f093751ee | ||
|
|
b9fcfea877 | ||
|
|
fb25fc43eb | ||
|
|
f9092f3b5a | ||
|
|
549ee54852 | ||
|
|
1a50aa2290 | ||
|
|
8bfe9dc22e | ||
|
|
77bc0e833f | ||
|
|
4cd7d3c0ae | ||
|
|
3568d223ff | ||
|
|
307d2258d1 | ||
|
|
56ecb0cd9e | ||
|
|
af7bb05042 | ||
|
|
9c8a404a14 | ||
|
|
0bd7ef9593 | ||
|
|
62fed83e2f | ||
|
|
efa5b3eb4c | ||
|
|
4086e75ead | ||
|
|
b795885f1c | ||
|
|
4f3ab403d3 | ||
|
|
1cc1c374f6 | ||
|
|
ea1fc5f4c0 | ||
|
|
4b5870339b | ||
|
|
f34b06b834 | ||
|
|
d9056e551f | ||
|
|
5cabd3762e | ||
|
|
9930068775 | ||
|
|
8e8346864e | ||
|
|
42098e50b6 | ||
|
|
c17583820c | ||
|
|
934dcfde3d | ||
|
|
050bdd1090 | ||
|
|
30b8e98ad8 | ||
|
|
928b7d4cba | ||
|
|
02b96c0c05 | ||
|
|
dd9b1f0c65 | ||
|
|
a1a9e39caa | ||
|
|
3e3bd95844 | ||
|
|
2b1d80f9f9 | ||
|
|
db3351441d | ||
|
|
643785022a | ||
|
|
45d61e3aa2 | ||
|
|
35e97b03e2 | ||
|
|
eaab6d6b83 | ||
|
|
879f3a1eaf | ||
|
|
ddf94334e0 | ||
|
|
758f5e5062 | ||
|
|
ef661bf103 | ||
|
|
db98086096 | ||
|
|
939ed771a8 | ||
|
|
c7ddff97b2 | ||
|
|
f1bfac3e16 | ||
|
|
0e67596ca0 | ||
|
|
2e833b55c3 | ||
|
|
74c1bc4cf4 | ||
|
|
69e32aa1fb | ||
|
|
d9a9091a2b | ||
|
|
8c0c89c79e | ||
|
|
99d9b5a2a1 | ||
|
|
4487168b0b | ||
|
|
4d1503db3f | ||
|
|
acab06115a | ||
|
|
0deb4b8917 | ||
|
|
740ba51a04 | ||
|
|
40310688ed | ||
|
|
e0fcb9d450 | ||
|
|
2d6194d599 | ||
|
|
40ae8a06bd | ||
|
|
caf33bd866 | ||
|
|
dc7289a048 | ||
|
|
7537d6cd7a | ||
|
|
6b69d3d138 | ||
|
|
68bf4a16c1 | ||
|
|
57b6a5efb2 | ||
|
|
0f3853c651 | ||
|
|
f372b9ccb5 | ||
|
|
1575f5139c | ||
|
|
35329f9024 | ||
|
|
101e9e4ce6 | ||
|
|
e96fc02747 | ||
|
|
3968255094 | ||
|
|
2dfabccaa9 | ||
|
|
b7327b2bf6 | ||
|
|
82c6e214b0 | ||
|
|
3ef7630f2c | ||
|
|
3d04e9b9cc | ||
|
|
84872acb97 | ||
|
|
81bac7b7ff | ||
|
|
62b1629a8a | ||
|
|
350b2e2e2c | ||
|
|
7b315149ed | ||
|
|
b050c6c61b | ||
|
|
0c7da8a54c | ||
|
|
4e67a3faf6 | ||
|
|
8817653ce8 | ||
|
|
1dd9d802b0 | ||
|
|
03163de4dd | ||
|
|
43162a6fce | ||
|
|
15b9d65f9f | ||
|
|
75fc063962 | ||
|
|
a081419855 | ||
|
|
5baf0ed6ef | ||
|
|
0b9f8fa5d5 | ||
|
|
a174ad4b29 | ||
|
|
5ddf2c636f | ||
|
|
deb5f1a6db | ||
|
|
f0c1d2b700 | ||
|
|
89e2f4d8b6 | ||
|
|
b278af0c23 | ||
|
|
7190a4ac6d | ||
|
|
c83d622ceb | ||
|
|
02e8325f30 | ||
|
|
27cfd444a9 | ||
|
|
c92e5b2096 | ||
|
|
9f039f3851 | ||
|
|
a4793944b3 | ||
|
|
371b5ce30f | ||
|
|
96c1b3d7a4 | ||
|
|
356bfe4bd0 | ||
|
|
f7ad55eea0 | ||
|
|
80968f9abf | ||
|
|
c87e572136 | ||
|
|
9c3013899f | ||
|
|
0c8d012f50 | ||
|
|
9f728dbd6c | ||
|
|
b4a4c52784 | ||
|
|
766336a259 | ||
|
|
d747c96c08 | ||
|
|
f4653d0522 | ||
|
|
877678c945 | ||
|
|
8b64165e2e | ||
|
|
77efb63a5f | ||
|
|
a5665aad02 | ||
|
|
210c791af4 | ||
|
|
edef4ec5b5 | ||
|
|
0edbf1f14d | ||
|
|
0d3db7d35a | ||
|
|
a766589eb0 | ||
|
|
3a6b22c7cc | ||
|
|
687a75f4d5 | ||
|
|
bfc532da1f | ||
|
|
03b727881a | ||
|
|
1b8d2aed53 | ||
|
|
960f9af1a8 | ||
|
|
984755f920 | ||
|
|
43d5d6ea51 | ||
|
|
d923e98942 | ||
|
|
9da6304dc9 | ||
|
|
98162f2839 | ||
|
|
272b125282 | ||
|
|
84cfa9904c | ||
|
|
eb9c8822d9 | ||
|
|
9290781094 | ||
|
|
7044d80457 | ||
|
|
8be0c9f1d2 | ||
|
|
0b8a81ef6d | ||
|
|
45e6e5ac0d | ||
|
|
3050dc9d1f | ||
|
|
c0ac76cdfe | ||
|
|
3654c10af1 | ||
|
|
0ca043cbfd | ||
|
|
ac219078ba | ||
|
|
54e8168bde | ||
|
|
216c99e3e5 | ||
|
|
c6989555a0 | ||
|
|
71b9ce263a | ||
|
|
bd8a62b522 | ||
|
|
a887dfc819 | ||
|
|
71adfa2358 | ||
|
|
d805d63c0a | ||
|
|
c4f0a16af8 | ||
|
|
f132153cf4 | ||
|
|
6598618370 | ||
|
|
ea1ea8a265 | ||
|
|
b6e0a5131e | ||
|
|
ab05db40fe | ||
|
|
26c16db59c | ||
|
|
f97b40f2c5 | ||
|
|
103287461e | ||
|
|
495aa19a73 | ||
|
|
db9bb02b43 | ||
|
|
f2f0abc8d9 | ||
|
|
c2acfdfd1b | ||
|
|
a24aefb522 | ||
|
|
9725c96592 | ||
|
|
f350b0d17c | ||
|
|
3e096c0074 | ||
|
|
1ac934b5e4 | ||
|
|
888e6fe590 | ||
|
|
7583df430c | ||
|
|
d21f29ec2c | ||
|
|
8cc8f50f34 | ||
|
|
203580bbbf | ||
|
|
38f4555adb | ||
|
|
5756796218 | ||
|
|
7dba7683b3 | ||
|
|
404ae3f80d | ||
|
|
90b463b54d | ||
|
|
d23198c4fa | ||
|
|
df452e930f | ||
|
|
ec2156fce1 | ||
|
|
4508c2fd74 | ||
|
|
314b2dee04 | ||
|
|
d6e7fbbde5 | ||
|
|
33169dc2fb | ||
|
|
8193805b44 | ||
|
|
a713dcd2a3 | ||
|
|
63782c0fef | ||
|
|
efe5da2604 | ||
|
|
c3c3611764 | ||
|
|
1b9ba092a7 | ||
|
|
f489158a78 | ||
|
|
08c35d5183 | ||
|
|
545c42cd07 | ||
|
|
e400794630 | ||
|
|
aa2d369f3e | ||
|
|
c444515907 | ||
|
|
37f4ba0fa3 | ||
|
|
70dabe5c5c | ||
|
|
77b3dba7be | ||
|
|
b1e18b564e | ||
|
|
1895633608 | ||
|
|
1c3abc59e2 | ||
|
|
949ae5707d | ||
|
|
a976c34b52 | ||
|
|
6c64b111de | ||
|
|
b0edafa81e | ||
|
|
4c68f25838 | ||
|
|
dae6fbfbb8 | ||
|
|
471114415b | ||
|
|
6e3c93fa17 | ||
|
|
9e0fb946f2 | ||
|
|
09b060b176 | ||
|
|
a499ca4213 | ||
|
|
ad0e2cbe61 | ||
|
|
d15f372c59 | ||
|
|
e0ccb59d15 | ||
|
|
bc2745a596 | ||
|
|
60972eab21 | ||
|
|
5b53399432 | ||
|
|
78aefb1547 | ||
|
|
06a8abbf74 | ||
|
|
8bbd1384c5 | ||
|
|
e847794e8d | ||
|
|
d5caa918c8 | ||
|
|
ea74f712fd | ||
|
|
ffd00d8902 | ||
|
|
7a90dcb28b | ||
|
|
1ca11f4df3 | ||
|
|
ffcb3aa74a | ||
|
|
c6e6ff6db2 | ||
|
|
0a6f6c9615 | ||
|
|
82b8c93c8b | ||
|
|
b3133ee406 | ||
|
|
bbb39da808 | ||
|
|
22c78d0a01 | ||
|
|
8de50d4a6f | ||
|
|
3ad7a3b5a2 | ||
|
|
d83e93812d | ||
|
|
248f14971e | ||
|
|
58b72b3b5a | ||
|
|
490a4d45fc | ||
|
|
7e76ccebfb | ||
|
|
cac45814a9 | ||
|
|
6393c240d6 | ||
|
|
77965d7d0d | ||
|
|
efa5db10f4 | ||
|
|
a628f3c63b | ||
|
|
ecaa90a438 | ||
|
|
45e039573b | ||
|
|
e37312e733 | ||
|
|
1160145df1 | ||
|
|
154f896881 | ||
|
|
438b251d8f | ||
|
|
7831c86901 | ||
|
|
b9f95a284a | ||
|
|
30960acffa | ||
|
|
17c9118126 | ||
|
|
3b88d3a116 | ||
|
|
654a479692 | ||
|
|
e7b064e3cb | ||
|
|
4ceace1b47 | ||
|
|
8b5aafa3c7 | ||
|
|
c4665e0737 | ||
|
|
8e771d4047 | ||
|
|
7f6f270fba | ||
|
|
cf2246061c | ||
|
|
b2f5c4ea4e | ||
|
|
8dce8c1c26 | ||
|
|
f542941074 | ||
|
|
63be7fefc1 | ||
|
|
697b0da59f | ||
|
|
328f7d7e84 | ||
|
|
61297c3a3a | ||
|
|
a95b282814 | ||
|
|
8cbccf328c | ||
|
|
256384b455 | ||
|
|
5e107f37f9 | ||
|
|
cd4679c8fd | ||
|
|
1bb8ddc1c4 | ||
|
|
0752c032d3 | ||
|
|
a2eb4cf524 | ||
|
|
af555bbac8 | ||
|
|
8e200da01b | ||
|
|
d2259c3f5d | ||
|
|
f56893018d | ||
|
|
cb9c996861 | ||
|
|
a5159055a4 | ||
|
|
9828bd7f40 | ||
|
|
86f0cd7d21 | ||
|
|
1e2dedaafe | ||
|
|
51969793a5 | ||
|
|
84e430abfd | ||
|
|
172e3e3af1 | ||
|
|
4e8b8deab7 | ||
|
|
4c23e5c7b8 | ||
|
|
21d94b7c66 | ||
|
|
d75de7c2e0 | ||
|
|
9c33393d89 | ||
|
|
1f4f38cfe3 | ||
|
|
4a58f793a9 | ||
|
|
7ebcfb6c20 | ||
|
|
7bdce8d2be | ||
|
|
c0b7e7d2d3 | ||
|
|
98b0992b3c | ||
|
|
a24cd87ddb | ||
|
|
def71a1da8 | ||
|
|
b174c69e5b | ||
|
|
cf332703c9 | ||
|
|
929d4680bb | ||
|
|
fa4055f198 | ||
|
|
03d60dc07d | ||
|
|
4a5ea9efb3 | ||
|
|
b5b3fffdd3 | ||
|
|
1c7028cd1c | ||
|
|
3b518167c7 | ||
|
|
70d5c3d97e | ||
|
|
b1130d0cc6 | ||
|
|
44a413f6fb | ||
|
|
6fb05c9be5 | ||
|
|
3db1899088 | ||
|
|
62cc238d30 | ||
|
|
14d5264b33 | ||
|
|
1f5c237f51 | ||
|
|
cb966210bd | ||
|
|
5f5569e9b9 | ||
|
|
69cfc1369c | ||
|
|
078ee999be | ||
|
|
55c16f3ae2 | ||
|
|
b11354767d | ||
|
|
ebf35a056a | ||
|
|
558f2915b9 | ||
|
|
28119d129d | ||
|
|
9c3067ed35 | ||
|
|
e4c8b50dae | ||
|
|
e96cbac35c | ||
|
|
2990e393e8 | ||
|
|
e531c1e301 | ||
|
|
38df0b225e | ||
|
|
b388a00e05 | ||
|
|
d54b7c287f | ||
|
|
9db478fcc7 | ||
|
|
9a8510a705 | ||
|
|
a8d4c66ecb | ||
|
|
2c09434e4c | ||
|
|
eee6f11154 | ||
|
|
b4cc959a35 | ||
|
|
cfd19d9c88 | ||
|
|
68d2bde10a | ||
|
|
43ead374cc | ||
|
|
000e0153b8 | ||
|
|
bd1c1d0118 | ||
|
|
b81b8ea05e | ||
|
|
fa428f53cf | ||
|
|
b3765b2bad | ||
|
|
4651be614e | ||
|
|
20122f956e | ||
|
|
fa15c13d37 | ||
|
|
40551fe013 | ||
|
|
e7a5c5b53c | ||
|
|
4858a69be5 | ||
|
|
b97eab46b5 | ||
|
|
2e2184f033 | ||
|
|
a8ac17f81b | ||
|
|
004d06ab7d | ||
|
|
c16dd49a18 | ||
|
|
27c073f75d | ||
|
|
842216ee5e | ||
|
|
6a95c9eb33 | ||
|
|
0d51e5aa46 | ||
|
|
6dcbc100ed | ||
|
|
364241a162 | ||
|
|
68c6ea8de5 | ||
|
|
53ad4fe53a | ||
|
|
6c8e8fa264 | ||
|
|
602eb4bcff | ||
|
|
f14cde7186 | ||
|
|
8365d4353f | ||
|
|
9f7561e2fe | ||
|
|
ceac1e0d3b | ||
|
|
5aa379cd26 | ||
|
|
9ad4dda324 | ||
|
|
0e9918f9fe | ||
|
|
8d19b2afab | ||
|
|
1480b51a3e | ||
|
|
a737fb8dd3 | ||
|
|
1233e2a040 | ||
|
|
5b61f6435d | ||
|
|
42f7057f3d | ||
|
|
6407b1be71 | ||
|
|
4160ea1e76 | ||
|
|
5682e3fc30 | ||
|
|
e2a486d931 | ||
|
|
871634c772 | ||
|
|
0b5bbb7dc1 | ||
|
|
995755360a | ||
|
|
b10751460d | ||
|
|
ecf6c8e7a1 | ||
|
|
baebeadf3d | ||
|
|
272528b490 | ||
|
|
8cfb157699 | ||
|
|
1ed041fa4c | ||
|
|
815dfdc15d | ||
|
|
89ed9dce94 | ||
|
|
64daa7165a | ||
|
|
3439cce520 | ||
|
|
7c4feff0ea | ||
|
|
4f98555db5 | ||
|
|
a42bb748bf | ||
|
|
75a451317b | ||
|
|
3a1e430707 | ||
|
|
103e674e83 | ||
|
|
c3fda5abff | ||
|
|
57d01bf1e7 | ||
|
|
988ba51b78 | ||
|
|
be459b62b3 | ||
|
|
3579070eb9 | ||
|
|
25754d7137 | ||
|
|
f816e96bdb | ||
|
|
2d6d430277 | ||
|
|
9951581fb0 | ||
|
|
cefbd1c0a8 | ||
|
|
5afc6a24a3 | ||
|
|
5162fe72e6 | ||
|
|
76ad71cec9 | ||
|
|
19b099479f | ||
|
|
d3123a33f2 | ||
|
|
fb8ead5e06 | ||
|
|
dcd469dc94 | ||
|
|
fc45767963 |
2
README.md
Normal file
2
README.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Dimensional Doors legacy mirror
|
||||||
|
This repository is a mirror of the legacy github repo for dimensional doors, its mostly just for a sort of lost media search to get all of the old versions of the mod built.
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemBlock;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class BlockDimWall extends Block
|
|
||||||
{
|
|
||||||
|
|
||||||
protected BlockDimWall(int i, int j, Material par2Material)
|
|
||||||
{
|
|
||||||
super(i, j, Material.ground);
|
|
||||||
setTickRandomly(true);
|
|
||||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
||||||
this.setTextureFile("/PocketBlockTextures.png");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
|
||||||
|
|
||||||
public int quantityDropped(Random par1Random)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* replaces the block clicked with the held block, instead of placing the block on top of it. Shift click to disable.
|
|
||||||
*/
|
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
|
|
||||||
{
|
|
||||||
if(!par1World.isRemote&&entityPlayer.getCurrentEquippedItem()!=null)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(entityPlayer.getCurrentEquippedItem().getItem() instanceof ItemBlock)
|
|
||||||
{
|
|
||||||
if(!entityPlayer.capabilities.isCreativeMode)
|
|
||||||
{
|
|
||||||
entityPlayer.getCurrentEquippedItem().stackSize--;
|
|
||||||
}
|
|
||||||
par1World.setBlockAndMetadataWithNotify(par2, par3, par4, entityPlayer.getCurrentEquippedItem().itemID, entityPlayer.getCurrentEquippedItem().getItemDamage());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if(par1World.isRemote&&entityPlayer.getCurrentEquippedItem()!=null)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(entityPlayer.getCurrentEquippedItem().getItem() instanceof ItemBlock)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class BlockDimWallPerm extends Block
|
|
||||||
{
|
|
||||||
|
|
||||||
protected BlockDimWallPerm(int i, int j, Material par2Material)
|
|
||||||
{
|
|
||||||
super(i, j, Material.ground);
|
|
||||||
setTickRandomly(true);
|
|
||||||
// this.setCreativeTab(CreativeTabs.tabBlock);
|
|
||||||
this.setTextureFile("/PocketBlockTextures.png");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
public int quantityDropped(Random par1Random)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Only matters if the player is in limbo, acts to teleport the player from limbo back to dim 0
|
|
||||||
*/
|
|
||||||
public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
|
||||||
{
|
|
||||||
if(!par1World.isRemote&&par1World.provider.dimensionId==mod_pocketDim.limboDimID)
|
|
||||||
{
|
|
||||||
Random rand = new Random();
|
|
||||||
|
|
||||||
LinkData link=dimHelper.instance.getRandomLinkData(false);
|
|
||||||
if(link==null)
|
|
||||||
{
|
|
||||||
link =new LinkData(0,0,0,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(dimHelper.getWorld(0)==null)
|
|
||||||
{
|
|
||||||
dimHelper.initDimension(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(dimHelper.getWorld(0)!=null)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
int x = (link.destXCoord + rand.nextInt(mod_pocketDim.limboExitRange)-mod_pocketDim.limboExitRange/2);
|
|
||||||
int z = (link.destZCoord + rand.nextInt(mod_pocketDim.limboExitRange)-mod_pocketDim.limboExitRange/2);
|
|
||||||
|
|
||||||
x=x+(x>> 4)+1; //make sure I am in the middle of a chunk, andnot on a boundry, so it doesnt load the chunk next to me
|
|
||||||
z=z+(z>> 4)+1;
|
|
||||||
|
|
||||||
dimHelper.getWorld(0).getChunkProvider().loadChunk(x >> 4, z >> 4);
|
|
||||||
|
|
||||||
int y = dimHelper.getWorld(0).getHeightValue(x, z);
|
|
||||||
|
|
||||||
//this complicated chunk teleports the player back to the overworld at some random location. Looks funky becaue it has to load the chunk
|
|
||||||
dimHelper.instance.teleportToPocket(par1World, new LinkData(par1World.provider.dimensionId,0,x,y,z,link.locXCoord,link.locYCoord,link.locZCoord,link.isLocPocket),
|
|
||||||
EntityPlayer.class.cast(par5Entity));
|
|
||||||
|
|
||||||
|
|
||||||
EntityPlayer.class.cast(par5Entity).setPositionAndUpdate( x, y, z );
|
|
||||||
|
|
||||||
//makes sure they can breath when they teleport
|
|
||||||
dimHelper.getWorld(0).setBlockWithNotify(x, y, z, 0);
|
|
||||||
int i=x;
|
|
||||||
int j=y-1;
|
|
||||||
int k=z;
|
|
||||||
|
|
||||||
|
|
||||||
for(int xc=-3;xc<4;xc++)
|
|
||||||
{
|
|
||||||
for(int zc=-3;zc<4;zc++)
|
|
||||||
{
|
|
||||||
for(int yc=0;yc<200;yc++)
|
|
||||||
{
|
|
||||||
if(yc==0&&dimHelper.getWorld(0).isBlockOpaqueCube(i+xc, j-2,k +zc))
|
|
||||||
{
|
|
||||||
|
|
||||||
if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+2)
|
|
||||||
{
|
|
||||||
dimHelper.getWorld(0).setBlock(i+xc, j-1+yc, k+zc, mod_pocketDim.blockLimboID);
|
|
||||||
}
|
|
||||||
else if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+3)
|
|
||||||
|
|
||||||
{
|
|
||||||
dimHelper.getWorld(0).setBlockAndMetadata(i+xc, j-1+yc, k+zc, mod_pocketDim.blockLimboID,2);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityLiving;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class BlockLimbo extends Block
|
|
||||||
{
|
|
||||||
|
|
||||||
protected BlockLimbo(int i, int j, Material par2Material)
|
|
||||||
{
|
|
||||||
super(i, j, Material.ground);
|
|
||||||
setTickRandomly(false);
|
|
||||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
||||||
this.setTextureFile("/PocketBlockTextures.png");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
|
||||||
|
|
||||||
//part of the decay mech, if a block has fallen onto it, when it turns, it makes sure any block above it gets added too.
|
|
||||||
@Override
|
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
if(par1World.getBlockId(par2, par3+1, par4)==Block.gravel.blockID)
|
|
||||||
{
|
|
||||||
Point3D point = new Point3D(par2,par3+1,par4);
|
|
||||||
dimHelper.blocksToDecay.add(point);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public int quantityDropped(Random par1Random)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
}
|
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
|
|
||||||
{
|
|
||||||
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
|
||||||
//if a block lands on it and its gravel, adds it to the decay list
|
|
||||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(par1World.getBlockId(par2, par3+1, par4)==Block.gravel.blockID)
|
|
||||||
{
|
|
||||||
Point3D point = new Point3D(par2,par3+1,par4);
|
|
||||||
dimHelper.blocksToDecay.add(point);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//TODO set render color!!
|
|
||||||
}
|
|
||||||
@@ -1,293 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.BlockContainer;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import StevenDimDoors.mod_pocketDimClient.ClosingRiftFX;
|
|
||||||
import StevenDimDoors.mod_pocketDimClient.GoggleRiftFX;
|
|
||||||
import StevenDimDoors.mod_pocketDimClient.RiftFX;
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockRift extends BlockContainer
|
|
||||||
{
|
|
||||||
|
|
||||||
protected BlockRift(int i, int j, Material par2Material)
|
|
||||||
{
|
|
||||||
super(i, j, Material.snow);
|
|
||||||
setTickRandomly(true);
|
|
||||||
// this.setCreativeTab(CreativeTabs.tabBlock);
|
|
||||||
this.setTextureFile("/PocketBlockTextures.png");
|
|
||||||
this.setLightOpacity(14);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
//sends a packet informing the client that there is a link present so it renders properly. (when placed)
|
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
PacketHandler.onLinkCreatedPacket(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World));
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
// this.updateTick(par1World, par2, par3, par4, new Random());
|
|
||||||
|
|
||||||
}
|
|
||||||
public boolean isCollidable()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
|
||||||
|
|
||||||
|
|
||||||
public boolean isOpaqueCube()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag
|
|
||||||
*/
|
|
||||||
public boolean canCollideCheck(int par1, boolean par2)
|
|
||||||
{
|
|
||||||
|
|
||||||
return par2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns Returns true if the given side of this block type should be rendered (if it's solid or not), if the
|
|
||||||
* adjacent block is at the given coordinates. Args: blockAccess, x, y, z, side
|
|
||||||
*/
|
|
||||||
public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
//this doesnt do anything yet.
|
|
||||||
public int getRenderType()
|
|
||||||
{
|
|
||||||
if(mod_pocketDim.isPlayerWearingGoogles)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
||||||
* coordinates. Args: blockAccess, x, y, z, side
|
|
||||||
*/
|
|
||||||
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
|
||||||
* cleared to be reused)
|
|
||||||
*/
|
|
||||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
//function that regulates how many blocks it eats/ how fast it eates them.
|
|
||||||
public void updateTick(World world, int x, int y, int z, Random random)
|
|
||||||
{
|
|
||||||
if(!world.isRemote&&dimHelper.instance.getLinkDataFromCoords(x, y, z, world.provider.dimensionId)!=null&&mod_pocketDim.enableRiftGrief)
|
|
||||||
{
|
|
||||||
TileEntityRift rift = (TileEntityRift) world.getBlockTileEntity(x, y, z);
|
|
||||||
if(rift.isNearRift)
|
|
||||||
{
|
|
||||||
|
|
||||||
int range=4;
|
|
||||||
|
|
||||||
float distance=range+range/4;
|
|
||||||
int i=-range;
|
|
||||||
int j=-range;
|
|
||||||
int k=-range;
|
|
||||||
boolean flag=true;
|
|
||||||
while (i<range&&flag)
|
|
||||||
{
|
|
||||||
while (j<range&&flag)
|
|
||||||
{
|
|
||||||
while (k<range&&flag)
|
|
||||||
{
|
|
||||||
if(!mod_pocketDim.blocksImmuneToRift.contains(world.getBlockId(x+i, y+j, z+k))&&MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)<distance&&!world.isAirBlock(x+i, y+j, z+k))
|
|
||||||
{
|
|
||||||
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0&&random.nextInt(2)==0)
|
|
||||||
{
|
|
||||||
world.setBlockWithNotify(x+i, y+j, z+k,0);
|
|
||||||
flag=random.nextBoolean()||random.nextBoolean();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
k++;
|
|
||||||
}
|
|
||||||
k=-range;
|
|
||||||
j++;
|
|
||||||
|
|
||||||
}
|
|
||||||
j=-range;
|
|
||||||
i++;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* regulates the render effect, especially when multiple rifts start to link up. Has 3 main parts- Grows toward and away from nearest rft, bends toward it, and a randomization function
|
|
||||||
*/
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random rand)
|
|
||||||
{
|
|
||||||
|
|
||||||
int count;
|
|
||||||
//growth in the direction towards the nearby rift
|
|
||||||
float xGrowth=0;
|
|
||||||
float yGrowth=0;
|
|
||||||
float zGrowth=0;
|
|
||||||
//growth away from the nearby rift
|
|
||||||
float xGrowthn=0;
|
|
||||||
float yGrowthn=0;
|
|
||||||
float zGrowthn=0;
|
|
||||||
//how far the particles are away from original rift. Used to decrease noise the farther they are away.
|
|
||||||
float xChange = 0;
|
|
||||||
float yChange = 0;
|
|
||||||
float zChange = 0;
|
|
||||||
|
|
||||||
TileEntityRift tile = (TileEntityRift)par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
|
|
||||||
//the noise, ie, how far the rift particles are away from the intended location.
|
|
||||||
float offset=0;
|
|
||||||
float Xoffset=0;
|
|
||||||
float Yoffset=0;
|
|
||||||
float Zoffset=0;
|
|
||||||
for (count = 0; count < 12 && tile!=null; ++count)
|
|
||||||
{
|
|
||||||
//TODO change to a switch statement for clarity
|
|
||||||
if(tile.xOffset>0)
|
|
||||||
{
|
|
||||||
if(rand.nextInt(tile.xOffset)==0)
|
|
||||||
{
|
|
||||||
xGrowth =xGrowth+.15F*tile.xOffset;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(tile.xOffset<0)
|
|
||||||
{
|
|
||||||
if(rand.nextInt(-tile.xOffset)==0)
|
|
||||||
{
|
|
||||||
xGrowthn =xGrowthn-.15F*-tile.xOffset;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(tile.yOffset>0)
|
|
||||||
{
|
|
||||||
if(rand.nextInt(tile.yOffset)==0)
|
|
||||||
{
|
|
||||||
yGrowth =yGrowth+.15F*tile.yOffset;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(tile.yOffset<0)
|
|
||||||
{
|
|
||||||
if(rand.nextInt(-tile.yOffset)==0)
|
|
||||||
{
|
|
||||||
yGrowthn =yGrowthn-.15F*-tile.yOffset;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(tile.zOffset>0)
|
|
||||||
{
|
|
||||||
if(rand.nextInt(tile.zOffset)==0)
|
|
||||||
{
|
|
||||||
zGrowth =zGrowth+.15F*tile.zOffset;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(tile.zOffset<0)
|
|
||||||
{
|
|
||||||
if(rand.nextInt(-tile.zOffset)==0)
|
|
||||||
{
|
|
||||||
zGrowthn =zGrowthn-.15F*-tile.zOffset;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
xChange=(float) ((xGrowth+xGrowthn)+rand.nextGaussian()*.05F);
|
|
||||||
yChange=(float) ((yGrowth+yGrowthn)+rand.nextGaussian()*.05F);
|
|
||||||
zChange=(float) ((zGrowth+zGrowthn)+rand.nextGaussian()*.05F);
|
|
||||||
|
|
||||||
offset= (float) ((0.2F/(1+Math.abs(xChange)+Math.abs(yChange)+Math.abs(zChange))));
|
|
||||||
Xoffset= (float) ((0.25F/(1+Math.abs(xChange))));
|
|
||||||
|
|
||||||
Yoffset= (float) ((0.25F/(1+Math.abs(yChange))));
|
|
||||||
Zoffset= (float) ((0.25F/(1+Math.abs(zChange))));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new RiftFX(par1World,par2+.5+xChange+Xoffset*rand.nextGaussian(), par3+.5+yChange+Yoffset*rand.nextGaussian() , par4+.5+zChange+Zoffset*rand.nextGaussian(), rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, FMLClientHandler.instance().getClient().effectRenderer));
|
|
||||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new RiftFX(par1World,par2+.5-xChange-Xoffset*rand.nextGaussian(), par3+.5-yChange-Yoffset*rand.nextGaussian() , par4+.5-zChange-Zoffset*rand.nextGaussian(), rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, FMLClientHandler.instance().getClient().effectRenderer));
|
|
||||||
|
|
||||||
|
|
||||||
if(rand.nextBoolean())
|
|
||||||
{
|
|
||||||
//renders an extra little blob on top of the actual rift location so its easier to find. Eventually will only render if the player has the goggles.
|
|
||||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new GoggleRiftFX(par1World,par2+.5, par3+.5, par4+.5, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, FMLClientHandler.instance().getClient().effectRenderer));
|
|
||||||
}
|
|
||||||
if(tile.shouldClose)
|
|
||||||
{
|
|
||||||
//renders an opposite color effect if it is being closed by the rift remover
|
|
||||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new ClosingRiftFX(par1World,par2+.5, par3+.5, par4+.5, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, FMLClientHandler.instance().getClient().effectRenderer));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int idDropped(int par1, Random par2Random, int par3)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity createNewTileEntity(World var1)
|
|
||||||
|
|
||||||
{
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return new TileEntityRift();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.BlockContainer;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
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 cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class ChaosDoor extends dimDoor
|
|
||||||
{
|
|
||||||
|
|
||||||
protected ChaosDoor(int par1, Material material)
|
|
||||||
{
|
|
||||||
super(par1, Material.iron);
|
|
||||||
// this.blockIndexInTexture = 18;
|
|
||||||
this.setTextureFile("/PocketBlockTextures.png");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
if(!par1World.isRemote&&par1World.getBlockId(par2, par3-1, par4)==this.blockID)
|
|
||||||
{
|
|
||||||
boolean newDim=false;
|
|
||||||
|
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)==null)
|
|
||||||
{
|
|
||||||
newDim=true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(newDim)
|
|
||||||
{
|
|
||||||
LinkData link = new LinkData(par1World.provider.dimensionId, mod_pocketDim.limboDimID, par2, par3, par4, par2, par3+500, par4, false);
|
|
||||||
link.linkOrientation= par1World.getBlockMetadata(par2, par3-1, par4);
|
|
||||||
dimHelper.instance.createLink(link);
|
|
||||||
// System.out.println(link.linkOrientation);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
|
|
||||||
{
|
|
||||||
dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation=par1World.getBlockMetadata(par2, par3-1, par4);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//uses the rift rendering list to find a random destination for the player
|
|
||||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
|
||||||
{
|
|
||||||
|
|
||||||
int var12 = (int) (MathHelper.floor_double((double)((par5Entity.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
|
||||||
|
|
||||||
int num = par1World.getBlockMetadata(par2, par3-1, par4);
|
|
||||||
if(!par1World.isRemote&&(num==5||num==4||num==6||num==7)&&(num-4)==var12&&par1World.getBlockId(par2, par3-1, par4)==mod_pocketDim.chaosDoorID)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
|
||||||
|
|
||||||
boolean foundRandomDest=false;
|
|
||||||
|
|
||||||
int i=0;
|
|
||||||
|
|
||||||
|
|
||||||
Random rand= new Random();
|
|
||||||
|
|
||||||
while (!foundRandomDest&&i<100)
|
|
||||||
{
|
|
||||||
i++;
|
|
||||||
|
|
||||||
LinkData link = (LinkData) dimHelper.instance.getRandomLinkData(false);
|
|
||||||
|
|
||||||
if(link!=null)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(!link.isLocPocket&&link.linkOrientation!=-10&&link.destDimID!=mod_pocketDim.limboDimID)
|
|
||||||
{
|
|
||||||
foundRandomDest=true;
|
|
||||||
|
|
||||||
dimHelper.instance.teleportToPocket(par1World, new LinkData(link.destDimID,link.locDimID,link.destXCoord,link.destYCoord,link.destZCoord,link.locXCoord,link.locYCoord,link.locZCoord,link.isLocPocket), par5Entity);
|
|
||||||
|
|
||||||
if(dimHelper.getWorld(link.locDimID)!=null)
|
|
||||||
{
|
|
||||||
if(dimHelper.getWorld(link.locDimID).isAirBlock(link.locXCoord,link.locYCoord,link.locZCoord))
|
|
||||||
{
|
|
||||||
dimHelper.getWorld(link.locDimID).setBlockWithNotify(link.locXCoord,link.locYCoord,link.locZCoord, mod_pocketDim.blockRiftID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,163 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.BlockContainer;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
|
||||||
import cpw.mods.fml.common.ITickHandler;
|
|
||||||
import cpw.mods.fml.common.TickType;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
public class CommonTickHandler implements ITickHandler
|
|
||||||
{
|
|
||||||
Random rand= new Random();
|
|
||||||
public int tickCount=0;
|
|
||||||
public int tickCount2=0;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tickStart(EnumSet<TickType> type, Object... tickData) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tickEnd(EnumSet<TickType> type, Object... tickData)
|
|
||||||
{
|
|
||||||
if (type.equals(EnumSet.of(TickType.SERVER)))
|
|
||||||
{
|
|
||||||
onTickInGame();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnumSet ticks()
|
|
||||||
{
|
|
||||||
return EnumSet.of(TickType.SERVER);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabel()
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//replaces rifts in game that have been destroyed/have blocks placed over them.
|
|
||||||
private void onTickInGame()
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
if(tickCount>200)
|
|
||||||
{
|
|
||||||
tickCount=0;
|
|
||||||
int i=0;
|
|
||||||
|
|
||||||
|
|
||||||
while (i<15&&dimHelper.instance.linksForRendering.size()>0&&FMLCommonHandler.instance().getEffectiveSide()==Side.SERVER)
|
|
||||||
{
|
|
||||||
i++;
|
|
||||||
LinkData link;
|
|
||||||
|
|
||||||
//actually gets the random rift based on the size of the list
|
|
||||||
link = (LinkData) dimHelper.instance.linksForRendering.get(rand.nextInt(dimHelper.instance.linksForRendering.size()));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(link!=null)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(dimHelper.getWorld(link.locDimID)!=null)
|
|
||||||
{
|
|
||||||
World world=dimHelper.getWorld(link.locDimID);
|
|
||||||
|
|
||||||
int blocktoReplace = world.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord);
|
|
||||||
|
|
||||||
if(!mod_pocketDim.blocksImmuneToRift.contains(blocktoReplace))//makes sure the rift doesnt replace a door or something
|
|
||||||
{
|
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(link.locXCoord, link.locYCoord, link.locZCoord, link.locDimID)==null)
|
|
||||||
{
|
|
||||||
dimHelper.instance.linksForRendering.remove(link);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dimHelper.getWorld(link.locDimID).setBlockWithNotify(link.locXCoord, link.locYCoord, link.locZCoord, mod_pocketDim.blockRiftID);
|
|
||||||
TileEntityRift.class.cast(dimHelper.getWorld(link.locDimID).getBlockTileEntity(link.locXCoord, link.locYCoord, link.locZCoord)).hasGrownRifts=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
tickCount++;
|
|
||||||
System.out.println("something on tick went wrong");
|
|
||||||
}
|
|
||||||
tickCount++;
|
|
||||||
|
|
||||||
//this section regulates decay in Limbo- it records any blocks placed by the player and later progresss them through the decay cycle
|
|
||||||
if(tickCount2>10&&dimHelper.blocksToDecay!=null)
|
|
||||||
{
|
|
||||||
tickCount2=0;
|
|
||||||
if(!dimHelper.blocksToDecay.isEmpty()&&dimHelper.getWorld(mod_pocketDim.limboDimID)!=null)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
if(dimHelper.blocksToDecay.size()>rand.nextInt(400))
|
|
||||||
{
|
|
||||||
int index = rand.nextInt(dimHelper.blocksToDecay.size());
|
|
||||||
Point3D point = (Point3D) dimHelper.blocksToDecay.get(index);
|
|
||||||
|
|
||||||
int blockID = dimHelper.getWorld(mod_pocketDim.limboDimID).getBlockId(point.getX(), point.getY(), point.getZ());
|
|
||||||
int idToSet=Block.stone.blockID;
|
|
||||||
|
|
||||||
if(blockID==0||blockID==mod_pocketDim.blockLimboID)
|
|
||||||
{
|
|
||||||
dimHelper.blocksToDecay.remove(index);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(Block.blocksList[idToSet] instanceof BlockContainer)
|
|
||||||
{
|
|
||||||
idToSet=-1;
|
|
||||||
dimHelper.blocksToDecay.remove(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(blockID==Block.cobblestone.blockID)
|
|
||||||
{
|
|
||||||
idToSet=Block.gravel.blockID;
|
|
||||||
}
|
|
||||||
if(blockID==Block.stone.blockID)
|
|
||||||
{
|
|
||||||
idToSet=Block.cobblestone.blockID;
|
|
||||||
|
|
||||||
}
|
|
||||||
if(blockID==Block.gravel.blockID&&!dimHelper.getWorld(mod_pocketDim.limboDimID).isAirBlock(point.getX(), point.getY()-1, point.getZ()))
|
|
||||||
{
|
|
||||||
idToSet=mod_pocketDim.blockLimboID;
|
|
||||||
}
|
|
||||||
else if(blockID==Block.gravel.blockID)
|
|
||||||
{
|
|
||||||
dimHelper.blocksToDecay.remove(index);
|
|
||||||
idToSet=-1;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(idToSet!=-1)
|
|
||||||
{
|
|
||||||
|
|
||||||
dimHelper.getWorld(mod_pocketDim.limboDimID).setBlockWithNotify(point.getX(), point.getY(), point.getZ(), idToSet);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tickCount2++;
|
|
||||||
**/
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import net.minecraft.network.INetworkManager;
|
|
||||||
import net.minecraft.network.NetLoginHandler;
|
|
||||||
import net.minecraft.network.packet.NetHandler;
|
|
||||||
import net.minecraft.network.packet.Packet1Login;
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
|
||||||
import cpw.mods.fml.common.network.IConnectionHandler;
|
|
||||||
import cpw.mods.fml.common.network.Player;
|
|
||||||
|
|
||||||
public class ConnectionHandler
|
|
||||||
|
|
||||||
|
|
||||||
implements IConnectionHandler
|
|
||||||
{
|
|
||||||
private static boolean connected = false;
|
|
||||||
|
|
||||||
//sends a packet to clients containing all the information about the dims and links. Lots of packets, actually.
|
|
||||||
@Override
|
|
||||||
public String connectionReceived(NetLoginHandler netHandler, INetworkManager manager)
|
|
||||||
{
|
|
||||||
Collection set = new ArrayList();
|
|
||||||
set.addAll(dimHelper.dimList.keySet());
|
|
||||||
PacketHandler.onClientJoinPacket(manager, dimHelper.dimList);
|
|
||||||
PacketHandler.onDimCreatedPacket(new DimData(mod_pocketDim.limboDimID, false, 0, 0, 0, 0, 0));
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void connectionOpened(NetHandler netClientHandler, String server,int port, INetworkManager manager)
|
|
||||||
{
|
|
||||||
connected = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void connectionOpened(NetHandler netClientHandler,MinecraftServer server, INetworkManager manager)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void connectionClosed(INetworkManager manager)
|
|
||||||
{
|
|
||||||
if (connected)
|
|
||||||
{
|
|
||||||
System.out.println("Clearing dim cache");
|
|
||||||
dimHelper.instance.save();
|
|
||||||
dimHelper.instance.unregsisterDims();
|
|
||||||
dimHelper.dimList.clear();
|
|
||||||
|
|
||||||
}
|
|
||||||
connected = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clientLoggedIn(NetHandler clientHandler, INetworkManager manager,
|
|
||||||
Packet1Login login)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void playerLoggedIn(Player player, NetHandler netHandler,
|
|
||||||
INetworkManager manager)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,257 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
/**Class that contains all the information about a specific dim that is pertienent to Dim Doors. Holds all the rifts present in the dim sorted by x,y,z and
|
|
||||||
* wether or not the dim is a pocket or not, along with its depth.
|
|
||||||
* @Return
|
|
||||||
*/
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class DimData implements Serializable
|
|
||||||
{
|
|
||||||
public int dimID;
|
|
||||||
public int depth;
|
|
||||||
public int dimOrientation;
|
|
||||||
|
|
||||||
public World world;
|
|
||||||
|
|
||||||
public LinkData exitDimLink;
|
|
||||||
|
|
||||||
public boolean isPocket;
|
|
||||||
public boolean hasBeenFilled=false;
|
|
||||||
public boolean hasDoor=false;
|
|
||||||
public boolean isDimRandomRift=false;
|
|
||||||
|
|
||||||
public HashMap<Integer, HashMap<Integer, HashMap<Integer, LinkData>>> linksInThisDim=new HashMap();
|
|
||||||
HashMap<Integer, LinkData> dimX;
|
|
||||||
HashMap<Integer, HashMap<Integer, LinkData>> dimY ;
|
|
||||||
|
|
||||||
static final long serialVersionUID = 454342L;
|
|
||||||
|
|
||||||
public DimData(int dimID, boolean isPocket, int depth, LinkData exitLinkData)
|
|
||||||
{
|
|
||||||
this.dimID=dimID;
|
|
||||||
this.depth=depth;
|
|
||||||
this.isPocket=isPocket;
|
|
||||||
|
|
||||||
this.exitDimLink= exitLinkData;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public DimData(int dimID, boolean isPocket, int depth, int exitLinkDimID, int exitX, int exitY, int exitZ)
|
|
||||||
{
|
|
||||||
this.dimID=dimID;
|
|
||||||
this.depth=depth;
|
|
||||||
this.isPocket=isPocket;
|
|
||||||
|
|
||||||
this.exitDimLink= new LinkData(exitLinkDimID, exitX, exitY, exitZ);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinkData findNearestRift(World world, int range, int x, int y, int z)
|
|
||||||
{
|
|
||||||
LinkData nearest=null;
|
|
||||||
float distance=range+1;
|
|
||||||
int i=-range;
|
|
||||||
int j=-range;
|
|
||||||
int k=-range;
|
|
||||||
|
|
||||||
while (i<range)
|
|
||||||
{
|
|
||||||
while (j<range)
|
|
||||||
{
|
|
||||||
while (k<range)
|
|
||||||
{
|
|
||||||
if(world.getBlockId(x+i, y+j, z+k)==mod_pocketDim.blockRiftID&&MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)<distance)
|
|
||||||
{
|
|
||||||
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0)
|
|
||||||
{
|
|
||||||
nearest=this.findLinkAtCoords(x+i, y+j, z+k);
|
|
||||||
distance=MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
k++;
|
|
||||||
}
|
|
||||||
k=-range;
|
|
||||||
j++;
|
|
||||||
|
|
||||||
}
|
|
||||||
j=-range;
|
|
||||||
i++;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return nearest;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinkData addLinkToDim(LinkData link)
|
|
||||||
{
|
|
||||||
if(this.linksInThisDim.containsKey(link.locZCoord))
|
|
||||||
{
|
|
||||||
this.dimY=this.linksInThisDim.get(link.locZCoord);
|
|
||||||
|
|
||||||
if(this.dimY.containsKey(link.locYCoord))
|
|
||||||
{
|
|
||||||
this.dimX=this.dimY.get(link.locYCoord);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.dimX=new HashMap<Integer, LinkData>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.dimX=new HashMap<Integer, LinkData>();
|
|
||||||
this.dimY=new HashMap<Integer, HashMap<Integer, LinkData>>();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.dimX.put(link.locXCoord, link);
|
|
||||||
this.dimY.put(link.locYCoord, dimX);
|
|
||||||
this.linksInThisDim.put(link.locZCoord, dimY);
|
|
||||||
|
|
||||||
//System.out.println("added link to dim "+this.dimID);
|
|
||||||
return link;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinkData addLinkToDim( int destinationDimID, int locationXCoord, int locationYCoord, int locationZCoord, int destinationXCoord, int destinationYCoord, int destinationZCoord, int linkOrientation)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LinkData linkData= new LinkData(this.dimID, destinationDimID, locationXCoord, locationYCoord, locationZCoord, destinationXCoord, destinationYCoord,destinationZCoord,this.isPocket);
|
|
||||||
|
|
||||||
linkData.linkOrientation=linkOrientation;
|
|
||||||
|
|
||||||
return this.addLinkToDim(linkData);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isLimbo()
|
|
||||||
{
|
|
||||||
if(this.dimID==mod_pocketDim.limboDimID)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void removeLinkAtCoords(LinkData link)
|
|
||||||
{
|
|
||||||
this.removeLinkAtCoords(link.locDimID, link.locXCoord, link.locYCoord, link.locZCoord);
|
|
||||||
}
|
|
||||||
public void removeLinkAtCoords(int locationID, int locationXCoord, int locationYCoord, int locationZCoord)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
if(this.linksInThisDim.containsKey(locationZCoord))
|
|
||||||
{
|
|
||||||
this.dimY=this.linksInThisDim.get(locationZCoord);
|
|
||||||
|
|
||||||
if(this.dimY.containsKey(locationYCoord))
|
|
||||||
{
|
|
||||||
this.dimX=this.dimY.get(locationYCoord);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.dimX=new HashMap<Integer, LinkData>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.dimX=new HashMap<Integer, LinkData>();
|
|
||||||
this.dimY=new HashMap<Integer, HashMap<Integer, LinkData>>();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
this.dimX.remove(locationXCoord);
|
|
||||||
this.dimY.put(locationYCoord, dimX);
|
|
||||||
this.linksInThisDim.put(locationZCoord, dimY);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinkData findLinkAtCoords(int locationXCoord, int locationYCoord, int locationZCoord)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if(this.linksInThisDim.containsKey(locationZCoord))
|
|
||||||
{
|
|
||||||
this.dimY=this.linksInThisDim.get(locationZCoord);
|
|
||||||
|
|
||||||
if(this.dimY.containsKey(locationYCoord))
|
|
||||||
{
|
|
||||||
this.dimX=this.dimY.get(locationYCoord);
|
|
||||||
|
|
||||||
if(this.dimX.containsKey(locationXCoord))
|
|
||||||
{
|
|
||||||
return this.dimX.get(locationXCoord);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(Exception E)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ArrayList<LinkData> printAllLinkData()
|
|
||||||
{
|
|
||||||
ArrayList links = new ArrayList();
|
|
||||||
if(this.linksInThisDim==null)
|
|
||||||
{
|
|
||||||
return links;
|
|
||||||
}
|
|
||||||
for(HashMap<Integer, HashMap<Integer, LinkData>> first : this.linksInThisDim.values())
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
for(HashMap<Integer, LinkData> second : first.values())
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
for(LinkData linkData :second.values())
|
|
||||||
{
|
|
||||||
links.add(linkData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return links;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
|
|
||||||
public class DimUpdatePacket
|
|
||||||
{
|
|
||||||
|
|
||||||
public DimUpdatePacket(int dim)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,188 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class DungeonGenerator
|
|
||||||
{
|
|
||||||
|
|
||||||
public int weight;
|
|
||||||
public String schematicPath;
|
|
||||||
public ArrayList<HashMap> sideRifts = new ArrayList<HashMap>();
|
|
||||||
public LinkData exitLink;
|
|
||||||
public static Random rand = new Random();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public DungeonGenerator(int weight, String schematicPath, ArrayList<HashMap> sideRifts)
|
|
||||||
{
|
|
||||||
this.weight=weight;
|
|
||||||
this.schematicPath=schematicPath;
|
|
||||||
this.sideRifts=sideRifts;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void generateDungeonlink(LinkData incoming)
|
|
||||||
{
|
|
||||||
//DungeonGenerator dungeon = mod_pocketDim.registeredDungeons.get(new Random().nextInt(mod_pocketDim.registeredDungeons.size()));
|
|
||||||
DungeonGenerator dungeon;
|
|
||||||
int depth = dimHelper.instance.getDimDepth(incoming.locDimID)+2;
|
|
||||||
|
|
||||||
int depthWeight = rand.nextInt(depth)+rand.nextInt(depth)-2;
|
|
||||||
|
|
||||||
depth=depth-2;
|
|
||||||
// DungeonGenerator
|
|
||||||
boolean flag = true;
|
|
||||||
int count=10;
|
|
||||||
|
|
||||||
if(incoming.destYCoord>10)
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
count--;
|
|
||||||
flag = true;
|
|
||||||
dungeon = mod_pocketDim.registeredDungeons.get(rand.nextInt(mod_pocketDim.registeredDungeons.size()));
|
|
||||||
|
|
||||||
if(depth<=1)
|
|
||||||
{
|
|
||||||
if(rand.nextBoolean())
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.complexHalls.get(rand.nextInt(mod_pocketDim.complexHalls.size()));
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(rand.nextBoolean())
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.hubs.get(rand.nextInt(mod_pocketDim.hubs.size()));
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(rand.nextBoolean())
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.hubs.get(rand.nextInt(mod_pocketDim.hubs.size()));
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(mod_pocketDim.deadEnds.contains(dungeon)||mod_pocketDim.exits.contains(dungeon))
|
|
||||||
{
|
|
||||||
flag=false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(depth<=3&&(mod_pocketDim.deadEnds.contains(dungeon)||mod_pocketDim.exits.contains(dungeon)||rand.nextBoolean()))
|
|
||||||
{
|
|
||||||
if(rand.nextBoolean())
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.hubs.get(rand.nextInt(mod_pocketDim.hubs.size()));
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(rand.nextBoolean())
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.mazes.get(rand.nextInt(mod_pocketDim.mazes.size()));
|
|
||||||
}
|
|
||||||
else if(rand.nextBoolean())
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.pistonTraps.get(rand.nextInt(mod_pocketDim.pistonTraps.size()));
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
flag=false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(rand.nextInt(3)==0&&!mod_pocketDim.complexHalls.contains(dungeon))
|
|
||||||
{
|
|
||||||
if(rand.nextInt(3)==0)
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.simpleHalls.get(rand.nextInt(mod_pocketDim.simpleHalls.size()));
|
|
||||||
}
|
|
||||||
else if(rand.nextBoolean())
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.pistonTraps.get(rand.nextInt(mod_pocketDim.pistonTraps.size()));
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(depth<4)
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.hubs.get(rand.nextInt(mod_pocketDim.hubs.size()));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(depthWeight-depthWeight/2>depth-4&&(mod_pocketDim.deadEnds.contains(dungeon)||mod_pocketDim.exits.contains(dungeon)))
|
|
||||||
{
|
|
||||||
if(rand.nextBoolean())
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.simpleHalls.get(rand.nextInt(mod_pocketDim.simpleHalls.size()));
|
|
||||||
}
|
|
||||||
else if(rand.nextBoolean())
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.complexHalls.get(rand.nextInt(mod_pocketDim.complexHalls.size()));
|
|
||||||
}
|
|
||||||
else if(rand.nextBoolean())
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.pistonTraps.get(rand.nextInt(mod_pocketDim.pistonTraps.size()));
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
flag=false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(depthWeight>7&&mod_pocketDim.hubs.contains(dungeon))
|
|
||||||
{
|
|
||||||
if(rand.nextInt(12)+5<depthWeight)
|
|
||||||
{
|
|
||||||
if(rand.nextBoolean())
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.exits.get(rand.nextInt(mod_pocketDim.exits.size()));
|
|
||||||
}
|
|
||||||
else if(rand.nextBoolean())
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.deadEnds.get(rand.nextInt(mod_pocketDim.deadEnds.size()));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dungeon = mod_pocketDim.pistonTraps.get(rand.nextInt(mod_pocketDim.pistonTraps.size()));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(depth>10&&mod_pocketDim.hubs.contains(dungeon))
|
|
||||||
{
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
while(!flag&&count>0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dungeon= mod_pocketDim.defaultUp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
mod_pocketDim.loader.init(dungeon.schematicPath, incoming, 0,0,0);
|
|
||||||
//mod_pocketDim.loader.generateSchematic(incoming,0,0,0);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,245 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.entity.EntityLiving;
|
|
||||||
import net.minecraft.entity.monster.EntityEnderman;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemBlock;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
|
||||||
import net.minecraft.util.EnumMovingObjectType;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import net.minecraft.util.Vec3;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.WorldServer;
|
|
||||||
import net.minecraftforge.client.event.sound.SoundLoadEvent;
|
|
||||||
import net.minecraftforge.event.ForgeSubscribe;
|
|
||||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
|
||||||
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
|
||||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
|
||||||
import net.minecraftforge.event.world.WorldEvent;
|
|
||||||
public class EventHookContainer
|
|
||||||
{
|
|
||||||
Random rand= new Random();
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@ForgeSubscribe
|
|
||||||
public void onSoundLoad(SoundLoadEvent event)
|
|
||||||
{
|
|
||||||
File dataDir = Minecraft.getMinecraft().mcDataDir;
|
|
||||||
|
|
||||||
// event.manager.soundPoolSounds.addSound("mod/test/sound.ogg", new File(
|
|
||||||
// dataDir, "resources/mod/test/sound.ogg"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ForgeSubscribe
|
|
||||||
public void onWorldLoad(WorldEvent.Load event)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(!mod_pocketDim.hasInitDims&&event.world.provider.dimensionId==0&&!event.world.isRemote)
|
|
||||||
{
|
|
||||||
System.out.println("Registering Pocket Dims");
|
|
||||||
mod_pocketDim.hasInitDims=true;
|
|
||||||
dimHelper.instance.unregsisterDims();
|
|
||||||
dimHelper.dimList.clear();
|
|
||||||
dimHelper.instance.interDimLinkList.clear();
|
|
||||||
|
|
||||||
dimHelper.instance.initPockets();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(WorldServer world : dimHelper.getWorlds())
|
|
||||||
{
|
|
||||||
int linkCount=0;
|
|
||||||
|
|
||||||
if(dimHelper.dimList.containsKey(world.provider.dimensionId))
|
|
||||||
{
|
|
||||||
|
|
||||||
for(LinkData link:dimHelper.dimList.get(world.provider.dimensionId).printAllLinkData())
|
|
||||||
{
|
|
||||||
if(linkCount>100)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
linkCount++;
|
|
||||||
int blocktoReplace = world.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord);
|
|
||||||
if(mod_pocketDim.blocksImmuneToRift.contains(blocktoReplace))
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
dimHelper.getWorld(link.locDimID).setBlockWithNotify(link.locXCoord, link.locYCoord, link.locZCoord, mod_pocketDim.blockRiftID);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ForgeSubscribe
|
|
||||||
public void EntityJoinWorldEvent(net.minecraftforge.event.entity.EntityJoinWorldEvent event)
|
|
||||||
{
|
|
||||||
if(event.entity instanceof EntityPlayer)
|
|
||||||
{
|
|
||||||
// System.out.println(event.entity.worldObj.provider.dimensionId);
|
|
||||||
|
|
||||||
// PacketDispatcher.sendPacketToPlayer(DimUpdatePacket.sendPacket(event.world.provider.dimensionId,1),(Player) event.entity);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ForgeSubscribe
|
|
||||||
public void onPlayerFall(LivingFallEvent event)
|
|
||||||
{
|
|
||||||
|
|
||||||
event.setCanceled(event.entity.worldObj.provider.dimensionId==mod_pocketDim.limboDimID);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ForgeSubscribe
|
|
||||||
public void onPlayerInteract(PlayerInteractEvent event)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(event.entityPlayer.worldObj.provider.dimensionId==mod_pocketDim.limboDimID&&event.action==PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
int x = event.x;
|
|
||||||
int y = event.y;
|
|
||||||
|
|
||||||
int z = event.z;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//need to propely separate client/server
|
|
||||||
int face = event.face;
|
|
||||||
switch (face) {
|
|
||||||
case 0: y = y-1;
|
|
||||||
break;
|
|
||||||
case 1: y=y+1;
|
|
||||||
break;
|
|
||||||
case 2: z=z-1;
|
|
||||||
break;
|
|
||||||
case 3: z=z+1;
|
|
||||||
break;
|
|
||||||
case 4: x=x-1;
|
|
||||||
break;
|
|
||||||
case 5: x=x+1 ;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(event.entityPlayer.getHeldItem()!=null)
|
|
||||||
{
|
|
||||||
if(event.entityPlayer.getHeldItem().getItem() instanceof ItemBlock)
|
|
||||||
{
|
|
||||||
// if(event.entityPlayer instanceof EntityPlayerMP)
|
|
||||||
{
|
|
||||||
|
|
||||||
Point3D point = new Point3D(x,y,z);
|
|
||||||
dimHelper.blocksToDecay.add(point);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
event.setCanceled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @ForgeSubscribe
|
|
||||||
public void onPlayerEvent(PlayerEvent event)
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
if(!event.entity.worldObj.isRemote)
|
|
||||||
{
|
|
||||||
ItemStack item = event.entityPlayer.inventory.getCurrentItem();
|
|
||||||
if(item!=null)
|
|
||||||
{
|
|
||||||
if(item.getItem() instanceof ItemRiftBlade)
|
|
||||||
{
|
|
||||||
List<EntityLiving> list = event.entity.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox( event.entityPlayer.posX-7,event.entityPlayer.posY-7, event.entityPlayer.posZ-7, event.entityPlayer.posX+7,event.entityPlayer.posY+7, event.entityPlayer.posZ+7));
|
|
||||||
list.remove(event.entity);
|
|
||||||
|
|
||||||
|
|
||||||
for(EntityLiving ent : list)
|
|
||||||
{
|
|
||||||
|
|
||||||
Vec3 var3 = event.entityPlayer.getLook(1.0F).normalize();
|
|
||||||
Vec3 var4 = event.entityPlayer.worldObj.getWorldVec3Pool().getVecFromPool(ent.posX - event.entityPlayer.posX, ent.boundingBox.minY + (double)((ent.height) / 2.0F) - ( event.entityPlayer.posY + (double) event.entityPlayer.getEyeHeight()), ent.posZ - event.entityPlayer.posZ);
|
|
||||||
double var5 = var4.lengthVector();
|
|
||||||
var4 = var4.normalize();
|
|
||||||
double var7 = var3.dotProduct(var4);
|
|
||||||
if( (var7+.1) > 1.0D - 0.025D / var5 ? event.entityPlayer.canEntityBeSeen(ent) : false)
|
|
||||||
{
|
|
||||||
System.out.println(list.size());
|
|
||||||
ItemRiftBlade.class.cast(item.getItem()).teleportToEntity(item,ent, event.entityPlayer);
|
|
||||||
break;
|
|
||||||
|
|
||||||
//ItemRiftBlade.class.cast(item.getItem()).teleportTo(event.entityPlayer, ent.posX, ent.posY, ent.posZ);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
**/
|
|
||||||
}
|
|
||||||
@ForgeSubscribe
|
|
||||||
public void onPlayerDrops(PlayerDropsEvent event)
|
|
||||||
{
|
|
||||||
mod_pocketDim.limboSpawnInventory=event.drops;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ForgeSubscribe
|
|
||||||
public void onWorldunload(WorldEvent.Unload event)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ForgeSubscribe
|
|
||||||
public void onWorldsave(WorldEvent.Save event)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(mod_pocketDim.hasInitDims&&event.world.provider.dimensionId==0)
|
|
||||||
{
|
|
||||||
dimHelper.instance.save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class ExitDoor extends dimDoor
|
|
||||||
{
|
|
||||||
|
|
||||||
protected ExitDoor(int par1, Material par2Material)
|
|
||||||
{
|
|
||||||
|
|
||||||
super(par1, Material.wood);
|
|
||||||
// this.blockIndexInTexture = 19;
|
|
||||||
this.setTextureFile("/PocketBlockTextures.png");
|
|
||||||
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTextureFile()
|
|
||||||
{
|
|
||||||
return "/PocketBlockTextures.png";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
if(!par1World.isRemote&&par1World.getBlockId(par2, par3-1, par4)==this.blockID)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
int locDimID=par1World.provider.dimensionId;
|
|
||||||
|
|
||||||
if(dimHelper.instance.dimList.containsKey(locDimID)&&dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)==null)
|
|
||||||
{
|
|
||||||
DimData dimData = dimHelper.dimList.get(locDimID);
|
|
||||||
int ExitDimID = dimData.exitDimLink.destDimID;
|
|
||||||
|
|
||||||
|
|
||||||
if(dimHelper.instance.getDimDepth(locDimID)==1)
|
|
||||||
{
|
|
||||||
//System.out.println("exitToOverowrld from "+String.valueOf(locDimID));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dimHelper.instance.createLink(locDimID, ExitDimID, par2, par3, par4, par2, par3, par4,par1World.getBlockMetadata(par2, par3-1, par4));
|
|
||||||
dimHelper.instance.createLink(ExitDimID, locDimID, par2, par3, par4, par2, par3, par4,dimHelper.instance.flipDoorMetadata(par1World.getBlockMetadata(par2, par3-1, par4)));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(dimHelper.dimList.get(par1World.provider.dimensionId).isPocket)
|
|
||||||
{
|
|
||||||
//System.out.println("Created new dim from "+String.valueOf(par1World.provider.dimensionId));
|
|
||||||
|
|
||||||
LinkData link = new LinkData(par1World.provider.dimensionId, 0, par2, par3, par4, par2, par3, par4, true);
|
|
||||||
link.linkOrientation= par1World.getBlockMetadata(par2, par3-1, par4);
|
|
||||||
dimHelper.instance.createPocket(link,false, false);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// dimHelper.instance.generatePocket(dimHelper.getWorld(destDimID), par2, par3, par4,par1World.getBlockMetadata(par2, par3-1, par4));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
|
|
||||||
{
|
|
||||||
|
|
||||||
//System.out.println("RiftPresent at "+String.valueOf(par1World.provider.dimensionId));
|
|
||||||
dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation=par1World.getBlockMetadata(par2, par3-1, par4);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return Item.doorWood.itemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int idDropped(int par1, Random par2Random, int par3)
|
|
||||||
{
|
|
||||||
return (par1 & 8) != 0 ? 0 : (Item.doorWood.itemID);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemDoor;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class ItemChaosDoor extends itemDimDoor
|
|
||||||
{
|
|
||||||
private Material doorMaterial;
|
|
||||||
|
|
||||||
public ItemChaosDoor(int par1, Material par2Material)
|
|
||||||
{
|
|
||||||
super(par1, par2Material);
|
|
||||||
this.doorMaterial = par2Material;
|
|
||||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getTextureFile()
|
|
||||||
{
|
|
||||||
return "/PocketBlockTextures.png";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
par3List.add("Caution- leads to random destination");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,403 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityLiving;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.item.EnumAction;
|
|
||||||
import net.minecraft.item.EnumToolMaterial;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import net.minecraft.util.Vec3;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class ItemRiftBlade extends itemDimDoor
|
|
||||||
{
|
|
||||||
private int weaponDamage;
|
|
||||||
private final EnumToolMaterial toolMaterial= EnumToolMaterial.GOLD;
|
|
||||||
private Material doorMaterial;
|
|
||||||
Random rand = new Random();
|
|
||||||
public ItemRiftBlade(int par1, Material par2Material)
|
|
||||||
{
|
|
||||||
super(par1, par2Material);
|
|
||||||
this.setMaxStackSize(1);
|
|
||||||
// this.setTextureFile("/PocketBlockTextures.png");
|
|
||||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
|
||||||
this.weaponDamage =8;
|
|
||||||
|
|
||||||
|
|
||||||
// this.iconIndex=5;
|
|
||||||
this.setMaxDamage(500);
|
|
||||||
this.hasSubtypes=false;
|
|
||||||
//TODO move to proxy
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public boolean hasEffect(ItemStack par1ItemStack)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
|
|
||||||
{
|
|
||||||
par1ItemStack.damageItem(1, par3EntityLiving);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public int getDamageVsEntity(Entity par1Entity)
|
|
||||||
{
|
|
||||||
return 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3)
|
|
||||||
{
|
|
||||||
float var4 = 1.0F;
|
|
||||||
float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4;
|
|
||||||
float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4;
|
|
||||||
double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4;
|
|
||||||
double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset;
|
|
||||||
double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4;
|
|
||||||
Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11);
|
|
||||||
float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI);
|
|
||||||
float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI);
|
|
||||||
float var16 = -MathHelper.cos(-var5 * 0.017453292F);
|
|
||||||
float var17 = MathHelper.sin(-var5 * 0.017453292F);
|
|
||||||
float var18 = var15 * var16;
|
|
||||||
float var20 = var14 * var16;
|
|
||||||
double var21 = 5.0D;
|
|
||||||
if (par2EntityPlayer instanceof EntityPlayerMP)
|
|
||||||
{
|
|
||||||
var21 = 7;
|
|
||||||
}
|
|
||||||
Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
|
|
||||||
return par1World.rayTraceBlocks_do_do(var13, var23, true, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected boolean teleportToEntity(ItemStack item, Entity par1Entity, EntityPlayer holder)
|
|
||||||
{
|
|
||||||
Vec3 var2 = holder.worldObj.getWorldVec3Pool().getVecFromPool(holder.posX - par1Entity.posX, holder.boundingBox.minY + (double)(holder.height / 2.0F) - par1Entity.posY + (double)par1Entity.getEyeHeight(), holder.posZ - par1Entity.posZ);
|
|
||||||
|
|
||||||
|
|
||||||
double cooef =( var2.lengthVector()-2.5)/var2.lengthVector();
|
|
||||||
var2.xCoord*=cooef;
|
|
||||||
var2.yCoord*=cooef;
|
|
||||||
var2.zCoord*=cooef;
|
|
||||||
double var5 = holder.posX - var2.xCoord;
|
|
||||||
double var9 = holder.posZ - var2.zCoord;
|
|
||||||
double var7 =holder.worldObj.getHeightValue(MathHelper.floor_double(var5), MathHelper.floor_double(var9));
|
|
||||||
if((Math.abs((holder.posY - var2.yCoord)-var7)>2))
|
|
||||||
{
|
|
||||||
|
|
||||||
var7 = MathHelper.floor_double(holder.posY - var2.yCoord) ;
|
|
||||||
|
|
||||||
int var14 = MathHelper.floor_double(var5);
|
|
||||||
int var15 = MathHelper.floor_double(var7);
|
|
||||||
int var16 = MathHelper.floor_double(var9);
|
|
||||||
while(!holder.worldObj.isAirBlock(var14, var15, var16))
|
|
||||||
{
|
|
||||||
var15++;
|
|
||||||
}
|
|
||||||
var7=var15;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
holder.setPositionAndUpdate(var5, var7, var9);
|
|
||||||
holder.playSound("mob.endermen.portal", 1.0F, 1.0F);
|
|
||||||
holder.worldObj.playSoundEffect(holder.posX, holder.posY, holder.posZ, "mob.endermen.portal", 1.0F, 1.0F);
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
||||||
{
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* How long it takes to use or consume an item
|
|
||||||
*/
|
|
||||||
public int getMaxItemUseDuration(ItemStack par1ItemStack)
|
|
||||||
{
|
|
||||||
return 72000;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnumAction getItemUseAction(ItemStack par1ItemStack)
|
|
||||||
{
|
|
||||||
return EnumAction.bow;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
if(dimHelper.dimList.get(par2World.provider.dimensionId)!=null&&!par2World.isRemote)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(this.getMaxItemUseDuration(par1ItemStack)-par4>12)
|
|
||||||
{
|
|
||||||
|
|
||||||
Vec3 var2 = par3EntityPlayer.getLook(1.0F);
|
|
||||||
|
|
||||||
double cooef = -2;
|
|
||||||
var2.xCoord*=cooef;
|
|
||||||
var2.yCoord*=cooef;
|
|
||||||
var2.zCoord*=cooef;
|
|
||||||
double var5 = par3EntityPlayer.posX - var2.xCoord;
|
|
||||||
double var9 = par3EntityPlayer.posZ - var2.zCoord;
|
|
||||||
double var7 =par3EntityPlayer.posY-var2.yCoord+2;
|
|
||||||
|
|
||||||
int x = MathHelper.floor_double(var5);
|
|
||||||
int y = MathHelper.floor_double(var7);
|
|
||||||
int z = MathHelper.floor_double(var9);
|
|
||||||
|
|
||||||
|
|
||||||
int rotation = (int) (MathHelper.floor_double((double)((par3EntityPlayer.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
|
||||||
LinkData link = new LinkData(par2World.provider.dimensionId, 0, x, y, z, x, y, z, true);
|
|
||||||
|
|
||||||
|
|
||||||
if(dimHelper.dimList.get(par2World.provider.dimensionId).depth==0)
|
|
||||||
{
|
|
||||||
link.linkOrientation= rotation;
|
|
||||||
dimHelper.instance.createPocket(link,true, false);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(dimHelper.dimList.get(par2World.provider.dimensionId).depth==1)
|
|
||||||
{
|
|
||||||
link.linkOrientation= rotation;
|
|
||||||
dimHelper.instance.createLink(link);
|
|
||||||
//System.out.println("doingup");
|
|
||||||
int ExitDimID= dimHelper.dimList.get(par2World.provider.dimensionId).exitDimLink.destDimID;
|
|
||||||
|
|
||||||
dimHelper.instance.createLink(link.locDimID, ExitDimID, x, y, z, x, y, z,rotation);
|
|
||||||
dimHelper.instance.createLink(ExitDimID, link.locDimID, x, y, z, x, y, z,dimHelper.instance.flipDoorMetadata(rotation));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(dimHelper.dimList.get(par2World.provider.dimensionId).isPocket)
|
|
||||||
{
|
|
||||||
link.linkOrientation= rotation;
|
|
||||||
dimHelper.instance.createPocket(link,false, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
placeDoorBlock(par2World, x, y-1, z, rotation, mod_pocketDim.transientDoor);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
||||||
{
|
|
||||||
Boolean didFindThing=false;
|
|
||||||
MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(par3EntityPlayer.worldObj, par3EntityPlayer, false );
|
|
||||||
if(hit!=null&&!par2World.isRemote)
|
|
||||||
{
|
|
||||||
if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ)==mod_pocketDim.blockRiftID)
|
|
||||||
{
|
|
||||||
LinkData link = dimHelper.instance.getLinkDataFromCoords(hit.blockX, hit.blockY, hit.blockZ, par2World);
|
|
||||||
if(link!=null)
|
|
||||||
{
|
|
||||||
|
|
||||||
Block var11 = mod_pocketDim.transientDoor;
|
|
||||||
int par4 = hit.blockX;
|
|
||||||
int par5 = hit.blockY-1;
|
|
||||||
int par6 = hit.blockZ;
|
|
||||||
int par7 = 0 ;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (par3EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par3EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)&&!par2World.isRemote)
|
|
||||||
{
|
|
||||||
int var12 = MathHelper.floor_double((double)((par3EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
|
||||||
|
|
||||||
if (!this.canPlace(par2World, par4, par5, par6, var12)||dimHelper.instance.getLinkDataFromCoords(par4, par5+1, par6, par2World)==null)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
placeDoorBlock(par2World, par4, par5, par6, var12, var11);
|
|
||||||
didFindThing=true;
|
|
||||||
|
|
||||||
|
|
||||||
par1ItemStack.damageItem(10, par3EntityPlayer);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ)==mod_pocketDim.transientDoorID)
|
|
||||||
{
|
|
||||||
didFindThing=true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!par3EntityPlayer.worldObj.isRemote)
|
|
||||||
{
|
|
||||||
List<EntityLiving> list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox( par3EntityPlayer.posX-8,par3EntityPlayer.posY-8, par3EntityPlayer.posZ-8, par3EntityPlayer.posX+8,par3EntityPlayer.posY+8, par3EntityPlayer.posZ+8));
|
|
||||||
list.remove(par3EntityPlayer);
|
|
||||||
|
|
||||||
|
|
||||||
for(EntityLiving ent : list)
|
|
||||||
{
|
|
||||||
|
|
||||||
Vec3 var3 = par3EntityPlayer.getLook(1.0F).normalize();
|
|
||||||
Vec3 var4 = par3EntityPlayer.worldObj.getWorldVec3Pool().getVecFromPool(ent.posX - par3EntityPlayer.posX, ent.boundingBox.minY + (double)((ent.height) / 2.0F) - ( par3EntityPlayer.posY + (double) par3EntityPlayer.getEyeHeight()), ent.posZ - par3EntityPlayer.posZ);
|
|
||||||
double var5 = var4.lengthVector();
|
|
||||||
var4 = var4.normalize();
|
|
||||||
double var7 = var3.dotProduct(var4);
|
|
||||||
if( (var7+.1) > 1.0D - 0.025D / var5 ? par3EntityPlayer.canEntityBeSeen(ent) : false)
|
|
||||||
{
|
|
||||||
System.out.println(list.size());
|
|
||||||
ItemRiftBlade.class.cast(par1ItemStack.getItem()).teleportToEntity(par1ItemStack,ent, par3EntityPlayer);
|
|
||||||
didFindThing=true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
//ItemRiftBlade.class.cast(item.getItem()).teleportTo(event.entityPlayer, ent.posX, ent.posY, ent.posZ);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
// if(dimHelper.dimList.get(par2World.provider.dimensionId)!=null&&!par2World.isRemote&&!didFindThing)
|
|
||||||
{
|
|
||||||
|
|
||||||
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return par1ItemStack;
|
|
||||||
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getTextureFile()
|
|
||||||
{
|
|
||||||
return "/PocketBlockTextures.png";
|
|
||||||
}
|
|
||||||
public int getItemEnchantability()
|
|
||||||
{
|
|
||||||
return EnumToolMaterial.GOLD.getEnchantability();
|
|
||||||
}
|
|
||||||
public String func_77825_f()
|
|
||||||
{
|
|
||||||
return EnumToolMaterial.GOLD.toString();
|
|
||||||
}
|
|
||||||
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
|
||||||
{
|
|
||||||
if (par7 != 1)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++par5;
|
|
||||||
Block var11;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var11 = mod_pocketDim.transientDoor;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)&&!par3World.isRemote)
|
|
||||||
{
|
|
||||||
int var12 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
|
||||||
|
|
||||||
if (!this.canPlace(par3World, par4, par5, par6, var12)||dimHelper.instance.getLinkDataFromCoords(par4, par5+1, par6, par3World)==null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
placeDoorBlock(par3World, par4, par5, par6, var12, var11);
|
|
||||||
|
|
||||||
|
|
||||||
par1ItemStack.damageItem(10, par2EntityPlayer);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* allows items to add custom lines of information to the mouseover description
|
|
||||||
*/
|
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
par3List.add("Opens a temporary doors,");
|
|
||||||
par3List.add ("special teleport attack,");
|
|
||||||
par3List.add ("and rotates existing doors");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
||||||
{
|
|
||||||
if(!par2World.isRemote)
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
//creates the first half of the link on item creation
|
|
||||||
int key= dimHelper.instance.createUniqueInterDimLinkKey();
|
|
||||||
LinkData linkData= new LinkData(par2World.provider.dimensionId,MathHelper.floor_double(par3EntityPlayer.posX),MathHelper.floor_double(par3EntityPlayer.posY),MathHelper.floor_double(par3EntityPlayer.posZ));
|
|
||||||
System.out.println(key);
|
|
||||||
|
|
||||||
dimHelper.instance.interDimLinkList.put(key, linkData);
|
|
||||||
par1ItemStack.setItemDamage(key);
|
|
||||||
**/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class ItemStableFabric extends Item
|
|
||||||
{
|
|
||||||
private Material doorMaterial;
|
|
||||||
|
|
||||||
public ItemStableFabric(int par1, int par2)
|
|
||||||
{
|
|
||||||
super(par1);
|
|
||||||
this.setCreativeTab(CreativeTabs.tabRedstone);
|
|
||||||
// this.setIconIndex(Item.doorWood.getIconFromDamage(0));
|
|
||||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
|
||||||
{
|
|
||||||
|
|
||||||
System.out.println("Block metadata is "+par3World.getBlockMetadata(par4, par5, par6));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getTextureFile()
|
|
||||||
{
|
|
||||||
return "/PocketBlockTextures.png";
|
|
||||||
}
|
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,440 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EnumCreatureType;
|
|
||||||
import net.minecraft.util.IProgressUpdate;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.ChunkPosition;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
|
||||||
import net.minecraft.world.chunk.Chunk;
|
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
|
||||||
import net.minecraft.world.gen.ChunkProviderGenerate;
|
|
||||||
import net.minecraft.world.gen.MapGenBase;
|
|
||||||
import net.minecraft.world.gen.MapGenRavine;
|
|
||||||
import net.minecraft.world.gen.NoiseGeneratorOctaves;
|
|
||||||
import net.minecraft.world.gen.feature.MapGenScatteredFeature;
|
|
||||||
import net.minecraft.world.gen.structure.MapGenMineshaft;
|
|
||||||
import net.minecraft.world.gen.structure.MapGenStronghold;
|
|
||||||
import net.minecraft.world.gen.structure.MapGenVillage;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.event.Event.Result;
|
|
||||||
import net.minecraftforge.event.terraingen.ChunkProviderEvent;
|
|
||||||
|
|
||||||
public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvider
|
|
||||||
{
|
|
||||||
private Random rand;
|
|
||||||
|
|
||||||
/** A NoiseGeneratorOctaves used in generating terrain */
|
|
||||||
private NoiseGeneratorOctaves noiseGen1;
|
|
||||||
|
|
||||||
/** A NoiseGeneratorOctaves used in generating terrain */
|
|
||||||
private NoiseGeneratorOctaves noiseGen2;
|
|
||||||
|
|
||||||
/** A NoiseGeneratorOctaves used in generating terrain */
|
|
||||||
private NoiseGeneratorOctaves noiseGen3;
|
|
||||||
|
|
||||||
/** A NoiseGeneratorOctaves used in generating terrain */
|
|
||||||
private NoiseGeneratorOctaves noiseGen4;
|
|
||||||
|
|
||||||
/** A NoiseGeneratorOctaves used in generating terrain */
|
|
||||||
public NoiseGeneratorOctaves noiseGen5;
|
|
||||||
|
|
||||||
public World world;
|
|
||||||
private final byte[] field_82700_c = new byte[256];
|
|
||||||
private final byte[] field_82698_d = new byte[256];
|
|
||||||
|
|
||||||
/** A NoiseGeneratorOctaves used in generating terrain */
|
|
||||||
public NoiseGeneratorOctaves noiseGen6;
|
|
||||||
public NoiseGeneratorOctaves mobSpawnerNoise;
|
|
||||||
|
|
||||||
/** Reference to the World object. */
|
|
||||||
private World worldObj;
|
|
||||||
|
|
||||||
/** are map structures going to be generated (e.g. strongholds) */
|
|
||||||
private final boolean mapFeaturesEnabled = false;
|
|
||||||
|
|
||||||
/** Holds the overall noise array used in chunk generation */
|
|
||||||
private double[] noiseArray;
|
|
||||||
private double[] stoneNoise = new double[256];
|
|
||||||
private MapGenBase caveGenerator = new CustomCaveGen();
|
|
||||||
|
|
||||||
/** Holds Stronghold Generator */
|
|
||||||
private MapGenStronghold strongholdGenerator = new MapGenStronghold();
|
|
||||||
|
|
||||||
/** Holds Village Generator */
|
|
||||||
private MapGenVillage villageGenerator = new MapGenVillage();
|
|
||||||
|
|
||||||
/** Holds Mineshaft Generator */
|
|
||||||
private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();
|
|
||||||
private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();
|
|
||||||
|
|
||||||
/** Holds ravine generator */
|
|
||||||
private MapGenBase ravineGenerator = new MapGenRavine();
|
|
||||||
|
|
||||||
/** The biomes that are used to generate the chunk */
|
|
||||||
private BiomeGenBase[] biomesForGeneration = new BiomeGenBase[1];
|
|
||||||
|
|
||||||
/** A double array that hold terrain noise from noiseGen3 */
|
|
||||||
double[] noise3;
|
|
||||||
|
|
||||||
/** A double array that hold terrain noise */
|
|
||||||
double[] noise1;
|
|
||||||
|
|
||||||
/** A double array that hold terrain noise from noiseGen2 */
|
|
||||||
double[] noise2;
|
|
||||||
|
|
||||||
/** A double array that hold terrain noise from noiseGen5 */
|
|
||||||
double[] noise5;
|
|
||||||
|
|
||||||
/** A double array that holds terrain noise from noiseGen6 */
|
|
||||||
double[] noise6;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used to store the 5x5 parabolic field that is used during terrain generation.
|
|
||||||
*/
|
|
||||||
float[] parabolicField;
|
|
||||||
int[][] field_73219_j = new int[32][32];
|
|
||||||
{
|
|
||||||
// caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, CAVE);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public LimboGenerator(World par1World, long par2)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
super(par1World, par2, false);
|
|
||||||
//par2 = 90899090;
|
|
||||||
this.rand = new Random(par2);
|
|
||||||
this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16); //base terrain
|
|
||||||
this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16); //hillyness
|
|
||||||
this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 80); //seems to adjust the size of features, how stretched things are -default 8
|
|
||||||
this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
|
|
||||||
this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
|
|
||||||
this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
|
|
||||||
this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
|
|
||||||
|
|
||||||
NoiseGeneratorOctaves[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise};
|
|
||||||
// noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.rand, noiseGens);
|
|
||||||
this.noiseGen1 = noiseGens[0];
|
|
||||||
this.noiseGen2 = noiseGens[1];
|
|
||||||
this.noiseGen3 = noiseGens[2];
|
|
||||||
this.noiseGen4 = noiseGens[3];
|
|
||||||
this.noiseGen5 = noiseGens[4];
|
|
||||||
this.noiseGen6 = noiseGens[5];
|
|
||||||
this.mobSpawnerNoise = noiseGens[6];
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
this.worldObj=par1World;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean chunkExists(int var1, int var2) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.chunkExists(var1, var2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Chunk provideChunk(int par1, int par2)
|
|
||||||
{
|
|
||||||
this.rand.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);
|
|
||||||
byte[] var3 = new byte[32768];
|
|
||||||
this.generateTerrain(par1, par2, var3);
|
|
||||||
this.caveGenerator.generate(this, this.worldObj, par1, par2, var3);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Chunk var4 = new Chunk(this.worldObj, var3, par1, par2);
|
|
||||||
|
|
||||||
|
|
||||||
var4.generateSkylightMap();
|
|
||||||
return var4;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public Chunk loadChunk(int var1, int var2) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.provideChunk(var1, var2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void populate(IChunkProvider var1, int var2, int var3) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean saveChunks(boolean var1, IProgressUpdate var2) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.saveChunks(var1, var2);
|
|
||||||
}
|
|
||||||
private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7)
|
|
||||||
{
|
|
||||||
ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, par1ArrayOfDouble, par2, par3, par4, par5, par6, par7);
|
|
||||||
MinecraftForge.EVENT_BUS.post(event);
|
|
||||||
if (event.getResult() == Result.DENY) return event.noisefield;
|
|
||||||
|
|
||||||
if (par1ArrayOfDouble == null)
|
|
||||||
{
|
|
||||||
par1ArrayOfDouble = new double[par5 * par6 * par7];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.parabolicField == null)
|
|
||||||
{
|
|
||||||
this.parabolicField = new float[25];
|
|
||||||
|
|
||||||
for (int var8 = -2; var8 <= 2; ++var8)
|
|
||||||
{
|
|
||||||
for (int var9 = -2; var9 <= 2; ++var9)
|
|
||||||
{
|
|
||||||
float var10 = 10.0F / MathHelper.sqrt_float((float)(var8 * var8 + var9 * var9) + 0.2F);
|
|
||||||
this.parabolicField[var8 + 2 + (var9 + 2) * 5] = var10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
double var44 = 884.412D; //large values here create spiky land. add a 0, good -default 884
|
|
||||||
double var45 = 9840.412D; //large values here make sheets- default - 684
|
|
||||||
this.noise5 = this.noiseGen5.generateNoiseOctaves(this.noise5, par2, par4, par5, par7, 1.121D, 1.121D, 0.5D);
|
|
||||||
this.noise6 = this.noiseGen6.generateNoiseOctaves(this.noise6, par2, par4, par5, par7, 200.0D, 200.0D, 0.5D);
|
|
||||||
this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, par2, par3, par4, par5, par6, par7, var44 / 80.0D, var45 / 160.0D, var44 / 80.0D);
|
|
||||||
this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, par2, par3, par4, par5, par6, par7, var44, var45, var44);
|
|
||||||
this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, par2, par3, par4, par5, par6, par7, var44, var45, var44);
|
|
||||||
boolean var43 = false;
|
|
||||||
boolean var42 = false;
|
|
||||||
int var12 = 0;
|
|
||||||
int var13 = 0;
|
|
||||||
|
|
||||||
for (int var14 = 0; var14 < par5; ++var14)
|
|
||||||
{
|
|
||||||
for (int var15 = 0; var15 < par7; ++var15)
|
|
||||||
{
|
|
||||||
float var16 = 0.0F;
|
|
||||||
float var17 = 0.0F;
|
|
||||||
float var18 = 0.0F;
|
|
||||||
byte var19 = 2;
|
|
||||||
BiomeGenBase var20 = this.biomesForGeneration[var14 + 2 + (var15 + 2) * (par5 + 5)];
|
|
||||||
|
|
||||||
for (int var21 = -var19; var21 <= var19; ++var21)
|
|
||||||
{
|
|
||||||
for (int var22 = -var19; var22 <= var19; ++var22)
|
|
||||||
{
|
|
||||||
float var24 = this.parabolicField[var21 + 2 + (var22 + 2) * 5] / (BiomeGenBase.plains.minHeight + 9.0F);
|
|
||||||
|
|
||||||
|
|
||||||
//this adjusts the height of the terrain
|
|
||||||
|
|
||||||
var16 += BiomeGenBase.plains.maxHeight * var24+4;
|
|
||||||
var17 += BiomeGenBase.plains.minHeight * var24-1;
|
|
||||||
var18 += var24;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var16 /= var18;
|
|
||||||
var17 /= var18;
|
|
||||||
var16 = (var16 * 0.9F + 0.1F);
|
|
||||||
var17 = (var17 * 4.0F - 1.0F) / 8.0F;
|
|
||||||
double var47 = this.noise6[var13] / 8000.0D;
|
|
||||||
|
|
||||||
if (var47 < 0.0D)
|
|
||||||
{
|
|
||||||
var47 = -var47 * 0.3D;
|
|
||||||
}
|
|
||||||
|
|
||||||
var47 = var47 * 3.0D - 2.0D;
|
|
||||||
|
|
||||||
if (var47 < 0.0D)
|
|
||||||
{
|
|
||||||
var47 /= 2.0D;
|
|
||||||
|
|
||||||
if (var47 < -1.0D)
|
|
||||||
{
|
|
||||||
var47 = -1.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
var47 /= 1.4D;
|
|
||||||
var47 /= 2.0D;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (var47 > 1.0D)
|
|
||||||
{
|
|
||||||
var47 = 1.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
var47 /= 8.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
++var13;
|
|
||||||
|
|
||||||
for (int var46 = 0; var46 < par6; ++var46)
|
|
||||||
{
|
|
||||||
double var48 = (double)var17;
|
|
||||||
double var26 = (double)var16;
|
|
||||||
var48 += var47 * 0.2D;
|
|
||||||
var48 = var48 * (double)par6 / 16.0D;
|
|
||||||
double var28 = (double)par6 / 2.0D + var48 * 4.0D;
|
|
||||||
double var30 = 0.0D;
|
|
||||||
double var32 = ((double)var46 - var28) * 12.0D * 128.0D / 128.0D / var26;
|
|
||||||
|
|
||||||
if (var32 < 0.0D)
|
|
||||||
{
|
|
||||||
var32 *= 4.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
double var34 = this.noise1[var12] / 512.0D;
|
|
||||||
double var36 = this.noise2[var12] / 512.0D;
|
|
||||||
double var38 = (this.noise3[var12] / 10.0D + 1.0D) / 2.0D;
|
|
||||||
|
|
||||||
if (var38 < 0.0D)
|
|
||||||
{
|
|
||||||
var30 = var34;
|
|
||||||
}
|
|
||||||
else if (var38 > 1.0D)
|
|
||||||
{
|
|
||||||
var30 = var36;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var30 = var34 + (var36 - var34) * var38;
|
|
||||||
}
|
|
||||||
|
|
||||||
var30 -= var32;
|
|
||||||
|
|
||||||
if (var46 > par6 - 4)
|
|
||||||
{
|
|
||||||
double var40 = (double)((float)(var46 - (par6 - 4)) / 3.0F);
|
|
||||||
var30 = var30 * (1.0D - var40) + -10.0D * var40;
|
|
||||||
}
|
|
||||||
|
|
||||||
par1ArrayOfDouble[var12] = var30;
|
|
||||||
++var12;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1ArrayOfDouble;
|
|
||||||
}
|
|
||||||
public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte)
|
|
||||||
{
|
|
||||||
byte var4 = 4;
|
|
||||||
byte var5 = 16;
|
|
||||||
byte var6 = 16;
|
|
||||||
int var7 = var4 + 1;
|
|
||||||
byte var8 = 17;
|
|
||||||
int var9 = var4 + 1;
|
|
||||||
this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, par1 * 4 - 2, par2 * 4 - 2, var7 + 5, var9 + 5);
|
|
||||||
this.noiseArray = this.initializeNoiseField(this.noiseArray, par1 * var4, 0, par2 * var4, var7, var8, var9);
|
|
||||||
|
|
||||||
for (int var10 = 0; var10 < var4; ++var10)
|
|
||||||
{
|
|
||||||
for (int var11 = 0; var11 < var4; ++var11)
|
|
||||||
{
|
|
||||||
for (int var12 = 0; var12 < var5; ++var12)
|
|
||||||
{
|
|
||||||
double var13 = 0.125D;
|
|
||||||
double var15 = this.noiseArray[((var10 + 0) * var9 + var11 + 0) * var8 + var12 + 0];
|
|
||||||
double var17 = this.noiseArray[((var10 + 0) * var9 + var11 + 1) * var8 + var12 + 0];
|
|
||||||
double var19 = this.noiseArray[((var10 + 1) * var9 + var11 + 0) * var8 + var12 + 0];
|
|
||||||
double var21 = this.noiseArray[((var10 + 1) * var9 + var11 + 1) * var8 + var12 + 0];
|
|
||||||
double var23 = (this.noiseArray[((var10 + 0) * var9 + var11 + 0) * var8 + var12 + 1] - var15) * var13;
|
|
||||||
double var25 = (this.noiseArray[((var10 + 0) * var9 + var11 + 1) * var8 + var12 + 1] - var17) * var13;
|
|
||||||
double var27 = (this.noiseArray[((var10 + 1) * var9 + var11 + 0) * var8 + var12 + 1] - var19) * var13;
|
|
||||||
double var29 = (this.noiseArray[((var10 + 1) * var9 + var11 + 1) * var8 + var12 + 1] - var21) * var13;
|
|
||||||
|
|
||||||
for (int var31 = 0; var31 < 8; ++var31)
|
|
||||||
{
|
|
||||||
double var32 = 0.25D;
|
|
||||||
double var34 = var15;
|
|
||||||
double var36 = var17;
|
|
||||||
double var38 = (var19 - var15) * var32;
|
|
||||||
double var40 = (var21 - var17) * var32;
|
|
||||||
|
|
||||||
for (int var42 = 0; var42 < 4; ++var42)
|
|
||||||
{
|
|
||||||
int var43 = var42 + var10 * 4 << 11 | 0 + var11 * 4 << 7 | var12 * 8 + var31;
|
|
||||||
short var44 = 128;
|
|
||||||
var43 -= var44;
|
|
||||||
double var45 = 0.25D;
|
|
||||||
double var49 = (var36 - var34) * var45;
|
|
||||||
double var47 = var34 - var49;
|
|
||||||
|
|
||||||
for (int var51 = 0; var51 < 4; ++var51)
|
|
||||||
{
|
|
||||||
if ((var47 += var49) > 0.0D)
|
|
||||||
{
|
|
||||||
par3ArrayOfByte[var43 += var44] = (byte)mod_pocketDim.blockLimboID;
|
|
||||||
}
|
|
||||||
else if (var12 * 8 + var31 < var6)
|
|
||||||
{
|
|
||||||
par3ArrayOfByte[var43 += var44] = (byte)mod_pocketDim.blockDimWallPermID;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
par3ArrayOfByte[var43 += var44] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var34 += var38;
|
|
||||||
var36 += var40;
|
|
||||||
}
|
|
||||||
|
|
||||||
var15 += var23;
|
|
||||||
var17 += var25;
|
|
||||||
var19 += var27;
|
|
||||||
var21 += var29;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean unload100OldestChunks() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.unload100OldestChunks();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canSave() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.canSave();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String makeString() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.makeString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3,
|
|
||||||
int var4) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ChunkPosition findClosestStructure(World var1, String var2,
|
|
||||||
int var3, int var4, int var5) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLoadedChunkCount() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.getLoadedChunkCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void recreateStructures(int var1, int var2) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,165 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.util.ChunkCoordinates;
|
|
||||||
import net.minecraft.util.Vec3;
|
|
||||||
import net.minecraft.world.EnumGameType;
|
|
||||||
import net.minecraft.world.WorldProvider;
|
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
|
|
||||||
public class LimboProvider extends WorldProvider
|
|
||||||
{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDimensionName() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return "Limbo";
|
|
||||||
}
|
|
||||||
|
|
||||||
public int exitXCoord;
|
|
||||||
public int exitYCoord;
|
|
||||||
public int exitZCoord;
|
|
||||||
public int exitDimID;
|
|
||||||
public LimboProvider()
|
|
||||||
{
|
|
||||||
this.hasNoSky=true;
|
|
||||||
// super.setAllowedSpawnTypes(false, false);
|
|
||||||
|
|
||||||
}
|
|
||||||
public boolean canRespawnHere()
|
|
||||||
{
|
|
||||||
|
|
||||||
return mod_pocketDim.hardcoreLimbo&&mod_pocketDim.isLimboActive;
|
|
||||||
}
|
|
||||||
public boolean isBlockHighHumidity(int x, int y, int z)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canSnowAt(int x, int y, int z)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void generateLightBrightnessTable()
|
|
||||||
{
|
|
||||||
float modifier = 0.0F;
|
|
||||||
|
|
||||||
for (int steps = 0; steps <= 15; ++steps)
|
|
||||||
{
|
|
||||||
float var3 = 1.0F - (float)steps / 15.0F;
|
|
||||||
this.lightBrightnessTable[steps] = ((0.0F + var3) / (var3 * 3.0F + 1.0F) * (1.0F - modifier) + modifier)*3;
|
|
||||||
// System.out.println( this.lightBrightnessTable[steps]+"light");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful)
|
|
||||||
{
|
|
||||||
super.setAllowedSpawnTypes(false, false);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public float calculateCelestialAngle(long par1, float par3)
|
|
||||||
{
|
|
||||||
int var4 = (int)(par1 % 24000L);
|
|
||||||
float var5 = ((float)var4 + par3) / 24000.0F - 0.25F;
|
|
||||||
|
|
||||||
if (var5 < 0.0F)
|
|
||||||
{
|
|
||||||
++var5;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var5 > 1.0F)
|
|
||||||
{
|
|
||||||
--var5;
|
|
||||||
}
|
|
||||||
|
|
||||||
float var6 = var5;
|
|
||||||
var5 = 1.0F - (float)((Math.cos((double)var5 * Math.PI) + 1.0D) / 2.0D);
|
|
||||||
var5 = var6 + (var5 - var6) / 3.0F;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public int getMoonPhase(long par1, float par3)
|
|
||||||
{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public String getSaveFolder()
|
|
||||||
{
|
|
||||||
return (dimensionId == 0 ? null : "DimensionalDoors/Limbo" + dimensionId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canCoordinateBeSpawn(int par1, int par2)
|
|
||||||
{
|
|
||||||
int var3 = this.worldObj.getFirstUncoveredBlock(par1, par2);
|
|
||||||
return var3 == mod_pocketDim.blockLimboID;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public double getHorizon()
|
|
||||||
{
|
|
||||||
return worldObj.getHeight()/4-800;
|
|
||||||
}
|
|
||||||
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
|
|
||||||
{
|
|
||||||
setCloudRenderer( new CloudRenderBlank());
|
|
||||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
|
||||||
|
|
||||||
}
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public Vec3 getFogColor(float par1, float par2)
|
|
||||||
{
|
|
||||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double).2, (double).2, (double).2);
|
|
||||||
|
|
||||||
}
|
|
||||||
public int getRespawnDimension(EntityPlayerMP player)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IChunkProvider createChunkGenerator()
|
|
||||||
{
|
|
||||||
return new LimboGenerator(worldObj, 45);
|
|
||||||
}
|
|
||||||
public boolean canBlockFreeze(int x, int y, int z, boolean byWater)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ChunkCoordinates getRandomizedSpawnPoint()
|
|
||||||
{
|
|
||||||
ChunkCoordinates var5 = new ChunkCoordinates(this.worldObj.getSpawnPoint());
|
|
||||||
|
|
||||||
|
|
||||||
int spawnFuzz = 10000;
|
|
||||||
int spawnFuzzHalf = spawnFuzz / 2;
|
|
||||||
|
|
||||||
{
|
|
||||||
var5.posX += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
|
||||||
var5.posZ += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
|
||||||
var5.posY = 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
return var5;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
public class LinkData implements Serializable
|
|
||||||
{
|
|
||||||
|
|
||||||
public int locXCoord;
|
|
||||||
public int locYCoord;
|
|
||||||
public int locZCoord;
|
|
||||||
|
|
||||||
public int destXCoord;
|
|
||||||
public int destYCoord;
|
|
||||||
public int destZCoord;
|
|
||||||
public int numberofChildren;
|
|
||||||
public boolean isLocPocket;
|
|
||||||
public int linkOrientation;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public int destDimID;
|
|
||||||
public int locDimID;
|
|
||||||
|
|
||||||
public boolean exists=false;
|
|
||||||
public boolean hasGennedDoor=false;
|
|
||||||
|
|
||||||
static final long serialVersionUID = 45544342L;
|
|
||||||
|
|
||||||
|
|
||||||
public LinkData()
|
|
||||||
{
|
|
||||||
this.exists=false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinkData(int exitLinkDimID, int exitX, int exitY, int exitZ)
|
|
||||||
{
|
|
||||||
this.destDimID=exitLinkDimID;
|
|
||||||
this.destXCoord=exitX;
|
|
||||||
this.destYCoord=exitY;
|
|
||||||
this.destZCoord=exitZ;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinkData(int locationDimID, int destinationDimID, int locationXCoord, int locationYCoord, int locationZCoord, int destinationXCoord, int destinationYCoord, int destinationZCoord, boolean isPocket)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.exists=true;
|
|
||||||
this.locXCoord=locationXCoord;
|
|
||||||
this.locYCoord=locationYCoord;
|
|
||||||
this.locZCoord=locationZCoord;
|
|
||||||
|
|
||||||
this.destXCoord=destinationXCoord;
|
|
||||||
this.destYCoord=destinationYCoord;
|
|
||||||
this.destZCoord=destinationZCoord;
|
|
||||||
|
|
||||||
this.destDimID=destinationDimID;
|
|
||||||
this.locDimID=locationDimID;
|
|
||||||
this.isLocPocket=isPocket;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void printLinkData()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
System.out.println(String.valueOf(this.locDimID)+"locDimID "+String.valueOf(this.locXCoord)+"-locXCoord "+String.valueOf(this.locYCoord)+"-locYCoord "+String.valueOf(this.locZCoord)+"-locZCoord ");
|
|
||||||
System.out.println(String.valueOf(this.destDimID)+"DestDimID "+String.valueOf(this.destXCoord)+"-destXCoord "+String.valueOf(this.destYCoord)+"-destYCoord "+String.valueOf(this.destZCoord)+"-destZCoord ");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
//doesnt do anything
|
|
||||||
@@ -1,414 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.DataOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.ObjectOutputStream;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
|
|
||||||
import net.minecraft.network.INetworkManager;
|
|
||||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
|
||||||
|
|
||||||
import com.google.common.io.ByteArrayDataInput;
|
|
||||||
import com.google.common.io.ByteStreams;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.IPacketHandler;
|
|
||||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
|
||||||
import cpw.mods.fml.common.network.Player;
|
|
||||||
|
|
||||||
public class PacketHandler implements IPacketHandler
|
|
||||||
{
|
|
||||||
public static int regsiterDimPacketID = 3;
|
|
||||||
public static int registerLinkPacketID = 4;
|
|
||||||
public static int removeLinkPacketID = 5;
|
|
||||||
public static int linkKeyPacketID = 7;
|
|
||||||
public static int dimPacketID = 6;
|
|
||||||
|
|
||||||
|
|
||||||
public static int dimUpdatePacketID = 1;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (packet.channel.equals("GenericRandom"))
|
|
||||||
{
|
|
||||||
handleRandom(packet,player);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void handleRandom(Packet250CustomPayload packet, Player player)
|
|
||||||
{
|
|
||||||
ByteArrayDataInput data = ByteStreams.newDataInput(packet.data);
|
|
||||||
|
|
||||||
int id=data.readByte();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(id==regsiterDimPacketID)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int dimId = data.readInt();
|
|
||||||
// System.out.println("regsitered dim ID" + dimId);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
DimData dimDataToAdd = new DimData(dimId, data.readBoolean(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt());
|
|
||||||
|
|
||||||
if(!dimHelper.dimList.containsKey(dimId))
|
|
||||||
{
|
|
||||||
dimHelper.dimList.put(dimId, dimDataToAdd);
|
|
||||||
}
|
|
||||||
if(dimDataToAdd.isPocket)
|
|
||||||
{
|
|
||||||
dimHelper.registerDimension(dimId, mod_pocketDim.providerID);
|
|
||||||
//System.out.println("regsitered dim ID" + dimId);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
// e.printStackTrace();
|
|
||||||
if(dimId!=0)
|
|
||||||
{
|
|
||||||
// System.out.println(String.valueOf(dimId)+"dimID already registered");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id==registerLinkPacketID)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int dimId = data.readInt();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
DimData dimDataToAddLink= dimHelper.dimList.get(dimId);
|
|
||||||
|
|
||||||
LinkData linkToAdd = new LinkData(dimId, data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readBoolean());
|
|
||||||
linkToAdd.hasGennedDoor=data.readBoolean();
|
|
||||||
linkToAdd.linkOrientation=data.readInt();
|
|
||||||
|
|
||||||
dimHelper.instance.createLink(linkToAdd);
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
System.out.println("Tried to update client link data & failed!");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
if(id==removeLinkPacketID)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int dimId = data.readInt();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
DimData dimDataToRemoveFrom= dimHelper.dimList.get(dimId);
|
|
||||||
|
|
||||||
LinkData linkToAdd = new LinkData(dimId, data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readBoolean());
|
|
||||||
dimDataToRemoveFrom.removeLinkAtCoords(linkToAdd.locDimID, linkToAdd.locXCoord,linkToAdd.locYCoord, linkToAdd.locZCoord);
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
//e.printStackTrace();
|
|
||||||
System.out.println("Tried to update client link data & failed!");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
if(id==this.linkKeyPacketID)
|
|
||||||
{
|
|
||||||
LinkData link = new LinkData(data.readInt(), data.readInt(), data.readInt(), data.readInt());
|
|
||||||
dimHelper.instance.interDimLinkList.put(data.readInt(), link);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onClientJoinPacket(INetworkManager manager, HashMap<Integer, DimData> dimList)
|
|
||||||
{
|
|
||||||
|
|
||||||
Collection<Integer> dimIDs= dimList.keySet();
|
|
||||||
Collection<DimData> dimDataSet= dimList.values();
|
|
||||||
Collection<Packet250CustomPayload> packetsToSend = new HashSet();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(DimData data : dimDataSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
manager.addToSendQueue(PacketHandler.onDimCreatedPacket(data));
|
|
||||||
|
|
||||||
Collection <HashMap<Integer, HashMap<Integer, LinkData>>> linkList = data.linksInThisDim.values();
|
|
||||||
|
|
||||||
for(HashMap map : linkList )
|
|
||||||
{
|
|
||||||
|
|
||||||
Collection <HashMap<Integer, LinkData>> linkList2 = map.values();
|
|
||||||
|
|
||||||
for(HashMap map2 : linkList2)
|
|
||||||
{
|
|
||||||
Collection <LinkData> linkList3 = map2.values();
|
|
||||||
|
|
||||||
for(LinkData link : linkList3)
|
|
||||||
{
|
|
||||||
|
|
||||||
packetsToSend.add(( PacketHandler.onLinkCreatedPacket(link)));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
for (Packet250CustomPayload packet : packetsToSend)
|
|
||||||
{
|
|
||||||
manager.addToSendQueue(packet);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static Packet250CustomPayload onLinkCreatedPacket(LinkData link)
|
|
||||||
{
|
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
||||||
DataOutputStream dataOut = new DataOutputStream(bos);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
dataOut.writeByte(PacketHandler.registerLinkPacketID);
|
|
||||||
dataOut.writeInt(link.locDimID);
|
|
||||||
dataOut.writeInt(link.destDimID);
|
|
||||||
dataOut.writeInt(link.locXCoord);
|
|
||||||
dataOut.writeInt(link.locYCoord);
|
|
||||||
dataOut.writeInt(link.locZCoord);
|
|
||||||
dataOut.writeInt(link.destXCoord);
|
|
||||||
dataOut.writeInt(link.destYCoord);
|
|
||||||
dataOut.writeInt(link.destZCoord);
|
|
||||||
dataOut.writeBoolean(link.isLocPocket);
|
|
||||||
dataOut.writeBoolean(link.hasGennedDoor);
|
|
||||||
dataOut.writeInt(link.linkOrientation);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
Packet250CustomPayload packet= new Packet250CustomPayload();
|
|
||||||
packet.channel="GenericRandom";
|
|
||||||
packet.data = bos.toByteArray();
|
|
||||||
packet.length = bos.size();;
|
|
||||||
PacketDispatcher.sendPacketToAllPlayers(packet);
|
|
||||||
return packet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static Packet250CustomPayload linkKeyPacket(LinkData link, int key)
|
|
||||||
{
|
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
||||||
DataOutputStream dataOut = new DataOutputStream(bos);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
dataOut.writeByte(PacketHandler.linkKeyPacketID);
|
|
||||||
|
|
||||||
dataOut.writeInt(link.destDimID);
|
|
||||||
dataOut.writeInt(link.destXCoord);
|
|
||||||
dataOut.writeInt(link.destYCoord);
|
|
||||||
dataOut.writeInt(link.destZCoord);
|
|
||||||
dataOut.writeInt(key);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
Packet250CustomPayload packet= new Packet250CustomPayload();
|
|
||||||
packet.channel="GenericRandom";
|
|
||||||
packet.data = bos.toByteArray();
|
|
||||||
packet.length = bos.size();;
|
|
||||||
PacketDispatcher.sendPacketToAllPlayers(packet);
|
|
||||||
return packet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void onLinkRemovedPacket(LinkData link)
|
|
||||||
{
|
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
||||||
DataOutputStream dataOut = new DataOutputStream(bos);
|
|
||||||
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
dataOut.writeByte(PacketHandler.removeLinkPacketID);
|
|
||||||
dataOut.writeInt(link.locDimID);
|
|
||||||
dataOut.writeInt(link.destDimID);
|
|
||||||
dataOut.writeInt(link.locXCoord);
|
|
||||||
dataOut.writeInt(link.locYCoord);
|
|
||||||
dataOut.writeInt(link.locZCoord);
|
|
||||||
dataOut.writeInt(link.destXCoord);
|
|
||||||
dataOut.writeInt(link.destYCoord);
|
|
||||||
dataOut.writeInt(link.destZCoord);
|
|
||||||
dataOut.writeBoolean(link.isLocPocket);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
Packet250CustomPayload packet= new Packet250CustomPayload();
|
|
||||||
packet.channel="GenericRandom";
|
|
||||||
packet.data = bos.toByteArray();
|
|
||||||
packet.length = bos.size();;
|
|
||||||
PacketDispatcher.sendPacketToAllPlayers(packet);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static Packet250CustomPayload onDimCreatedPacket(DimData data)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
||||||
DataOutputStream dataOut = new DataOutputStream(bos);
|
|
||||||
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
dataOut.writeByte(PacketHandler.regsiterDimPacketID);
|
|
||||||
dataOut.writeInt(data.dimID);
|
|
||||||
dataOut.writeBoolean(data.isPocket);
|
|
||||||
|
|
||||||
dataOut.writeInt(data.depth);
|
|
||||||
dataOut.writeInt(data.exitDimLink.destDimID);
|
|
||||||
dataOut.writeInt(data.exitDimLink.destXCoord);
|
|
||||||
dataOut.writeInt(data.exitDimLink.destYCoord);
|
|
||||||
dataOut.writeInt(data.exitDimLink.destZCoord);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
Packet250CustomPayload packet= new Packet250CustomPayload();
|
|
||||||
packet.channel="GenericRandom";
|
|
||||||
packet.data = bos.toByteArray();
|
|
||||||
packet.length = bos.size();
|
|
||||||
|
|
||||||
PacketDispatcher.sendPacketToAllPlayers(packet);
|
|
||||||
return packet;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
private void handleObjectPacket(Packet250CustomPayload packet, Player player)
|
|
||||||
{
|
|
||||||
ObjectInputStream data = new ObjectInputStream;
|
|
||||||
int length = data.readInt();
|
|
||||||
int id=data.readByte();
|
|
||||||
System.out.println(id);
|
|
||||||
if(id==dimPacketID)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
DimData dimData = data.read
|
|
||||||
|
|
||||||
dimHelper.dimList.put(key, value)
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
**/
|
|
||||||
public static void sendDimObject(DimData dim)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
||||||
ObjectOutputStream dataOut = new ObjectOutputStream(bos);
|
|
||||||
dataOut.writeObject(dim);
|
|
||||||
|
|
||||||
Packet250CustomPayload packet= new Packet250CustomPayload();
|
|
||||||
packet.channel="GenericRandom";
|
|
||||||
packet.data = bos.toByteArray();
|
|
||||||
packet.length = bos.size();;
|
|
||||||
PacketDispatcher.sendPacketToAllPlayers(packet);
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLiving;
|
|
||||||
import net.minecraft.entity.item.EntityItem;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.potion.Potion;
|
|
||||||
import net.minecraft.potion.PotionEffect;
|
|
||||||
import cpw.mods.fml.common.IPlayerTracker;
|
|
||||||
|
|
||||||
|
|
||||||
public class PlayerRespawnTracker implements IPlayerTracker
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPlayerLogin(EntityPlayer player) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPlayerLogout(EntityPlayer player) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPlayerChangedDimension(EntityPlayer player) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPlayerRespawn(EntityPlayer player)
|
|
||||||
{
|
|
||||||
if(player.worldObj.provider.dimensionId==mod_pocketDim.limboDimID)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(!player.worldObj.isRemote)
|
|
||||||
{
|
|
||||||
|
|
||||||
for(EntityItem drop : mod_pocketDim.limboSpawnInventory)
|
|
||||||
{
|
|
||||||
|
|
||||||
player.inventory.addItemStackToInventory(drop.getEntityItem());
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
public class Point3D implements Serializable {
|
|
||||||
|
|
||||||
private int x;
|
|
||||||
private int y;
|
|
||||||
private int z;
|
|
||||||
|
|
||||||
public Point3D(int x, int y,int z)
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
this.z = z;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getX()
|
|
||||||
{
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getY()
|
|
||||||
{
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getZ()
|
|
||||||
{
|
|
||||||
return z;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int setY(int y)
|
|
||||||
{
|
|
||||||
return this.y=y;
|
|
||||||
}
|
|
||||||
public int setX(int x)
|
|
||||||
{
|
|
||||||
return this. x=x;
|
|
||||||
}
|
|
||||||
public int setZ(int z)
|
|
||||||
{
|
|
||||||
return this. z=z;
|
|
||||||
}
|
|
||||||
public boolean equals(Object other)
|
|
||||||
{
|
|
||||||
boolean result = false;
|
|
||||||
if (other instanceof Point3D)
|
|
||||||
{
|
|
||||||
Point3D that = (Point3D) other;
|
|
||||||
result = (this.getX() == that.getX() && this.getY() == that.getY()&& this.getY() == that.getZ());
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.item.EntityMinecart;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.world.Teleporter;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.WorldServer;
|
|
||||||
|
|
||||||
public class RailTeleporter extends Teleporter
|
|
||||||
{
|
|
||||||
int x,y,z;
|
|
||||||
World world;
|
|
||||||
LinkData sendingLink;
|
|
||||||
|
|
||||||
|
|
||||||
public RailTeleporter(WorldServer par1WorldServer, LinkData link)
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
super(par1WorldServer);
|
|
||||||
this.x=link.destXCoord;
|
|
||||||
this.y=link.destYCoord;
|
|
||||||
this.z=link.destZCoord;
|
|
||||||
this.sendingLink=link;
|
|
||||||
world = par1WorldServer;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new portal near an entity.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
int id;
|
|
||||||
|
|
||||||
|
|
||||||
id=dimHelper.instance.getDestOrientation(sendingLink);
|
|
||||||
//System.out.println("Teleporting with link oreintation "+id);
|
|
||||||
|
|
||||||
|
|
||||||
par1Entity.rotationYaw=(id*90)+90;
|
|
||||||
if(id==2||id==6)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity, x+2.5, y, z+.5 );
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==3||id==7)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity, x+.5, y, z+2.5 );
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==0||id==4)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity,x-1.5, y, z+.5);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==1||id==5)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity,x+.5, y, z-1.5);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity,x, y, z);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
par1Entity.worldObj.updateEntityWithOptionalForce(par1Entity, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void setEntityPosition(Entity entity, double x, double y, double z)
|
|
||||||
{
|
|
||||||
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
|
||||||
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
|
|
||||||
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
|
||||||
entity.setPosition(x, y, z);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public boolean func_85188_a(Entity par1Entity)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void func_85189_a(long par1)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,251 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
|
||||||
|
|
||||||
public class RiftGenerator implements IWorldGenerator
|
|
||||||
{
|
|
||||||
private int minableBlockId;
|
|
||||||
private int numberOfBlocks;
|
|
||||||
int cycles=40;
|
|
||||||
boolean shouldSave = false;
|
|
||||||
int count = 0;
|
|
||||||
int i;
|
|
||||||
int k;
|
|
||||||
int j;
|
|
||||||
Random rand = new Random();
|
|
||||||
boolean shouldGenHere=true;
|
|
||||||
LinkData link;
|
|
||||||
|
|
||||||
|
|
||||||
DimData dimData;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
|
||||||
{
|
|
||||||
//Long ntime = System.nanoTime();
|
|
||||||
shouldGenHere=true;
|
|
||||||
|
|
||||||
if(world.provider.getDimensionName()=="PocketDim"||!mod_pocketDim.riftsInWorldGen ||world.isRemote)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.shouldGenHere=false;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(this.shouldGenHere)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
if(random.nextInt(3500)==0)
|
|
||||||
{
|
|
||||||
i=chunkX*16-random.nextInt(16);
|
|
||||||
k=chunkZ*16-random.nextInt(16);
|
|
||||||
|
|
||||||
j= world.getHeightValue(i, k);
|
|
||||||
|
|
||||||
if(j>20&&world.getBlockId(i, j, k)==0)
|
|
||||||
{
|
|
||||||
// System.out.println(String.valueOf(i)+"x "+String.valueOf(j)+"y "+String.valueOf(k)+"z"+"Large gen");
|
|
||||||
|
|
||||||
link = new LinkData(world.provider.dimensionId, 0, i, j+1, k, i, j+1, k, true);
|
|
||||||
link = dimHelper.instance.createPocket(link,true, true);
|
|
||||||
this.shouldSave=true;
|
|
||||||
|
|
||||||
|
|
||||||
// SchematicLoader loader = new SchematicLoader();
|
|
||||||
// loader.init(link);
|
|
||||||
// loader.generateSchematic(link);
|
|
||||||
|
|
||||||
|
|
||||||
count=0;
|
|
||||||
while(random.nextInt(4)!=1)
|
|
||||||
{
|
|
||||||
i=chunkX*16-random.nextInt(16);
|
|
||||||
k=chunkZ*16-random.nextInt(16);
|
|
||||||
|
|
||||||
j= world.getHeightValue(i, k);
|
|
||||||
|
|
||||||
if(world.isAirBlock(i, j+1, k))
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
link = dimHelper.instance.createLink(link.locDimID,link.destDimID, i, j+1, k,link.destXCoord,link.destYCoord,link.destZCoord);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(random.nextInt(540)==0)
|
|
||||||
{
|
|
||||||
i=chunkX*16-random.nextInt(16);
|
|
||||||
k=chunkZ*16-random.nextInt(16);
|
|
||||||
|
|
||||||
j= world.getHeightValue(i, k);
|
|
||||||
if(j>20&&world.getBlockId(i, j, k)==0)
|
|
||||||
{
|
|
||||||
//System.out.println(String.valueOf(i)+"x "+String.valueOf(j)+"y "+String.valueOf(k)+"z"+"med gen");
|
|
||||||
|
|
||||||
link = new LinkData(world.provider.dimensionId, 0, i, j+1, k, i, j+1, k, true);
|
|
||||||
link = dimHelper.instance.createPocket(link,true, true);
|
|
||||||
this.shouldSave=true;
|
|
||||||
|
|
||||||
|
|
||||||
// SchematicLoader loader = new SchematicLoader();
|
|
||||||
// loader.init(link);
|
|
||||||
// loader.generateSchematic(link);
|
|
||||||
count=0;
|
|
||||||
|
|
||||||
|
|
||||||
while(random.nextInt(3)!=1)
|
|
||||||
{
|
|
||||||
i=chunkX*16-random.nextInt(16);
|
|
||||||
k=chunkZ*16-random.nextInt(16);
|
|
||||||
|
|
||||||
j= world.getHeightValue(i, k);
|
|
||||||
|
|
||||||
if(world.isAirBlock(i, j+1, k))
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
link = dimHelper.instance.createLink(link.locDimID,link.destDimID, i, j+1, k,link.destXCoord,link.destYCoord,link.destZCoord);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if(random.nextInt(220)==0&&world.provider.getDimensionName()!="PocketDim"&&!world.isRemote&&mod_pocketDim.riftsInWorldGen)
|
|
||||||
{
|
|
||||||
// System.out.println("tryingToGen");
|
|
||||||
int blockID=Block.stoneBrick.blockID;
|
|
||||||
if(world.provider.dimensionId==mod_pocketDim.limboDimID)
|
|
||||||
{
|
|
||||||
blockID= mod_pocketDim.blockLimboID;
|
|
||||||
}
|
|
||||||
i=chunkX*16-random.nextInt(16);
|
|
||||||
k=chunkZ*16-random.nextInt(16);
|
|
||||||
|
|
||||||
j= world.getHeightValue(i, k);
|
|
||||||
if(j>20&&world.getBlockId(i, j, k)==0)
|
|
||||||
{
|
|
||||||
//System.out.println(String.valueOf(i)+"x "+String.valueOf(j)+"y "+String.valueOf(k)+"z"+"small gen");
|
|
||||||
|
|
||||||
count=0;
|
|
||||||
|
|
||||||
|
|
||||||
if(world.isAirBlock(i, j+1, k))
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(world.isBlockOpaqueCube(i, j-2, k)||world.isBlockOpaqueCube(i, j-1, k))
|
|
||||||
{
|
|
||||||
link = new LinkData(world.provider.dimensionId, 0, i, j+1, k, i, j+1, k, true);
|
|
||||||
link =dimHelper.instance.createPocket(link,true, true);
|
|
||||||
|
|
||||||
for(int xc=-3;xc<4;xc++)
|
|
||||||
{
|
|
||||||
for(int zc=-3;zc<4;zc++)
|
|
||||||
{
|
|
||||||
for(int yc=0;yc<200;yc++)
|
|
||||||
{
|
|
||||||
if(yc==0&&world.isBlockOpaqueCube(i+xc, j-2,k +zc))
|
|
||||||
{
|
|
||||||
|
|
||||||
if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+2)
|
|
||||||
{
|
|
||||||
world.setBlock(i+xc, j-1+yc, k+zc, blockID);
|
|
||||||
}
|
|
||||||
else if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+3)
|
|
||||||
|
|
||||||
{
|
|
||||||
world.setBlockAndMetadata(i+xc, j-1+yc, k+zc, blockID,2);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ItemRiftBlade.placeDoorBlock(world, i, j+1, k, 0, mod_pocketDim.transientDoor);
|
|
||||||
|
|
||||||
{
|
|
||||||
world.setBlockAndMetadata(i, j+1, k-1, blockID,0);
|
|
||||||
world.setBlockAndMetadata(i, j+1, k+1, blockID,0);
|
|
||||||
world.setBlockAndMetadata(i, j, k-1, blockID,0);
|
|
||||||
world.setBlockAndMetadata(i, j, k+1, blockID,0);
|
|
||||||
world.setBlockAndMetadata(i, j+2, k+1, blockID,3);
|
|
||||||
world.setBlockAndMetadata(i, j+2, k-1, blockID,3);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.shouldSave=true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// dimData = dimHelper.instance.dimList.get(link.destDimID);
|
|
||||||
|
|
||||||
|
|
||||||
// SchematicLoader loader = new SchematicLoader();
|
|
||||||
// loader.init(link);
|
|
||||||
// loader.generateSchematic(link);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(this.shouldSave)
|
|
||||||
{
|
|
||||||
// dimHelper.instance.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
// mod_pocketDim.genTime=((System.nanoTime()-ntime)+mod_pocketDim.genTime);
|
|
||||||
// System.out.println( mod_pocketDim.genTime);
|
|
||||||
// System.out.println( (System.nanoTime()-ntime));
|
|
||||||
|
|
||||||
// ntime=0L;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,937 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.BlockContainer;
|
|
||||||
import net.minecraft.block.BlockStairs;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.CompressedStreamTools;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.nbt.NBTTagList;
|
|
||||||
import net.minecraft.tileentity.TileEntityChest;
|
|
||||||
import net.minecraft.tileentity.TileEntityDispenser;
|
|
||||||
import net.minecraft.util.WeightedRandomChestContent;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.Chunk;
|
|
||||||
import net.minecraft.world.chunk.EmptyChunk;
|
|
||||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
|
||||||
import net.minecraftforge.common.ChestGenHooks;
|
|
||||||
|
|
||||||
public class SchematicLoader
|
|
||||||
|
|
||||||
{
|
|
||||||
public short width;
|
|
||||||
public short height;
|
|
||||||
public short length;
|
|
||||||
|
|
||||||
public byte[] blocks;
|
|
||||||
public byte[] data;
|
|
||||||
public NBTTagList entities;
|
|
||||||
public NBTTagList tileentities;
|
|
||||||
private Random rand = new Random();
|
|
||||||
// public World world;
|
|
||||||
public Point3D incomingLink= new Point3D(0,0,0);
|
|
||||||
public ArrayList<Point3D> sideLinks = new ArrayList<Point3D>();
|
|
||||||
public ArrayList<Point3D> exitLinks = new ArrayList<Point3D>();
|
|
||||||
public int transMeta;
|
|
||||||
// public Chunk chunk;
|
|
||||||
public int cX;
|
|
||||||
public int cZ;
|
|
||||||
public int cY;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean didRead=false;
|
|
||||||
public String schematic;
|
|
||||||
|
|
||||||
public SchematicLoader()
|
|
||||||
{
|
|
||||||
// this.schematic="/schematics/"+filePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void init(String filePath, LinkData link, int x, int y , int z)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.schematic="/schematics/"+filePath;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
String fname= schematic ;
|
|
||||||
|
|
||||||
InputStream input = this.getClass().getResourceAsStream(fname);
|
|
||||||
//FileInputStream fileinputstream = new FileInputStream(file);
|
|
||||||
NBTTagCompound nbtdata = CompressedStreamTools.readCompressed(input);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
width = nbtdata.getShort("Width");
|
|
||||||
height = nbtdata.getShort("Height");
|
|
||||||
length = nbtdata.getShort("Length");
|
|
||||||
|
|
||||||
blocks = nbtdata.getByteArray("Blocks");
|
|
||||||
data = nbtdata.getByteArray("Data");
|
|
||||||
|
|
||||||
entities = nbtdata.getTagList("Entities");
|
|
||||||
tileentities = nbtdata.getTagList("TileEntities");
|
|
||||||
this.didRead=true;
|
|
||||||
input.close();
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
this.didRead=false;
|
|
||||||
System.out.println("Error- could not find file "+schematic);
|
|
||||||
e.printStackTrace();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
this.generateSchematic(link, 0, 0, 0);
|
|
||||||
|
|
||||||
}
|
|
||||||
public int transformMetadata(int metadata, int orientation, int blockID)
|
|
||||||
{
|
|
||||||
if(mod_pocketDim.metadataFlipList.contains(blockID))
|
|
||||||
{
|
|
||||||
switch (orientation)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
|
|
||||||
if(Block.blocksList[blockID] instanceof BlockStairs)
|
|
||||||
{
|
|
||||||
|
|
||||||
switch (metadata)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
metadata = 2;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
metadata = 3;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
metadata = 1;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
metadata = 0;
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
metadata = 4;
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
metadata = 5;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
metadata = 7;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
metadata = 6;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(blockID== Block.lever.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID)
|
|
||||||
{
|
|
||||||
switch (metadata)
|
|
||||||
{
|
|
||||||
case 12:
|
|
||||||
metadata = 9;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
metadata = 10;
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
metadata = 12;
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
metadata = 11;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
metadata = 4;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
metadata = 2;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
metadata = 3;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
metadata = 1;
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID)
|
|
||||||
{
|
|
||||||
switch (metadata)
|
|
||||||
{
|
|
||||||
case 4:
|
|
||||||
metadata = 2;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
metadata = 3;
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
metadata = 11;
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
metadata = 10;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
metadata = 4;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
metadata = 5;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
metadata = 12;
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
metadata = 13;
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorSteel.blockID||blockID==Block.doorWood.blockID)
|
|
||||||
{
|
|
||||||
switch (metadata)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
metadata = 1;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
metadata = 2;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
metadata = 3;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
metadata = 0;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
metadata = 5;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
metadata = 6;
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
metadata = 7;
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
metadata = 4;
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
metadata = 9;
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
metadata = 10;
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
metadata = 11;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
metadata = 8;
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
metadata = 13;
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
metadata = 14;
|
|
||||||
break;
|
|
||||||
case 14:
|
|
||||||
metadata = 15;
|
|
||||||
break;
|
|
||||||
case 15:
|
|
||||||
metadata = 12;
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
|
|
||||||
|
|
||||||
if(Block.blocksList[blockID] instanceof BlockStairs)
|
|
||||||
{
|
|
||||||
|
|
||||||
switch (metadata)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
metadata = 1;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
metadata = 0;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
metadata = 3;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
metadata = 2;
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
metadata = 6;
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
metadata = 7;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
metadata = 4;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
metadata = 5;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(blockID== Block.lever.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID)
|
|
||||||
{
|
|
||||||
switch (metadata)
|
|
||||||
{
|
|
||||||
case 12:
|
|
||||||
metadata = 11;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
metadata = 12;
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
metadata = 9;
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
metadata = 10;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
metadata = 1;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
metadata = 4;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
metadata = 2;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
metadata = 3;
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID)
|
|
||||||
{
|
|
||||||
switch (metadata)
|
|
||||||
{
|
|
||||||
case 4:
|
|
||||||
metadata = 5;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
metadata = 4;
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
metadata = 12;
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
metadata = 13;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
metadata = 2;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
metadata = 3;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
metadata = 10;
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
metadata = 11;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorSteel.blockID||blockID==Block.doorWood.blockID)
|
|
||||||
{
|
|
||||||
switch (metadata)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
metadata = 2;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
metadata = 3;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
metadata = 0;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
metadata = 1;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
metadata = 6;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
metadata = 7;
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
metadata = 4;
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
metadata = 5;
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
metadata = 10;
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
metadata = 11;
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
metadata = 8;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
metadata = 9;
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
metadata = 14;
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
metadata = 15;
|
|
||||||
break;
|
|
||||||
case 14:
|
|
||||||
metadata = 12;
|
|
||||||
break;
|
|
||||||
case 15:
|
|
||||||
metadata = 13;
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
|
|
||||||
if(Block.blocksList[blockID] instanceof BlockStairs)
|
|
||||||
{
|
|
||||||
|
|
||||||
switch (metadata)
|
|
||||||
{
|
|
||||||
case 2:
|
|
||||||
metadata = 0;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
metadata = 1;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
metadata = 2;
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
metadata = 3;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
metadata = 7;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
metadata = 6;
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
metadata = 5;
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
metadata = 4;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(blockID== Block.lever.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID)
|
|
||||||
{
|
|
||||||
switch (metadata)
|
|
||||||
{
|
|
||||||
case 9:
|
|
||||||
metadata = 12;
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
metadata = 11;
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
metadata = 10;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
metadata = 9;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
metadata = 2;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
metadata = 3;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
metadata = 1;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
metadata = 4;
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID)
|
|
||||||
{
|
|
||||||
switch (metadata)
|
|
||||||
{
|
|
||||||
case 2:
|
|
||||||
metadata = 4;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
metadata = 5;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
metadata = 13;
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
metadata = 12;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
metadata = 3;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
metadata = 2;
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
metadata = 11;
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
metadata = 10;
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorSteel.blockID||blockID==Block.doorWood.blockID)
|
|
||||||
{
|
|
||||||
switch (metadata)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
metadata = 0;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
metadata = 1;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
metadata = 2;
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
metadata = 3;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
metadata = 4;
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
metadata = 5;
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
metadata = 6;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
metadata = 7;
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
metadata = 8;
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
metadata = 9;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
metadata = 10;
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
metadata = 11;
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
metadata = 12;
|
|
||||||
break;
|
|
||||||
case 14:
|
|
||||||
metadata = 13;
|
|
||||||
break;
|
|
||||||
case 15:
|
|
||||||
metadata = 14;
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
metadata = 15;
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
/**
|
|
||||||
* this is the default case- never need to change anything here
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
return metadata;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void generateSchematic(LinkData link, int xOffset, int yOffset, int zOffset)
|
|
||||||
{
|
|
||||||
|
|
||||||
World world;
|
|
||||||
Chunk chunk;
|
|
||||||
dimHelper.dimList.get(link.destDimID).hasBeenFilled=this.didRead;
|
|
||||||
SchematicLoader loader=this;
|
|
||||||
|
|
||||||
int i = link.destXCoord;
|
|
||||||
int j = link.destYCoord-1;
|
|
||||||
int k = link.destZCoord;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(dimHelper.getWorld(link.destDimID)==null)
|
|
||||||
{
|
|
||||||
dimHelper.initDimension(link.destDimID);
|
|
||||||
}
|
|
||||||
world=dimHelper.getWorld(link.destDimID);
|
|
||||||
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
int z;
|
|
||||||
|
|
||||||
|
|
||||||
int xCooe=0;
|
|
||||||
int yCooe=0;
|
|
||||||
int zCooe=0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ( x = 0; x < loader.width; ++x)
|
|
||||||
{
|
|
||||||
for ( y = 0; y < loader.height; ++y)
|
|
||||||
{
|
|
||||||
for ( z = 0; z < loader.length; ++z)
|
|
||||||
{
|
|
||||||
if(link.linkOrientation==0)
|
|
||||||
{
|
|
||||||
zCooe=x-20;
|
|
||||||
yCooe=y-6;
|
|
||||||
xCooe=-z+35;
|
|
||||||
|
|
||||||
}
|
|
||||||
if(link.linkOrientation==1)
|
|
||||||
{
|
|
||||||
xCooe=-x+20;
|
|
||||||
yCooe=y-6;
|
|
||||||
zCooe=-z+35;
|
|
||||||
}
|
|
||||||
if(link.linkOrientation==2)
|
|
||||||
{
|
|
||||||
zCooe=-x+20;
|
|
||||||
yCooe=y-6;
|
|
||||||
xCooe=+z-35;
|
|
||||||
}
|
|
||||||
if(link.linkOrientation==3)
|
|
||||||
{
|
|
||||||
xCooe=x-20;
|
|
||||||
yCooe=y-6;
|
|
||||||
zCooe=z-35;
|
|
||||||
}
|
|
||||||
|
|
||||||
int index = y * loader.width * loader.length + z * loader.width + x;
|
|
||||||
|
|
||||||
int blockToReplace=loader.blocks[index];
|
|
||||||
int blockMetaData=loader.data[index];
|
|
||||||
NBTTagList tileEntity = loader.tileentities;
|
|
||||||
HashMap tileEntityMap= new HashMap();
|
|
||||||
int size = tileEntity.tagCount();
|
|
||||||
|
|
||||||
|
|
||||||
if(blockToReplace==Block.doorSteel.blockID)
|
|
||||||
{
|
|
||||||
this.sideLinks.add(new Point3D(i+xCooe, j+yCooe, k+zCooe));
|
|
||||||
}
|
|
||||||
if(blockToReplace==Block.doorWood.blockID)
|
|
||||||
{
|
|
||||||
this.exitLinks.add(new Point3D(i+xCooe, j+yCooe, k+zCooe));
|
|
||||||
}
|
|
||||||
if(blockToReplace==-124)
|
|
||||||
{
|
|
||||||
blockToReplace=Block.tripWire.blockID;
|
|
||||||
}
|
|
||||||
if(blockToReplace==-125)
|
|
||||||
{
|
|
||||||
blockToReplace=Block.tripWireSource.blockID;
|
|
||||||
}
|
|
||||||
if(blockToReplace<0&&blockToReplace!=-39)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
if(blockToReplace<0)
|
|
||||||
{
|
|
||||||
blockToReplace=mod_pocketDim.blockDimWallID;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(blockToReplace>0)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.transMeta=this.transformMetadata(blockMetaData, link.linkOrientation, blockToReplace);
|
|
||||||
|
|
||||||
if(blockToReplace==Block.doorSteel.blockID)
|
|
||||||
{
|
|
||||||
setBlockDirectly(world,i+xCooe,j+yCooe,k+zCooe,mod_pocketDim.dimDoorID, transMeta );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if(blockToReplace==Block.doorWood.blockID)
|
|
||||||
{
|
|
||||||
setBlockDirectly(world,i+xCooe,j+yCooe,k+zCooe,mod_pocketDim.ExitDoorID, transMeta );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
setBlockDirectly(world,i+xCooe,j+yCooe,k+zCooe,blockToReplace, transMeta );
|
|
||||||
}
|
|
||||||
|
|
||||||
if(Block.blocksList[blockToReplace] instanceof BlockContainer)
|
|
||||||
{
|
|
||||||
// System.out.println("found container");
|
|
||||||
Random rand= new Random();
|
|
||||||
if(world.getBlockTileEntity(i+xCooe, j+yCooe, k+zCooe) instanceof TileEntityChest)
|
|
||||||
{
|
|
||||||
TileEntityChest chest = (TileEntityChest) world.getBlockTileEntity(i+xCooe, j+yCooe, k+zCooe);
|
|
||||||
chest.setInventorySlotContents(rand.nextInt(30+1), new ItemStack(mod_pocketDim.blockDimWall, 64));
|
|
||||||
|
|
||||||
ChestGenHooks info = ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST);
|
|
||||||
WeightedRandomChestContent.generateChestContents(rand, info.getItems(rand),(TileEntityChest)world.getBlockTileEntity(i+xCooe, j+yCooe, k+zCooe) , info.getCount(rand));
|
|
||||||
chest.setInventorySlotContents(rand.nextInt(30+1), new ItemStack(mod_pocketDim.blockDimWall, 64));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
if(world.getBlockTileEntity(i+xCooe, j+yCooe, k+zCooe) instanceof TileEntityDispenser)
|
|
||||||
{
|
|
||||||
TileEntityDispenser dispenser = (TileEntityDispenser) world.getBlockTileEntity(i+xCooe, j+yCooe, k+zCooe);
|
|
||||||
dispenser.addItem(new ItemStack(Item.arrow, 64));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LinkData outgoingLink = dimHelper.instance.getLinkDataFromCoords(link.destXCoord, link.destYCoord, link.destZCoord, link.destDimID);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(Point3D point : this.sideLinks)
|
|
||||||
{
|
|
||||||
if(world.getBlockId(point.getX(), point.getY(), point.getZ())==mod_pocketDim.dimDoorID&&world.getBlockId(point.getX(), point.getY()-1, point.getZ())==mod_pocketDim.dimDoorID)
|
|
||||||
{
|
|
||||||
|
|
||||||
int depth = dimHelper.instance.getDimDepth(link.locDimID);
|
|
||||||
int xNoise = 0;
|
|
||||||
int zNoise =0;
|
|
||||||
switch(world.getBlockMetadata(point.getX(), point.getY()-1, point.getZ()))
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
xNoise = (int)rand.nextInt(depth+1*200)+depth*50;
|
|
||||||
zNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
xNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
|
|
||||||
zNoise = (int) rand.nextInt(depth+1*200)+depth*50;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
xNoise = - (rand.nextInt(depth+1*200)+depth*50);
|
|
||||||
zNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
xNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
|
|
||||||
zNoise = -(rand.nextInt(depth+1*200)+depth*50);
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LinkData sideLink = new LinkData(link.destDimID,0,point.getX(), point.getY(), point.getZ(),xNoise+point.getX(), point.getY()+1, zNoise+point.getZ(),true);
|
|
||||||
sideLink.linkOrientation=world.getBlockMetadata(point.getX(), point.getY()-1, point.getZ());
|
|
||||||
dimHelper.instance.createPocket(sideLink, true, true);
|
|
||||||
|
|
||||||
|
|
||||||
//setBlockDirectly(world,point.getX(), point.getY()-1, point.getZ(),mod_pocketDim.dimDoorID,sideLink.linkOrientation);
|
|
||||||
// setBlockDirectly(world,point.getX(), point.getY(), point.getZ(),mod_pocketDim.dimDoorID,8);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(Point3D point : this.exitLinks)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if(world.getBlockId(point.getX(), point.getY(), point.getZ())==mod_pocketDim.ExitDoorID&&world.getBlockId(point.getX(), point.getY()-1, point.getZ())==mod_pocketDim.ExitDoorID&&world.getBlockId(point.getX(), point.getY()-2, point.getZ())==Block.sandStone.blockID)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
if(dimHelper.getWorld(dimHelper.dimList.get(world.provider.dimensionId).exitDimLink.destDimID)==null)
|
|
||||||
{
|
|
||||||
dimHelper.initDimension((dimHelper.dimList.get(world.provider.dimensionId).exitDimLink.destDimID));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dimHelper.getWorld(dimHelper.dimList.get(world.provider.dimensionId).exitDimLink.destDimID).getChunkProvider().loadChunk(point.getX() >> 4, point.getZ() >> 4);
|
|
||||||
|
|
||||||
LinkData sideLink = new LinkData(link.destDimID,dimHelper.dimList.get(link.locDimID).exitDimLink.destDimID,point.getX(), point.getY(), point.getZ(),point.getX(), dimHelper.getWorld(dimHelper.dimList.get(world.provider.dimensionId).exitDimLink.destDimID).getHeightValue(point.getX(), point.getZ())+1, point.getZ(),true);
|
|
||||||
sideLink.linkOrientation=world.getBlockMetadata(point.getX(), point.getY()-1, point.getZ());
|
|
||||||
dimHelper.instance.createLink(sideLink);
|
|
||||||
dimHelper.instance.createLink(sideLink.destDimID , sideLink.locDimID, sideLink.destXCoord, sideLink.destYCoord, sideLink.destZCoord, sideLink.locXCoord, sideLink.locYCoord, sideLink.locZCoord, dimHelper.instance.flipDoorMetadata(sideLink.linkOrientation));
|
|
||||||
|
|
||||||
|
|
||||||
setBlockDirectly(world,point.getX(), point.getY()-2, point.getZ(), Block.stone.blockID,0);
|
|
||||||
// setBlockDirectly(world,point.getX(), point.getY()-1, point.getZ(),mod_pocketDim.ExitDoorID,sideLink.linkOrientation);
|
|
||||||
// setBlockDirectly(world,point.getX(), point.getY(), point.getZ(),mod_pocketDim.ExitDoorID,8);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if ((world.getBlockId(point.getX(), point.getY(), point.getZ())==mod_pocketDim.ExitDoorID&&world.getBlockId(point.getX(), point.getY()-1, point.getZ())==mod_pocketDim.ExitDoorID&&world.getBlockId(point.getX(), point.getY()-2, point.getZ())!=Block.sandStone.blockID))
|
|
||||||
{
|
|
||||||
this.incomingLink = point;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
catch(Exception E)
|
|
||||||
{
|
|
||||||
E.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(!this.incomingLink.equals(new Point3D(0,0,0)))
|
|
||||||
{
|
|
||||||
outgoingLink.locXCoord=this.incomingLink.getX();
|
|
||||||
outgoingLink.locYCoord=this.incomingLink.getY();
|
|
||||||
outgoingLink.locZCoord=this.incomingLink.getZ();
|
|
||||||
outgoingLink.linkOrientation=world.getBlockMetadata(incomingLink.getX(), incomingLink.getY()-1, incomingLink.getZ());
|
|
||||||
dimHelper.instance.createLink(outgoingLink);
|
|
||||||
|
|
||||||
link.destXCoord=this.incomingLink.getX();
|
|
||||||
link.destYCoord=this.incomingLink.getY();
|
|
||||||
link.destZCoord=this.incomingLink.getZ();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setBlockDirectly(World world, int x, int y, int z,int id, int metadata)
|
|
||||||
{
|
|
||||||
Chunk chunk;
|
|
||||||
this.cX=x >>4;
|
|
||||||
this.cZ=z >>4;
|
|
||||||
this.cY=y >>4;
|
|
||||||
|
|
||||||
int chunkX=(x % 16)< 0 ? ((x) % 16)+16 : ((x) % 16);
|
|
||||||
int chunkY=y;
|
|
||||||
int chunkZ=((z) % 16)< 0 ? ((z) % 16)+16 : ((z) % 16);
|
|
||||||
|
|
||||||
|
|
||||||
// this.chunk=new EmptyChunk(world,cX, cZ);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
chunk=world.getChunkFromChunkCoords(cX, cZ);
|
|
||||||
if (chunk.getBlockStorageArray()[cY] == null) {
|
|
||||||
chunk.getBlockStorageArray()[cY] = new ExtendedBlockStorage(cY << 4, !world.provider.hasNoSky);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
chunk.getBlockStorageArray()[cY].setExtBlockID(chunkX, (y) & 15, chunkZ, id);
|
|
||||||
chunk.getBlockStorageArray()[cY].setExtBlockMetadata(chunkX, (y) & 15, chunkZ, metadata);
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import net.minecraft.network.INetworkManager;
|
|
||||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
|
||||||
import cpw.mods.fml.common.network.IPacketHandler;
|
|
||||||
import cpw.mods.fml.common.network.Player;
|
|
||||||
|
|
||||||
public class ServerPacketHandler implements IPacketHandler
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onPacketData(INetworkManager manager,
|
|
||||||
Packet250CustomPayload packet, Player player)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
|
|
||||||
public class TileEntityDimDoor extends TileEntity
|
|
||||||
|
|
||||||
{
|
|
||||||
public boolean openOrClosed;
|
|
||||||
public int orientation;
|
|
||||||
public boolean hasExit;
|
|
||||||
public boolean isDungeonChainLink;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean canUpdate()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateEntity()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readFromNBT(NBTTagCompound nbt)
|
|
||||||
{
|
|
||||||
super.readFromNBT(nbt);
|
|
||||||
int i = nbt.getInteger(("Size"));
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.openOrClosed = nbt.getBoolean("openOrClosed");
|
|
||||||
|
|
||||||
this.orientation = nbt.getInteger("orientation");
|
|
||||||
|
|
||||||
this.hasExit = nbt.getBoolean("hasExit");
|
|
||||||
|
|
||||||
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToNBT(NBTTagCompound nbt)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
super.writeToNBT(nbt);
|
|
||||||
nbt.setBoolean("openOrClosed", this.openOrClosed);
|
|
||||||
|
|
||||||
nbt.setBoolean("hasExit", this.hasExit);
|
|
||||||
|
|
||||||
nbt.setInteger("orientation", this.orientation);
|
|
||||||
|
|
||||||
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
|
|
||||||
public class TileEntityDimRail extends TileEntity
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
public int orientation;
|
|
||||||
public boolean hasExit;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean canUpdate()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateEntity()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readFromNBT(NBTTagCompound nbt)
|
|
||||||
{
|
|
||||||
super.readFromNBT(nbt);
|
|
||||||
int i = nbt.getInteger(("Size"));
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
this.orientation = nbt.getInteger("orientation");
|
|
||||||
|
|
||||||
this.hasExit = nbt.getBoolean("hasExit");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToNBT(NBTTagCompound nbt)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
super.writeToNBT(nbt);
|
|
||||||
|
|
||||||
|
|
||||||
nbt.setBoolean("hasExit", this.hasExit);
|
|
||||||
|
|
||||||
nbt.setInteger("orientation", this.orientation);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,204 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityList;
|
|
||||||
import net.minecraft.entity.monster.EntityEnderman;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
|
|
||||||
public class TileEntityRift extends TileEntity
|
|
||||||
|
|
||||||
{
|
|
||||||
public int xOffset=0;
|
|
||||||
public int yOffset=0;
|
|
||||||
public int zOffset=0;
|
|
||||||
public int distance=0;
|
|
||||||
public boolean hasGrownRifts=false;
|
|
||||||
public boolean shouldClose=false;
|
|
||||||
//public boolean isClosing=false;
|
|
||||||
public boolean isNearRift=false;
|
|
||||||
private int count=200;
|
|
||||||
private int count2 = 0;
|
|
||||||
public LinkData nearestRiftData;
|
|
||||||
Random rand = new Random();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean canUpdate()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateEntity()
|
|
||||||
{
|
|
||||||
|
|
||||||
if(count>200&&dimHelper.dimList.get(this.worldObj.provider.dimensionId)!=null)
|
|
||||||
{
|
|
||||||
nearestRiftData = dimHelper.dimList.get(this.worldObj.provider.dimensionId).findNearestRift(worldObj, 5, xCoord, yCoord, zCoord);
|
|
||||||
if(nearestRiftData!=null)
|
|
||||||
{
|
|
||||||
this.xOffset=this.xCoord-nearestRiftData.locXCoord;
|
|
||||||
this.yOffset=this.yCoord-nearestRiftData.locYCoord;
|
|
||||||
this.zOffset=this.zCoord-nearestRiftData.locZCoord;
|
|
||||||
this.distance=(int) (MathHelper.abs(xOffset)+MathHelper.abs(yOffset)+MathHelper.abs(zOffset));
|
|
||||||
this.isNearRift=true;
|
|
||||||
|
|
||||||
if(!this.worldObj.isRemote&&distance>1)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
grow(distance);
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if(rand.nextInt(30)==0&&!this.worldObj.isRemote)
|
|
||||||
{
|
|
||||||
|
|
||||||
List list = worldObj.getEntitiesWithinAABB(EntityEnderman.class, AxisAlignedBB.getBoundingBox( this.xCoord-9, this.yCoord-3, this.zCoord-9, this.xCoord+9, this.yCoord+3, this.zCoord+9));
|
|
||||||
|
|
||||||
if(list.size()<1)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
EntityEnderman creeper = new EntityEnderman(worldObj);
|
|
||||||
creeper.setLocationAndAngles(this.xCoord+.5, this.yCoord-1, this.zCoord+.5, 5, 6);
|
|
||||||
worldObj.spawnEntityInWorld(creeper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.isNearRift=false;
|
|
||||||
}
|
|
||||||
count=0;
|
|
||||||
}
|
|
||||||
count++;
|
|
||||||
|
|
||||||
if(this.shouldClose)
|
|
||||||
{
|
|
||||||
// System.out.println(count2);
|
|
||||||
if(count2>20&&count2<22)
|
|
||||||
{
|
|
||||||
nearestRiftData = dimHelper.dimList.get(this.worldObj.provider.dimensionId).findNearestRift(worldObj, 10, xCoord, yCoord, zCoord);
|
|
||||||
if(this.nearestRiftData!=null)
|
|
||||||
{
|
|
||||||
TileEntityRift rift = (TileEntityRift) this.worldObj.getBlockTileEntity(nearestRiftData.locXCoord, nearestRiftData.locYCoord, nearestRiftData.locZCoord);
|
|
||||||
if(rift!=null)
|
|
||||||
{
|
|
||||||
rift.shouldClose=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(count2>40)
|
|
||||||
{
|
|
||||||
this.invalidate();
|
|
||||||
this.worldObj.setBlockWithNotify(this.xCoord, this.yCoord, this.zCoord,0);
|
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId)!=null)
|
|
||||||
{
|
|
||||||
dimHelper.instance.removeLink(this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
count2++;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
public void grow(int distance)
|
|
||||||
{
|
|
||||||
int count=0;
|
|
||||||
if(rand.nextInt(distance*2)==0)
|
|
||||||
{
|
|
||||||
|
|
||||||
int x=0,y=0,z=0;
|
|
||||||
while(count<100)
|
|
||||||
{
|
|
||||||
count++;
|
|
||||||
x=this.xCoord+(1-(rand.nextInt(2)*2)*rand.nextInt(6));
|
|
||||||
y=this.yCoord+(1-(rand.nextInt(2)*2)*rand.nextInt(4));
|
|
||||||
z=this.zCoord+(1-(rand.nextInt(2)*2)*rand.nextInt(6));
|
|
||||||
if(this.worldObj.isAirBlock(x, y, z))
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (count<100)
|
|
||||||
{
|
|
||||||
|
|
||||||
LinkData link = dimHelper.instance.getLinkDataFromCoords(this.xCoord, this.yCoord, this.zCoord, worldObj);
|
|
||||||
if(link!=null)
|
|
||||||
{
|
|
||||||
if(!this.hasGrownRifts&&rand.nextInt(3)==0)
|
|
||||||
{
|
|
||||||
// System.out.println(link.numberofChildren);
|
|
||||||
link.numberofChildren++;
|
|
||||||
dimHelper.instance.createLink(this.worldObj.provider.dimensionId, link.destDimID, x, y, z, link.destXCoord, link.destYCoord, link.destZCoord).numberofChildren=link.numberofChildren+1;
|
|
||||||
this.hasGrownRifts=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readFromNBT(NBTTagCompound nbt)
|
|
||||||
{
|
|
||||||
super.readFromNBT(nbt);
|
|
||||||
int i = nbt.getInteger(("Size"));
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.xOffset = nbt.getInteger("xOffset");
|
|
||||||
this.yOffset = nbt.getInteger("yOffset");
|
|
||||||
this.zOffset = nbt.getInteger("zOffset");
|
|
||||||
this.hasGrownRifts =nbt.getBoolean("grownRifts");
|
|
||||||
this.count=nbt.getInteger("count");
|
|
||||||
this.count2=nbt.getInteger("count2");
|
|
||||||
this.shouldClose=nbt.getBoolean("shouldClose");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToNBT(NBTTagCompound nbt)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
super.writeToNBT(nbt);
|
|
||||||
nbt.setInteger("xOffset", this.xOffset);
|
|
||||||
nbt.setInteger("yOffset", this.yOffset);
|
|
||||||
nbt.setInteger("zOffset", this.zOffset);
|
|
||||||
nbt.setBoolean("grownRifts",this.hasGrownRifts);
|
|
||||||
nbt.setInteger("count", this.count);
|
|
||||||
nbt.setInteger("count2", this.count2);
|
|
||||||
nbt.setBoolean("shouldClose", this.shouldClose);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.BlockContainer;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
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 cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class TransientDoor extends ExitDoor
|
|
||||||
{
|
|
||||||
|
|
||||||
protected TransientDoor(int par1, Material material)
|
|
||||||
{
|
|
||||||
super(par1, Material.grass);
|
|
||||||
// this.blockIndexInTexture = 18;
|
|
||||||
this.setTextureFile("/PocketBlockTextures.png");
|
|
||||||
|
|
||||||
}
|
|
||||||
public boolean isCollidable()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
this.updateAttatchedTile(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
|
||||||
{
|
|
||||||
|
|
||||||
int var12 = (int) (MathHelper.floor_double((double)((par5Entity.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
|
||||||
int num = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
// System.out.println("metadata "+num+" orientation "+var12);
|
|
||||||
|
|
||||||
if(!par1World.isRemote&&(num)==var12||!par1World.isRemote&&!(par5Entity instanceof EntityPlayer))
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LinkData linkData= dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World);
|
|
||||||
if(linkData!=null)
|
|
||||||
{
|
|
||||||
if(dimHelper.dimList.containsKey(linkData.destDimID))
|
|
||||||
{
|
|
||||||
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
|
||||||
par1World.setBlockWithNotify(par2, par3-1, par4, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
linkData= dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World);
|
|
||||||
if(linkData!=null)
|
|
||||||
{
|
|
||||||
if(dimHelper.dimList.containsKey(linkData.destDimID))
|
|
||||||
{
|
|
||||||
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
|
||||||
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int idDropped(int par1, Random par2Random, int par3)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A function to open a door.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public int getRenderType()
|
|
||||||
{
|
|
||||||
return 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.commands;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.DimData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
||||||
import net.minecraft.command.CommandBase;
|
|
||||||
import net.minecraft.command.ICommandSender;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class CommandDeleteAllLinks extends CommandBase
|
|
||||||
{
|
|
||||||
public String getCommandName()//the name of our command
|
|
||||||
{
|
|
||||||
return "delete_all_links";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void processCommand(ICommandSender var1, String[] var2)
|
|
||||||
|
|
||||||
{
|
|
||||||
int linksRemoved=0;
|
|
||||||
int targetDim;
|
|
||||||
boolean shouldGo= true;
|
|
||||||
|
|
||||||
if(var2.length==0)
|
|
||||||
{
|
|
||||||
targetDim= this.getCommandSenderAsPlayer(var1).worldObj.provider.dimensionId;
|
|
||||||
}
|
|
||||||
else if(var2.length==1)
|
|
||||||
{
|
|
||||||
targetDim= this.parseInt(var1, var2[0]);
|
|
||||||
if(!dimHelper.dimList.containsKey(targetDim))
|
|
||||||
{
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error- dim "+targetDim+" not registered");
|
|
||||||
shouldGo=false;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
targetDim=0;
|
|
||||||
shouldGo=false;
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error-Invalid argument, delete_all_links <targetDimID> or blank for current dim");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(shouldGo)
|
|
||||||
{
|
|
||||||
if(dimHelper.dimList.containsKey(targetDim))
|
|
||||||
{
|
|
||||||
DimData dim = dimHelper.dimList.get(targetDim);
|
|
||||||
|
|
||||||
ArrayList<LinkData> linksInDim = dim.printAllLinkData();
|
|
||||||
|
|
||||||
for(LinkData link : linksInDim)
|
|
||||||
{
|
|
||||||
World targetWorld = dimHelper.getWorld(targetDim);
|
|
||||||
|
|
||||||
if(targetWorld==null)
|
|
||||||
{
|
|
||||||
dimHelper.initDimension(targetDim);
|
|
||||||
}
|
|
||||||
else if(targetWorld.provider==null)
|
|
||||||
{
|
|
||||||
dimHelper.initDimension(targetDim);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
targetWorld = dimHelper.getWorld(targetDim);
|
|
||||||
|
|
||||||
{
|
|
||||||
dim.removeLinkAtCoords(link);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
targetWorld.setBlockWithNotify(link.locXCoord, link.locYCoord, link.locZCoord, 0);
|
|
||||||
|
|
||||||
|
|
||||||
linksRemoved++;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//dim.linksInThisDim.clear();
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" links.");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2));
|
|
||||||
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2.length));
|
|
||||||
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" rifts.");
|
|
||||||
|
|
||||||
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.commands;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.DimData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
||||||
import net.minecraft.command.CommandBase;
|
|
||||||
import net.minecraft.command.ICommandSender;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class CommandDeleteDimData extends CommandBase
|
|
||||||
{
|
|
||||||
public String getCommandName()//the name of our command
|
|
||||||
{
|
|
||||||
return "delete_dim_data";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void processCommand(ICommandSender var1, String[] var2)
|
|
||||||
|
|
||||||
{
|
|
||||||
int linksRemoved=0;
|
|
||||||
int targetDim;
|
|
||||||
boolean shouldGo= true;
|
|
||||||
|
|
||||||
if(var2.length==0)
|
|
||||||
{
|
|
||||||
targetDim= this.getCommandSenderAsPlayer(var1).worldObj.provider.dimensionId;
|
|
||||||
}
|
|
||||||
else if(var2.length==1)
|
|
||||||
{
|
|
||||||
targetDim= this.parseInt(var1, var2[0]);
|
|
||||||
if(!dimHelper.dimList.containsKey(targetDim))
|
|
||||||
{
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error- dim "+targetDim+" not registered");
|
|
||||||
shouldGo=false;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
targetDim=0;
|
|
||||||
shouldGo=false;
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error-Invalid argument, delete_dim_data <targetDimID> or blank for current dim");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(shouldGo)
|
|
||||||
{
|
|
||||||
if(dimHelper.dimList.containsKey(targetDim))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
for(DimData dimData :dimHelper.dimList.values())
|
|
||||||
{
|
|
||||||
Collection<LinkData> links= new ArrayList();
|
|
||||||
links.addAll( dimData.printAllLinkData());
|
|
||||||
|
|
||||||
for(LinkData link : links)
|
|
||||||
{
|
|
||||||
if(link.destDimID==targetDim)
|
|
||||||
{
|
|
||||||
dimHelper.dimList.get(link.locDimID).removeLinkAtCoords(link);
|
|
||||||
linksRemoved++;
|
|
||||||
}
|
|
||||||
if(dimData.dimID==targetDim)
|
|
||||||
{
|
|
||||||
linksRemoved++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
dimHelper.dimList.remove(targetDim);
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed dimension "+targetDim+" from DimDoors and deleted "+linksRemoved+" links");
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error- dimension "+targetDim+" not registered with dimDoors");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2));
|
|
||||||
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2.length));
|
|
||||||
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" rifts.");
|
|
||||||
|
|
||||||
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.commands;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.DimData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
||||||
import net.minecraft.command.CommandBase;
|
|
||||||
import net.minecraft.command.ICommandSender;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class CommandDeleteRifts extends CommandBase
|
|
||||||
{
|
|
||||||
public String getCommandName()//the name of our command
|
|
||||||
{
|
|
||||||
return "delete_rifts";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void processCommand(ICommandSender var1, String[] var2)
|
|
||||||
|
|
||||||
{
|
|
||||||
int linksRemoved=0;
|
|
||||||
int targetDim;
|
|
||||||
boolean shouldGo= true;
|
|
||||||
|
|
||||||
if(var2.length==0)
|
|
||||||
{
|
|
||||||
targetDim= this.getCommandSenderAsPlayer(var1).worldObj.provider.dimensionId;
|
|
||||||
}
|
|
||||||
else if(var2.length==1)
|
|
||||||
{
|
|
||||||
targetDim= this.parseInt(var1, var2[0]);
|
|
||||||
if(!dimHelper.dimList.containsKey(targetDim))
|
|
||||||
{
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error- dim "+targetDim+" not registered");
|
|
||||||
shouldGo=false;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
targetDim=0;
|
|
||||||
shouldGo=false;
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error-Invalid argument, delete_links <targetDimID> or blank for current dim");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(shouldGo)
|
|
||||||
{
|
|
||||||
if(dimHelper.dimList.containsKey(targetDim))
|
|
||||||
{
|
|
||||||
DimData dim = dimHelper.dimList.get(targetDim);
|
|
||||||
|
|
||||||
ArrayList<LinkData> linksInDim = dim.printAllLinkData();
|
|
||||||
|
|
||||||
for(LinkData link : linksInDim)
|
|
||||||
{
|
|
||||||
World targetWorld = dimHelper.getWorld(targetDim);
|
|
||||||
|
|
||||||
if(targetWorld==null)
|
|
||||||
{
|
|
||||||
dimHelper.initDimension(targetDim);
|
|
||||||
}
|
|
||||||
else if(targetWorld.provider==null)
|
|
||||||
{
|
|
||||||
dimHelper.initDimension(targetDim);
|
|
||||||
|
|
||||||
}
|
|
||||||
targetWorld = dimHelper.getWorld(targetDim);
|
|
||||||
|
|
||||||
if(targetWorld.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord)==mod_pocketDim.blockRiftID)
|
|
||||||
{
|
|
||||||
dim.removeLinkAtCoords(link);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
targetWorld.setBlockWithNotify(link.locXCoord, link.locYCoord, link.locZCoord, 0);
|
|
||||||
|
|
||||||
|
|
||||||
linksRemoved++;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//dim.linksInThisDim.clear();
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" rifts.");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2));
|
|
||||||
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2.length));
|
|
||||||
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" rifts.");
|
|
||||||
|
|
||||||
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.commands;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.DimData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
||||||
import net.minecraft.command.CommandBase;
|
|
||||||
import net.minecraft.command.ICommandSender;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class CommandPrintDimData extends CommandBase
|
|
||||||
{
|
|
||||||
public String getCommandName()//the name of our command
|
|
||||||
{
|
|
||||||
return "print_dim_data";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void processCommand(ICommandSender var1, String[] var2)
|
|
||||||
|
|
||||||
{
|
|
||||||
int linksRemoved=0;
|
|
||||||
int targetDim;
|
|
||||||
boolean shouldGo= true;
|
|
||||||
|
|
||||||
if(var2.length==0)
|
|
||||||
{
|
|
||||||
targetDim= this.getCommandSenderAsPlayer(var1).worldObj.provider.dimensionId;
|
|
||||||
}
|
|
||||||
else if(var2.length==1)
|
|
||||||
{
|
|
||||||
targetDim= this.parseInt(var1, var2[0]);
|
|
||||||
if(!dimHelper.dimList.containsKey(targetDim))
|
|
||||||
{
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error- dim "+targetDim+" not registered");
|
|
||||||
shouldGo=false;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
targetDim=0;
|
|
||||||
shouldGo=false;
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error-Invalid argument, print_dim_data <targetDimID> or blank for current dim");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(shouldGo)
|
|
||||||
{
|
|
||||||
if(dimHelper.dimList.containsKey(targetDim))
|
|
||||||
{
|
|
||||||
for(DimData dimData :dimHelper.dimList.values())
|
|
||||||
{
|
|
||||||
Collection<LinkData> links= new ArrayList();
|
|
||||||
links.addAll( dimData.printAllLinkData());
|
|
||||||
|
|
||||||
for(LinkData link : links)
|
|
||||||
{
|
|
||||||
if(link.destDimID==targetDim)
|
|
||||||
{
|
|
||||||
dimHelper.dimList.get(link.locDimID).removeLinkAtCoords(link);
|
|
||||||
linksRemoved++;
|
|
||||||
}
|
|
||||||
if(dimData.dimID==targetDim)
|
|
||||||
{
|
|
||||||
linksRemoved++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
dimHelper.dimList.remove(targetDim);
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed dimension "+targetDim+" from DimDoors and deleted "+linksRemoved+" links");
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error- dimension "+targetDim+" not registered with dimDoors");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2));
|
|
||||||
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2.length));
|
|
||||||
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" rifts.");
|
|
||||||
|
|
||||||
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.commands;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import net.minecraft.command.CommandBase;
|
|
||||||
import net.minecraft.command.ICommandSender;
|
|
||||||
import StevenDimDoors.mod_pocketDim.DimData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
|
||||||
|
|
||||||
public class CommandPruneDims extends CommandBase
|
|
||||||
{
|
|
||||||
public String getCommandName()//the name of our command
|
|
||||||
{
|
|
||||||
return "prune_pocket_dims";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void processCommand(ICommandSender var1, String[] var2)
|
|
||||||
|
|
||||||
{
|
|
||||||
int numRemoved=0;
|
|
||||||
ArrayList dimsWithLinks=new ArrayList();
|
|
||||||
Collection<DimData> allDims = new ArrayList();
|
|
||||||
allDims.addAll(dimHelper.dimList.values());
|
|
||||||
for(DimData data: allDims)
|
|
||||||
{
|
|
||||||
|
|
||||||
for(LinkData link:data.printAllLinkData())
|
|
||||||
{
|
|
||||||
if(!dimsWithLinks.contains(link.destDimID))
|
|
||||||
{
|
|
||||||
dimsWithLinks.add(link.destDimID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(LinkData link : dimHelper.instance.interDimLinkList.values())
|
|
||||||
{
|
|
||||||
if(!dimsWithLinks.contains(link.destDimID))
|
|
||||||
{
|
|
||||||
dimsWithLinks.add(link.destDimID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(DimData data : allDims)
|
|
||||||
{
|
|
||||||
if(!dimsWithLinks.contains(data.dimID))
|
|
||||||
{
|
|
||||||
dimHelper.dimList.remove(data.dimID);
|
|
||||||
numRemoved++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dimHelper.instance.save();
|
|
||||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+numRemoved+" unreachable pocket dims.");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,708 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.BlockContainer;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
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 cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class dimDoor extends BlockContainer
|
|
||||||
{
|
|
||||||
|
|
||||||
protected dimDoor(int par1, Material material)
|
|
||||||
{
|
|
||||||
super(par1, Material.iron);
|
|
||||||
// this.blockIndexInTexture = 18;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTextureFile()
|
|
||||||
{
|
|
||||||
return "/PocketBlockTextures.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
//spawns the rift attatched to the block. Doesnt work in creative mode for some reason
|
|
||||||
//TODO make work in creative
|
|
||||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
|
|
||||||
{
|
|
||||||
if(!par1World.isRemote)
|
|
||||||
{
|
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
|
|
||||||
{
|
|
||||||
LinkData link= dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World);
|
|
||||||
par1World.setBlockWithNotify(par2, par3, par4, mod_pocketDim.blockRiftID);
|
|
||||||
|
|
||||||
}
|
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3-1, par4, par1World)!=null)
|
|
||||||
{
|
|
||||||
LinkData link= dimHelper.instance.getLinkDataFromCoords(par2, par3-1, par4, par1World);
|
|
||||||
par1World.setBlockWithNotify(par2, par3-1, par4, mod_pocketDim.blockRiftID);
|
|
||||||
|
|
||||||
}
|
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World)!=null)
|
|
||||||
{
|
|
||||||
LinkData link= dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World);
|
|
||||||
par1World.setBlockWithNotify(par2, par3+1, par4, mod_pocketDim.blockRiftID);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//finds the rift data and teleports the player to it.
|
|
||||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(!par1World.isRemote)
|
|
||||||
{
|
|
||||||
int var12 = (int) (MathHelper.floor_double((double)((par5Entity.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
|
||||||
|
|
||||||
int num=0;
|
|
||||||
LinkData linkData=null;
|
|
||||||
|
|
||||||
if(par1World.getBlockId(par2, par3-1, par4)==this.blockID)
|
|
||||||
{
|
|
||||||
num=par1World.getBlockMetadata(par2, par3-1, par4);
|
|
||||||
linkData= dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(par1World.getBlockId(par2, par3+1, par4)==this.blockID)
|
|
||||||
{
|
|
||||||
num=par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
linkData= dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!par1World.isRemote&&(num==5||num==4||num==6||num==7)&&(num-4)==var12)
|
|
||||||
{
|
|
||||||
|
|
||||||
//int destinationID= dimHelper.instance.getDestIDFromCoords(par2, par3, par4, par1World);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
System.out.println(linkData.destDimID);
|
|
||||||
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
|
||||||
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (!(par5Entity instanceof EntityPlayer)&&num>3)
|
|
||||||
{
|
|
||||||
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
|
||||||
|
|
||||||
|
|
||||||
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
|
||||||
{
|
|
||||||
|
|
||||||
boolean shouldOpen=true;
|
|
||||||
|
|
||||||
//System.out.println(String.valueOf(par1World.getBlockMetadata(par2, par3, par4)));
|
|
||||||
if(par5EntityPlayer.inventory.getCurrentItem()!=null)
|
|
||||||
{
|
|
||||||
if(par5EntityPlayer.inventory.getCurrentItem().getItem() == mod_pocketDim.itemRiftBlade)
|
|
||||||
{
|
|
||||||
shouldOpen=false;
|
|
||||||
if(!par1World.isRemote&&par1World.getBlockId(par2, par3-1, par4)==this.blockID)
|
|
||||||
{
|
|
||||||
int var12 = (int) (MathHelper.floor_double((double)((par5EntityPlayer.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
|
||||||
|
|
||||||
if(par1World.getBlockMetadata(par2, par3-1, par4)==var12)
|
|
||||||
{
|
|
||||||
var12=dimHelper.instance.flipDoorMetadata(var12);
|
|
||||||
}
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3-1, par4, var12);
|
|
||||||
if( dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
|
|
||||||
{
|
|
||||||
dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation= par1World.getBlockMetadata(par2, par3-1, par4);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!par1World.isRemote&&par1World.getBlockId(par2, par3+1, par4)==this.blockID)
|
|
||||||
{
|
|
||||||
int var12 = (int) (MathHelper.floor_double((double)((par5EntityPlayer.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
|
||||||
if(par1World.getBlockMetadata(par2, par3, par4)==var12)
|
|
||||||
{
|
|
||||||
var12=dimHelper.instance.flipDoorMetadata(var12);
|
|
||||||
}
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var12);
|
|
||||||
if( dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World)!=null)
|
|
||||||
{
|
|
||||||
dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World).linkOrientation= par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1001, par2, par3, par4, 0);
|
|
||||||
|
|
||||||
if(!shouldOpen&&!par1World.isRemote)
|
|
||||||
{
|
|
||||||
|
|
||||||
par5EntityPlayer.inventory.getCurrentItem().damageItem(5, par5EntityPlayer);
|
|
||||||
|
|
||||||
// par5EntityPlayer.sendChatToPlayer("You wedge the stick into a cranny in the door attempt to rotate the it");
|
|
||||||
// par5EntityPlayer.sendChatToPlayer("The door rotates, but the stick breaks in half and is lost");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(shouldOpen)
|
|
||||||
{
|
|
||||||
|
|
||||||
int var10 = this.getFullMetadata(par1World, par2, par3, par4);
|
|
||||||
int var11 = var10 & 7;
|
|
||||||
var11 ^= 4;
|
|
||||||
|
|
||||||
if ((var10 & 8) == 0)
|
|
||||||
{
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var11);
|
|
||||||
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var11);
|
|
||||||
par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
|
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
|
|
||||||
{
|
|
||||||
// System.out.println("Link orient is- " +dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A function to open a door.
|
|
||||||
*/
|
|
||||||
public void onPoweredBlockChange(World par1World, int par2, int par3, int par4, boolean par5)
|
|
||||||
{
|
|
||||||
int var6 = this.getFullMetadata(par1World, par2, par3, par4);
|
|
||||||
boolean var7 = (var6 & 4) != 0;
|
|
||||||
|
|
||||||
if (var7 != par5)
|
|
||||||
{
|
|
||||||
int var8 = var6 & 7;
|
|
||||||
var8 ^= 4;
|
|
||||||
|
|
||||||
if ((var6 & 8) == 0)
|
|
||||||
{
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var8);
|
|
||||||
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var8);
|
|
||||||
par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//TODO simplify this
|
|
||||||
@Override
|
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
if(!par1World.isRemote&&par1World.getBlockId(par2, par3-1, par4)==this.blockID)
|
|
||||||
{
|
|
||||||
boolean newDim=false;
|
|
||||||
|
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)==null)
|
|
||||||
{
|
|
||||||
newDim=true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(newDim)
|
|
||||||
{
|
|
||||||
LinkData link = new LinkData(par1World.provider.dimensionId, 0, par2, par3, par4, par2, par3, par4, true);
|
|
||||||
link.linkOrientation= par1World.getBlockMetadata(par2, par3-1, par4);
|
|
||||||
dimHelper.instance.createPocket(link,true, false);
|
|
||||||
// System.out.println(link.linkOrientation);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
|
|
||||||
{
|
|
||||||
dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation=par1World.getBlockMetadata(par2, par3-1, par4);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
|
|
||||||
*/
|
|
||||||
public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
||||||
{
|
|
||||||
if (par5 != 0 && par5 != 1)
|
|
||||||
{
|
|
||||||
int var6 = this.getFullMetadata(par1IBlockAccess, par2, par3, par4);
|
|
||||||
int var7 = this.blockIndexInTexture;
|
|
||||||
|
|
||||||
if ((var6 & 8) != 0)
|
|
||||||
{
|
|
||||||
var7 -= 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
int var8 = var6 & 3;
|
|
||||||
boolean var9 = (var6 & 4) != 0;
|
|
||||||
|
|
||||||
if (var9)
|
|
||||||
{
|
|
||||||
if (var8 == 0 && par5 == 2)
|
|
||||||
{
|
|
||||||
var7 = -var7;
|
|
||||||
}
|
|
||||||
else if (var8 == 1 && par5 == 5)
|
|
||||||
{
|
|
||||||
var7 = -var7;
|
|
||||||
}
|
|
||||||
else if (var8 == 2 && par5 == 3)
|
|
||||||
{
|
|
||||||
var7 = -var7;
|
|
||||||
}
|
|
||||||
else if (var8 == 3 && par5 == 4)
|
|
||||||
{
|
|
||||||
var7 = -var7;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (var8 == 0 && par5 == 5)
|
|
||||||
{
|
|
||||||
var7 = -var7;
|
|
||||||
}
|
|
||||||
else if (var8 == 1 && par5 == 3)
|
|
||||||
{
|
|
||||||
var7 = -var7;
|
|
||||||
}
|
|
||||||
else if (var8 == 2 && par5 == 4)
|
|
||||||
{
|
|
||||||
var7 = -var7;
|
|
||||||
}
|
|
||||||
else if (var8 == 3 && par5 == 2)
|
|
||||||
{
|
|
||||||
var7 = -var7;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((var6 & 16) != 0)
|
|
||||||
{
|
|
||||||
var7 = -var7;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return Math.abs(var7);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return this.blockIndexInTexture;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Called to update the render information on the tile entity. Could probably implement a data watcher, but this works fine and is more versatile I think.
|
|
||||||
public dimDoor updateAttatchedTile(IBlockAccess par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
TileEntity tile = (TileEntity) par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
if(tile instanceof TileEntityDimDoor )
|
|
||||||
{
|
|
||||||
TileEntityDimDoor dimTile=(TileEntityDimDoor)tile;
|
|
||||||
|
|
||||||
if(par1World.getBlockId( par2, par3+1, par4 )==par1World.getBlockId( par2, par3, par4 ))
|
|
||||||
{
|
|
||||||
//dimTile.openOrClosed=false;
|
|
||||||
}
|
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, (World)par1World)==null)
|
|
||||||
{
|
|
||||||
dimTile.openOrClosed=false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dimTile.openOrClosed=true;
|
|
||||||
}
|
|
||||||
|
|
||||||
int metaData = this.getFullMetadata(par1World, par2, par3, par4)%8;
|
|
||||||
dimTile.orientation=metaData;
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
|
||||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
|
||||||
*/
|
|
||||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
||||||
{
|
|
||||||
|
|
||||||
TileEntityDimDoor tile = (TileEntityDimDoor) par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
tile.openOrClosed=this.isDoorOpen( par1World, par2, par3, par4);
|
|
||||||
int metaData = this.getFullMetadata(par1World, par2, par3, par4);
|
|
||||||
tile.orientation=metaData%8 ;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
public boolean isOpaqueCube()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
int var5 = this.getFullMetadata(par1IBlockAccess, par2, par3, par4);
|
|
||||||
return (var5 & 4) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
|
||||||
*/
|
|
||||||
public boolean renderAsNormalBlock()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The type of render function that is called for this block
|
|
||||||
*/
|
|
||||||
public int getRenderType()
|
|
||||||
{
|
|
||||||
return 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the bounding box of the wired rectangular prism to render.
|
|
||||||
*/
|
|
||||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
|
||||||
return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
|
||||||
* cleared to be reused)
|
|
||||||
*/
|
|
||||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
|
||||||
return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates the blocks bounds based on its current state. Args: world, x, y, z
|
|
||||||
*/
|
|
||||||
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
this.setDoorRotation(this.getFullMetadata(par1IBlockAccess, par2, par3, par4));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns 0, 1, 2 or 3 depending on where the hinge is.
|
|
||||||
*/
|
|
||||||
public int getDoorOrientation(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return this.getFullMetadata(par1IBlockAccess, par2, par3, par4) & 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDoorOpen(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return (this.getFullMetadata(par1IBlockAccess, par2, par3, par4) & 4) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setDoorRotation(int par1)
|
|
||||||
{
|
|
||||||
float var2 = 0.1875F;
|
|
||||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
|
|
||||||
int var3 = par1 & 3;
|
|
||||||
boolean var4 = (par1 & 4) != 0;
|
|
||||||
boolean var5 = (par1 & 16) != 0;
|
|
||||||
|
|
||||||
if (var3 == 0)
|
|
||||||
{
|
|
||||||
if (var4)
|
|
||||||
{
|
|
||||||
if (!var5)
|
|
||||||
{
|
|
||||||
this.setBlockBounds(0.001F, 0.0F, 0.0F, 1.0F, 1.0F, var2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.setBlockBounds(0.001F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (var3 == 1)
|
|
||||||
{
|
|
||||||
if (var4)
|
|
||||||
{
|
|
||||||
if (!var5)
|
|
||||||
{
|
|
||||||
this.setBlockBounds(1.0F - var2, 0.0F, 0.001F, 1.0F, 1.0F, 1.0F);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.setBlockBounds(0.0F, 0.0F, 0.001F, var2, 1.0F, 1.0F);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (var3 == 2)
|
|
||||||
{
|
|
||||||
if (var4)
|
|
||||||
{
|
|
||||||
if (!var5)
|
|
||||||
{
|
|
||||||
this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, .99F, 1.0F, 1.0F);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, .99F, 1.0F, var2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (var3 == 3)
|
|
||||||
{
|
|
||||||
if (var4)
|
|
||||||
{
|
|
||||||
if (!var5)
|
|
||||||
{
|
|
||||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 0.99F);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 0.99F);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the block is clicked by a player. Args: x, y, z, entityPlayer
|
|
||||||
*/
|
|
||||||
public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
|
|
||||||
{
|
|
||||||
// System.out.println(this.getFullMetadata(par1World, par2, par3, par4)%4);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called upon block activation (right click on the block.)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A function to open a door.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
|
|
||||||
* their own) Args: x, y, z, neighbor blockID
|
|
||||||
*/
|
|
||||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
|
|
||||||
{
|
|
||||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
|
|
||||||
if ((var6 & 8) == 0)
|
|
||||||
{
|
|
||||||
boolean var7 = false;
|
|
||||||
|
|
||||||
if (par1World.getBlockId(par2, par3 + 1, par4) != this.blockID)
|
|
||||||
{
|
|
||||||
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
|
||||||
var7 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4))
|
|
||||||
{
|
|
||||||
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
|
||||||
var7 = true;
|
|
||||||
|
|
||||||
if (par1World.getBlockId(par2, par3 + 1, par4) == this.blockID)
|
|
||||||
{
|
|
||||||
par1World.setBlockWithNotify(par2, par3 + 1, par4, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
**/
|
|
||||||
|
|
||||||
if (var7)
|
|
||||||
{
|
|
||||||
if (!par1World.isRemote)
|
|
||||||
{
|
|
||||||
this.dropBlockAsItem(par1World, par2, par3, par4, mod_pocketDim.dimDoorID, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
boolean var8 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
|
|
||||||
|
|
||||||
if ((var8 || par5 > 0 && Block.blocksList[par5].canProvidePower()) && par5 != this.blockID)
|
|
||||||
{
|
|
||||||
this.onPoweredBlockChange(par1World, par2, par3, par4, var8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (par1World.getBlockId(par2, par3 - 1, par4) != this.blockID)
|
|
||||||
{
|
|
||||||
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par5 > 0 && par5 != this.blockID)
|
|
||||||
{
|
|
||||||
this.onNeighborBlockChange(par1World, par2, par3 - 1, par4, par5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the ID of the items to drop on destruction.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world,
|
|
||||||
* x, y, z, startVec, endVec
|
|
||||||
*/
|
|
||||||
public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3)
|
|
||||||
{
|
|
||||||
this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
|
||||||
return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
|
|
||||||
*/
|
|
||||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return par3 >= 255 ? false : par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && super.canPlaceBlockAt(par1World, par2, par3, par4) && super.canPlaceBlockAt(par1World, par2, par3 + 1, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility
|
|
||||||
* and stop pistons
|
|
||||||
*/
|
|
||||||
public int getMobilityFlag()
|
|
||||||
{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the full metadata value created by combining the metadata of both blocks the door takes up.
|
|
||||||
*/
|
|
||||||
public int getFullMetadata(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
|
|
||||||
boolean var6 = (var5 & 8) != 0;
|
|
||||||
int var7;
|
|
||||||
int var8;
|
|
||||||
|
|
||||||
if (var6)
|
|
||||||
{
|
|
||||||
var7 = par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4);
|
|
||||||
var8 = var5;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var7 = var5;
|
|
||||||
var8 = par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean var9 = (var8 & 1) != 0;
|
|
||||||
return var7 & 7 | (var6 ? 8 : 0) | (var9 ? 16 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
||||||
*/
|
|
||||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return Item.doorSteel.itemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int idDropped(int par1, Random par2Random, int par3)
|
|
||||||
{
|
|
||||||
return (par1 & 8) != 0 ? 0 : (Item.doorSteel.itemID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the block is attempted to be harvested
|
|
||||||
*/
|
|
||||||
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer)
|
|
||||||
{
|
|
||||||
if (par6EntityPlayer.capabilities.isCreativeMode && (par5 & 8) != 0 && par1World.getBlockId(par2, par3 - 1, par4) == this.blockID)
|
|
||||||
{
|
|
||||||
par1World.setBlockWithNotify(par2, par3 - 1, par4, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public TileEntity createNewTileEntity(World par1World)
|
|
||||||
{
|
|
||||||
|
|
||||||
TileEntity tile= new TileEntityDimDoor();
|
|
||||||
|
|
||||||
return tile;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import net.minecraft.block.BlockTrapDoor;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class dimHatch extends BlockTrapDoor
|
|
||||||
{
|
|
||||||
|
|
||||||
protected dimHatch(int par1,int par2, Material par2Material)
|
|
||||||
{
|
|
||||||
super(par1, Material.iron);
|
|
||||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
|
||||||
// this.setTextureFile("/PocketBlockTextures.png");
|
|
||||||
// this.blockIndexInTexture = 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTextureFile()
|
|
||||||
{
|
|
||||||
this.blockIndexInTexture = 16;
|
|
||||||
return "/PocketBlockTextures.png";
|
|
||||||
}
|
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
|
||||||
{
|
|
||||||
|
|
||||||
{
|
|
||||||
int var10 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var10 ^ 4);
|
|
||||||
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Teleports the player to the exit link of that dimension, assuming it is a pocket
|
|
||||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
|
||||||
{
|
|
||||||
|
|
||||||
int num = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
|
|
||||||
if(!par1World.isRemote&&(num>3&&num<8||num>11)&&par1World.provider instanceof pocketProvider)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
|
||||||
|
|
||||||
DimData dimData = (DimData) dimHelper.instance.dimList.get(par1World.provider.dimensionId);
|
|
||||||
|
|
||||||
LinkData exitLink=dimData.exitDimLink;
|
|
||||||
|
|
||||||
dimHelper.instance.teleportToPocket(par1World, exitLink, par5Entity);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onPoweredBlockChange(World par1World, int par2, int par3, int par4, boolean par5)
|
|
||||||
{
|
|
||||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
boolean var7 = (var6 & 4) > 0;
|
|
||||||
|
|
||||||
if (var7 != par5)
|
|
||||||
{
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 ^ 4);
|
|
||||||
par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,106 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemDoor;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class itemDimDoor extends ItemDoor
|
|
||||||
{
|
|
||||||
private Material doorMaterial;
|
|
||||||
|
|
||||||
public itemDimDoor(int par1, Material par2Material)
|
|
||||||
{
|
|
||||||
super(par1, par2Material);
|
|
||||||
this.doorMaterial = par2Material;
|
|
||||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getTextureFile()
|
|
||||||
{
|
|
||||||
return "/PocketBlockTextures.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
par3List.add("Place on the block under a rift");
|
|
||||||
par3List.add ("to activate that rift,");
|
|
||||||
par3List.add("or place anywhere else");
|
|
||||||
par3List.add("to create a pocket dim");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
|
||||||
{
|
|
||||||
if (par7 != 1)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++par5;
|
|
||||||
Block var11;
|
|
||||||
|
|
||||||
|
|
||||||
if(par1ItemStack.getItem() instanceof itemExitDoor )
|
|
||||||
{
|
|
||||||
var11 = mod_pocketDim.ExitDoor;
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(par1ItemStack.getItem() instanceof ItemChaosDoor )
|
|
||||||
{
|
|
||||||
var11 = mod_pocketDim.chaosDoor;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var11 = mod_pocketDim.dimDoor;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)&&!par3World.isRemote)
|
|
||||||
{
|
|
||||||
int var12 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
|
||||||
|
|
||||||
if (!var11.canPlaceBlockAt(par3World, par4, par5, par6)||!this.canPlace(par3World, par4, par5, par6, var12))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
placeDoorBlock(par3World, par4, par5, par6, var12, var11);
|
|
||||||
|
|
||||||
|
|
||||||
--par1ItemStack.stackSize;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlace(World world,int i, int j, int k, int p)
|
|
||||||
{
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemDoor;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class itemExitDoor extends itemDimDoor
|
|
||||||
{
|
|
||||||
private Material doorMaterial;
|
|
||||||
|
|
||||||
public itemExitDoor(int par1, Material par2Material)
|
|
||||||
{
|
|
||||||
super(par1, par2Material);
|
|
||||||
this.doorMaterial = par2Material;
|
|
||||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
|
||||||
|
|
||||||
// this.setIconIndex(Item.doorWood.getIconFromDamage(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTextureFile()
|
|
||||||
{
|
|
||||||
return "/PocketBlockTextures.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
par3List.add("Place on the block under a rift");
|
|
||||||
par3List.add ("in any dimension,");
|
|
||||||
par3List.add("or place anywhere in pocket dim");
|
|
||||||
par3List.add("to approach surface");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,172 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class itemLinkSignature extends Item
|
|
||||||
{
|
|
||||||
private Material doorMaterial;
|
|
||||||
|
|
||||||
public itemLinkSignature(int par1, Material par2Material)
|
|
||||||
{
|
|
||||||
super(par1);
|
|
||||||
this.setMaxStackSize(1);
|
|
||||||
// this.setTextureFile("/PocketBlockTextures.png");
|
|
||||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
|
||||||
|
|
||||||
// this.iconIndex=5;
|
|
||||||
this.setMaxDamage(0);
|
|
||||||
this.hasSubtypes=true;
|
|
||||||
//TODO move to proxy
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public boolean hasEffect(ItemStack par1ItemStack)
|
|
||||||
{
|
|
||||||
// adds effect if item has a link stored
|
|
||||||
int key=par1ItemStack.getItemDamage();
|
|
||||||
LinkData linkData= dimHelper.instance.interDimLinkList.get(key);
|
|
||||||
if(linkData!=null)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTextureFile()
|
|
||||||
{
|
|
||||||
return "/PocketBlockTextures.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
|
||||||
{
|
|
||||||
int key;
|
|
||||||
LinkData linkData;
|
|
||||||
int thisWorldID=par3World.provider.dimensionId;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!par3World.isRemote)
|
|
||||||
{
|
|
||||||
|
|
||||||
//par1ItemStack= par2EntityPlayer.getCurrentEquippedItem();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
key=par1ItemStack.getItemDamage();
|
|
||||||
linkData = dimHelper.instance.interDimLinkList.get(key);
|
|
||||||
//System.out.println(key);
|
|
||||||
int offset = 2;
|
|
||||||
if(linkData!=null&&key!=0)
|
|
||||||
{
|
|
||||||
// checks to see if the item has a link stored, if so, it creates it
|
|
||||||
if(par3World.getBlockId(par4, par5, par6)==Block.snow.blockID)
|
|
||||||
{
|
|
||||||
offset = 1;
|
|
||||||
}
|
|
||||||
dimHelper.instance.createLink(par3World.provider.dimensionId, linkData.destDimID, par4, par5+offset, par6, linkData.destXCoord, linkData.destYCoord, linkData.destZCoord);
|
|
||||||
dimHelper.instance.createLink(linkData.destDimID, par3World.provider.dimensionId, linkData.destXCoord, linkData.destYCoord, linkData.destZCoord,par4, par5+offset, par6);
|
|
||||||
|
|
||||||
--par1ItemStack.stackSize;
|
|
||||||
par2EntityPlayer.sendChatToPlayer("Rift Created");
|
|
||||||
if(par2EntityPlayer.capabilities.isCreativeMode)
|
|
||||||
{
|
|
||||||
par2EntityPlayer.sendChatToPlayer("Rift Signature Cleared");
|
|
||||||
|
|
||||||
par2EntityPlayer.inventory.mainInventory[par2EntityPlayer.inventory.currentItem] = new ItemStack(this, 1, 0);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
else
|
|
||||||
{
|
|
||||||
par2EntityPlayer.sendChatToPlayer("Both ends of a single rift cannot exist in the same dimension.");
|
|
||||||
|
|
||||||
}
|
|
||||||
**/
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(par3World.getBlockId(par4, par5, par6)==Block.snow.blockID)
|
|
||||||
{
|
|
||||||
offset = 1;
|
|
||||||
}
|
|
||||||
//otherwise, it creates the first half of the link. Next click will complete it.
|
|
||||||
key= dimHelper.instance.createUniqueInterDimLinkKey();
|
|
||||||
linkData= new LinkData(par3World.provider.dimensionId,par4, par5+offset, par6);
|
|
||||||
|
|
||||||
|
|
||||||
dimHelper.instance.interDimLinkList.put(key, linkData);
|
|
||||||
par1ItemStack.setItemDamage(key);
|
|
||||||
|
|
||||||
PacketHandler.linkKeyPacket(linkData, key);
|
|
||||||
par2EntityPlayer.sendChatToPlayer("Rift Signature Stored");
|
|
||||||
|
|
||||||
par2EntityPlayer.inventory.mainInventory[par2EntityPlayer.inventory.currentItem] = new ItemStack(this, 1, key);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//dimHelper.instance.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* allows items to add custom lines of information to the mouseover description
|
|
||||||
*/
|
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
||||||
{
|
|
||||||
|
|
||||||
LinkData linkData = dimHelper.instance.interDimLinkList.get(par1ItemStack.getItemDamage());
|
|
||||||
if(linkData!=null)
|
|
||||||
{
|
|
||||||
par3List.add(String.valueOf("Leads to dim "+linkData.destDimID +" at depth "+dimHelper.instance.getDimDepth(linkData.destDimID)));
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
par3List.add("First click stores location,");
|
|
||||||
par3List.add ("second click creates two rifts,");
|
|
||||||
par3List.add("that link the first location");
|
|
||||||
par3List.add("with the second location");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
||||||
{
|
|
||||||
if(!par2World.isRemote)
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
//creates the first half of the link on item creation
|
|
||||||
int key= dimHelper.instance.createUniqueInterDimLinkKey();
|
|
||||||
LinkData linkData= new LinkData(par2World.provider.dimensionId,MathHelper.floor_double(par3EntityPlayer.posX),MathHelper.floor_double(par3EntityPlayer.posY),MathHelper.floor_double(par3EntityPlayer.posZ));
|
|
||||||
System.out.println(key);
|
|
||||||
|
|
||||||
dimHelper.instance.interDimLinkList.put(key, linkData);
|
|
||||||
par1ItemStack.setItemDamage(key);
|
|
||||||
**/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import net.minecraft.util.Vec3;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class itemRiftRemover extends Item
|
|
||||||
{
|
|
||||||
private Material doorMaterial;
|
|
||||||
|
|
||||||
public itemRiftRemover(int par1, Material par2Material)
|
|
||||||
{
|
|
||||||
super(par1);
|
|
||||||
this.setMaxStackSize(1);
|
|
||||||
// this.setTextureFile("/PocketBlockTextures.png");
|
|
||||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
|
||||||
|
|
||||||
// this.iconIndex=6;
|
|
||||||
this.setMaxDamage(5);
|
|
||||||
this.hasSubtypes=true;
|
|
||||||
//TODO move to proxy
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTextureFile()
|
|
||||||
{
|
|
||||||
return "/PocketBlockTextures.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public boolean hasEffect(ItemStack par1ItemStack)
|
|
||||||
{
|
|
||||||
// adds effect if item has a link stored
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MovingObjectPosition getBlockTarget(World par1World, EntityPlayer par2EntityPlayer, boolean par3)
|
|
||||||
{
|
|
||||||
float var4 = 1.0F;
|
|
||||||
float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4;
|
|
||||||
float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4;
|
|
||||||
double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4;
|
|
||||||
double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset;
|
|
||||||
double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4;
|
|
||||||
Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11);
|
|
||||||
float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI);
|
|
||||||
float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI);
|
|
||||||
float var16 = -MathHelper.cos(-var5 * 0.017453292F);
|
|
||||||
float var17 = MathHelper.sin(-var5 * 0.017453292F);
|
|
||||||
float var18 = var15 * var16;
|
|
||||||
float var20 = var14 * var16;
|
|
||||||
double var21 = 5.0D;
|
|
||||||
if (par2EntityPlayer instanceof EntityPlayerMP)
|
|
||||||
{
|
|
||||||
var21 = 6;
|
|
||||||
}
|
|
||||||
Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
|
|
||||||
return par1World.rayTraceBlocks_do_do(var13, var23, true, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
||||||
{
|
|
||||||
{
|
|
||||||
MovingObjectPosition hit = this.getBlockTarget(par3EntityPlayer.worldObj, par3EntityPlayer, false );
|
|
||||||
if(hit!=null)
|
|
||||||
{
|
|
||||||
//System.out.println(hit.hitVec);
|
|
||||||
if(dimHelper.instance.removeRift(par2World, hit.blockX, hit.blockY, hit.blockZ, 1, par3EntityPlayer, par1ItemStack))
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// dimHelper.removeRift( par3World, par4, par5, par6, range, par2EntityPlayer, par1ItemStack);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* allows items to add custom lines of information to the mouseover description
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
par3List.add("Use near exposed rift");
|
|
||||||
par3List.add ("to remove it and");
|
|
||||||
par3List.add("any nearby rifts");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
||||||
{
|
|
||||||
if(!par2World.isRemote)
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
//creates the first half of the link on item creation
|
|
||||||
int key= dimHelper.instance.createUniqueInterDimLinkKey();
|
|
||||||
LinkData linkData= new LinkData(par2World.provider.dimensionId,MathHelper.floor_double(par3EntityPlayer.posX),MathHelper.floor_double(par3EntityPlayer.posY),MathHelper.floor_double(par3EntityPlayer.posZ));
|
|
||||||
System.out.println(key);
|
|
||||||
|
|
||||||
dimHelper.instance.interDimLinkList.put(key, linkData);
|
|
||||||
par1ItemStack.setItemDamage(key);
|
|
||||||
**/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class linkDimDoor extends dimDoor
|
|
||||||
{
|
|
||||||
|
|
||||||
protected linkDimDoor(int par1, Material par2Material)
|
|
||||||
{
|
|
||||||
|
|
||||||
super(par1, par2Material);
|
|
||||||
//this.blockIndexInTexture = 17;
|
|
||||||
this.setTextureFile("/PocketBlockTextures.png");
|
|
||||||
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTextureFile()
|
|
||||||
{
|
|
||||||
return "/PocketBlockTextures.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
if(!par1World.isRemote&&par1World.getBlockId(par2, par3-1, par4)==this.blockID)
|
|
||||||
{
|
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
|
|
||||||
{
|
|
||||||
dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation=par1World.getBlockMetadata(par2, par3-1, par4);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
System.out.println("couldnt find parent link!!!!!!");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
//this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
|
||||||
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
|
||||||
{
|
|
||||||
|
|
||||||
int var12 = (int) (MathHelper.floor_double((double)((par5Entity.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
|
||||||
|
|
||||||
int num = par1World.getBlockMetadata(par2, par3-1, par4);
|
|
||||||
if(!par1World.isRemote&&(num==5||num==4||num==6||num==7)&&(num-4)==var12&&par1World.getBlockId(par2, par3-1, par4)==mod_pocketDim.linkDimDoorID)
|
|
||||||
{
|
|
||||||
EntityPlayer player;
|
|
||||||
if(par5Entity instanceof EntityPlayerMP)
|
|
||||||
{
|
|
||||||
|
|
||||||
player= (EntityPlayer) par5Entity;
|
|
||||||
//int destinationID= dimHelper.instance.getDestIDFromCoords(par2, par3, par4, par1World);
|
|
||||||
|
|
||||||
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
|
||||||
|
|
||||||
LinkData linkData= dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World);
|
|
||||||
dimHelper.instance.teleportToPocket(par1World, linkData, player);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return Item.doorSteel.itemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int idDropped(int par1, Random par2Random, int par3)
|
|
||||||
{
|
|
||||||
return (par1 & 8) != 0 ? 0 : (Item.doorSteel.itemID);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//System.out.println(String.valueOf(par1World.getBlockMetadata(par2, par3-1, par4)));
|
|
||||||
|
|
||||||
int var10 = this.getFullMetadata(par1World, par2, par3, par4);
|
|
||||||
int var11 = var10 & 7;
|
|
||||||
var11 ^= 4;
|
|
||||||
|
|
||||||
if ((var10 & 8) == 0)
|
|
||||||
{
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var11);
|
|
||||||
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var11);
|
|
||||||
par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class linkExitDoor extends dimDoor
|
|
||||||
{
|
|
||||||
|
|
||||||
protected linkExitDoor(int par1,Material par2Material)
|
|
||||||
{
|
|
||||||
|
|
||||||
super(par1, Material.wood);
|
|
||||||
//this.blockIndexInTexture = 20;
|
|
||||||
|
|
||||||
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTextureFile()
|
|
||||||
{
|
|
||||||
return "/PocketBlockTextures.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
if(!par1World.isRemote&&par1World.getBlockId(par2, par3-1, par4)==this.blockID)
|
|
||||||
{
|
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
|
|
||||||
{
|
|
||||||
dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation=par1World.getBlockMetadata(par2, par3-1, par4);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
System.out.println("couldnt find parent link!!!!");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
|
||||||
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int var12 = (int) (MathHelper.floor_double((double)((par5Entity.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
|
||||||
|
|
||||||
int num = par1World.getBlockMetadata(par2, par3-1, par4);
|
|
||||||
if(!par1World.isRemote&&(num==5||num==4||num==6||num==7)&&(num-4)==var12&&par1World.getBlockId(par2, par3-1, par4)==mod_pocketDim.linkExitDoorID)
|
|
||||||
{
|
|
||||||
EntityPlayer player;
|
|
||||||
if(par5Entity instanceof EntityPlayer)
|
|
||||||
{
|
|
||||||
|
|
||||||
player= (EntityPlayer) par5Entity;
|
|
||||||
//int destinationID= dimHelper.instance.getDestIDFromCoords(par2, par3, par4, par1World);
|
|
||||||
|
|
||||||
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
|
||||||
|
|
||||||
LinkData linkData= dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World);
|
|
||||||
dimHelper.instance.teleportToPocket(par1World, linkData, player);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//System.out.println(String.valueOf(par1World.getBlockMetadata(par2, par3-1, par4)));
|
|
||||||
|
|
||||||
int var10 = this.getFullMetadata(par1World, par2, par3, par4);
|
|
||||||
int var11 = var10 & 7;
|
|
||||||
var11 ^= 4;
|
|
||||||
|
|
||||||
if ((var10 & 8) == 0)
|
|
||||||
{
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var11);
|
|
||||||
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var11);
|
|
||||||
par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return Item.doorWood.itemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int idDropped(int par1, Random par2Random, int par3)
|
|
||||||
{
|
|
||||||
return (par1 & 8) != 0 ? 0 : (Item.doorWood.itemID);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,629 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.command.ICommand;
|
|
||||||
import net.minecraft.entity.item.EntityItem;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.common.Configuration;
|
|
||||||
import net.minecraftforge.common.DimensionManager;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import StevenDimDoors.mod_pocketDimClient.ClientPacketHandler;
|
|
||||||
import StevenDimDoors.mod_pocketDimClient.ClientTickHandler;
|
|
||||||
import cpw.mods.fml.common.Mod;
|
|
||||||
import cpw.mods.fml.common.Mod.Init;
|
|
||||||
import cpw.mods.fml.common.Mod.Instance;
|
|
||||||
import cpw.mods.fml.common.Mod.PostInit;
|
|
||||||
import cpw.mods.fml.common.Mod.PreInit;
|
|
||||||
import cpw.mods.fml.common.Mod.ServerStarting;
|
|
||||||
import cpw.mods.fml.common.Mod.ServerStopping;
|
|
||||||
import cpw.mods.fml.common.SidedProxy;
|
|
||||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
|
||||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
|
||||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
|
||||||
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
|
|
||||||
import cpw.mods.fml.common.network.NetworkMod;
|
|
||||||
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
|
||||||
import cpw.mods.fml.common.registry.TickRegistry;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import StevenDimDoors.mod_pocketDim.commands.CommandDeleteAllLinks;
|
|
||||||
import StevenDimDoors.mod_pocketDim.commands.CommandDeleteDimData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.commands.CommandDeleteRifts;
|
|
||||||
import StevenDimDoors.mod_pocketDim.commands.CommandPruneDims;
|
|
||||||
|
|
||||||
@Mod(modid = "DimensionalDoors", name = "Dimensional Doors", version = mod_pocketDim.version)
|
|
||||||
|
|
||||||
@NetworkMod(clientSideRequired = true, serverSideRequired = false,
|
|
||||||
clientPacketHandlerSpec =
|
|
||||||
@SidedPacketHandler(channels = {"pocketDim" }, packetHandler = ClientPacketHandler.class),
|
|
||||||
serverPacketHandlerSpec =
|
|
||||||
@SidedPacketHandler(channels = {"pocketDim" }, packetHandler = ServerPacketHandler.class),
|
|
||||||
channels={"GenericRandom"}, packetHandler = PacketHandler.class, connectionHandler=ConnectionHandler.class)
|
|
||||||
|
|
||||||
public class mod_pocketDim
|
|
||||||
{
|
|
||||||
|
|
||||||
public static final String version = "1.4.7R1.3.1RC2";
|
|
||||||
//need to clean up
|
|
||||||
@SidedProxy(clientSide = "StevenDimDoors.mod_pocketDimClient.ClientProxy", serverSide = "StevenDimDoors.mod_pocketDim.CommonProxy")
|
|
||||||
public static CommonProxy proxy;
|
|
||||||
|
|
||||||
@Instance("PocketDimensions")
|
|
||||||
public static mod_pocketDim instance = new mod_pocketDim();
|
|
||||||
public static SchematicLoader loader = new SchematicLoader();
|
|
||||||
|
|
||||||
public static final ICommand removeRiftsCommand = new CommandDeleteRifts();
|
|
||||||
public static final ICommand pruneDimsCommand = new CommandPruneDims();
|
|
||||||
public static final ICommand removeAllLinksCommand = new CommandDeleteAllLinks();
|
|
||||||
public static final ICommand deleteDimDataCommand = new CommandDeleteDimData();
|
|
||||||
|
|
||||||
|
|
||||||
public static int providerID;
|
|
||||||
public static int dimDoorID;
|
|
||||||
public static int ExitDoorID;
|
|
||||||
public static int linkExitDoorID;
|
|
||||||
public static int itemLinkSignatureID;
|
|
||||||
public static int blockRiftID;
|
|
||||||
public static int transientDoorID;
|
|
||||||
public static int itemRiftBladeID;
|
|
||||||
public static int limboExitRange;
|
|
||||||
// public static int railRenderID;
|
|
||||||
|
|
||||||
public static int itemStableFabricID;
|
|
||||||
public static int itemExitDoorID;
|
|
||||||
public static int limboDimID;
|
|
||||||
public static int limboProviderID;
|
|
||||||
public static int itemChaosDoorID;
|
|
||||||
public static int chaosDoorID;
|
|
||||||
public static int blockLimboID;
|
|
||||||
public static int dimHatchID;
|
|
||||||
// public static int dimRailID;
|
|
||||||
|
|
||||||
public static int riftSpreadFactor;
|
|
||||||
public static int DoorRenderID=55;
|
|
||||||
public static int HOW_MUCH_TNT;
|
|
||||||
|
|
||||||
|
|
||||||
public static int itemDimDoorID;
|
|
||||||
public static int linkDimDoorID;
|
|
||||||
public static int blockDimWallID;
|
|
||||||
public static int itemRiftRemoverID;
|
|
||||||
public static int blockDimWallPermID;
|
|
||||||
public static Block linkDimDoor;
|
|
||||||
public static Block transientDoor;
|
|
||||||
public static Block ExitDoor;
|
|
||||||
public static Block chaosDoor;
|
|
||||||
public static Block linkExitDoor;
|
|
||||||
public static Block blockRift;
|
|
||||||
public static Block blockLimbo;
|
|
||||||
public static Block dimDoor;
|
|
||||||
// public static Block dimRail;
|
|
||||||
|
|
||||||
public static Block blockDimWall;
|
|
||||||
public static Block dimHatch;
|
|
||||||
public static Block blockDimWallPerm;
|
|
||||||
public static Item itemRiftBlade;
|
|
||||||
|
|
||||||
public static Item itemDimDoor;
|
|
||||||
public static Item itemExitDoor;
|
|
||||||
public static Item itemRiftRemover;
|
|
||||||
public static Item itemLinkSignature;
|
|
||||||
public static Item itemStableFabric;
|
|
||||||
public static Item itemChaosDoor;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static PlayerRespawnTracker tracker= new PlayerRespawnTracker();
|
|
||||||
|
|
||||||
public static ArrayList<EntityItem> limboSpawnInventory=new ArrayList<EntityItem>();
|
|
||||||
|
|
||||||
public static ArrayList blocksImmuneToRift= new ArrayList();
|
|
||||||
public static ArrayList<DungeonGenerator> registeredDungeons = new ArrayList<DungeonGenerator>();
|
|
||||||
|
|
||||||
public static ArrayList<DungeonGenerator> simpleHalls = new ArrayList<DungeonGenerator>();
|
|
||||||
|
|
||||||
|
|
||||||
public static ArrayList<DungeonGenerator> complexHalls = new ArrayList<DungeonGenerator>();
|
|
||||||
|
|
||||||
|
|
||||||
public static ArrayList<DungeonGenerator> deadEnds = new ArrayList<DungeonGenerator>();
|
|
||||||
|
|
||||||
|
|
||||||
public static ArrayList<DungeonGenerator> hubs = new ArrayList<DungeonGenerator>();
|
|
||||||
|
|
||||||
|
|
||||||
public static ArrayList<DungeonGenerator> mazes = new ArrayList<DungeonGenerator>();
|
|
||||||
|
|
||||||
|
|
||||||
public static ArrayList<DungeonGenerator> pistonTraps = new ArrayList<DungeonGenerator>();
|
|
||||||
|
|
||||||
|
|
||||||
public static ArrayList<DungeonGenerator> exits = new ArrayList<DungeonGenerator>();
|
|
||||||
|
|
||||||
public static ArrayList metadataFlipList = new ArrayList();
|
|
||||||
public static ArrayList metadataNextList = new ArrayList();
|
|
||||||
|
|
||||||
public static DungeonGenerator defaultUp = new DungeonGenerator(0, "smallStairsUp.schematic", null);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static boolean riftsInWorldGen;
|
|
||||||
|
|
||||||
public static boolean isLimboActive;
|
|
||||||
|
|
||||||
public static boolean enableIronDimDoor;
|
|
||||||
|
|
||||||
public static boolean enableWoodenDimDoor;
|
|
||||||
|
|
||||||
public static boolean enableRiftSignature;
|
|
||||||
|
|
||||||
public static boolean enableRiftRemover;
|
|
||||||
|
|
||||||
public static boolean enableUnstableDoor;
|
|
||||||
|
|
||||||
public static boolean enableRiftBlade;
|
|
||||||
|
|
||||||
// public static boolean enableDimRail;
|
|
||||||
|
|
||||||
public static boolean enableDimTrapDoor;
|
|
||||||
|
|
||||||
public static boolean enableDoorOpenGL;
|
|
||||||
|
|
||||||
public static boolean hardcoreLimbo;
|
|
||||||
|
|
||||||
|
|
||||||
public static boolean hasInitDims=false;
|
|
||||||
|
|
||||||
public static boolean TNFREAKINGT;
|
|
||||||
|
|
||||||
public static boolean isPlayerWearingGoogles=false;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static RiftGenerator riftGen = new RiftGenerator();
|
|
||||||
|
|
||||||
|
|
||||||
// public static World limbo= null;
|
|
||||||
|
|
||||||
public static long genTime;
|
|
||||||
public static boolean enableRiftGrief;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PreInit
|
|
||||||
public void PreInit(FMLPreInitializationEvent event)
|
|
||||||
{
|
|
||||||
|
|
||||||
MinecraftForge.EVENT_BUS.register(new EventHookContainer());
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
config.load();
|
|
||||||
// this.enableDimRail = config.get("BOOLEAN", "true to enable dim rail crafting", true).getBoolean(true);
|
|
||||||
this.hardcoreLimbo = config.get("BOOLEAN", "true to cause player to respawn in Limbo", false).getBoolean(false);
|
|
||||||
this.enableDimTrapDoor = config.get("BOOLEAN", "true to enable trap door crafting", true).getBoolean(true);
|
|
||||||
this.enableIronDimDoor = config.get("BOOLEAN", "true to enable iron dim door crafting", true).getBoolean(true);
|
|
||||||
this.enableRiftBlade = config.get("BOOLEAN", "true to enable rift blade crafting", true).getBoolean(true);
|
|
||||||
this.enableRiftRemover = config.get("BOOLEAN", "true to enable rift remover crafting", true).getBoolean(true);
|
|
||||||
this.enableRiftSignature = config.get("BOOLEAN", "true to enable rift signature crafting", true).getBoolean(true);
|
|
||||||
this.enableUnstableDoor = config.get("BOOLEAN", "true to enable unstable door crafting", true).getBoolean(true);
|
|
||||||
this.enableWoodenDimDoor = config.get("BOOLEAN", "true to enable wooden door crafting", true).getBoolean(true);
|
|
||||||
this.enableDoorOpenGL = config.get("BOOLEAN", "Toggles the door render effect", true).getBoolean(true);
|
|
||||||
|
|
||||||
// dimRailID = config.getBlock("Dimensional Rail", 1980).getInt();
|
|
||||||
|
|
||||||
chaosDoorID = config.getBlock("Chaos Door", 1978).getInt();
|
|
||||||
dimDoorID = config.getBlock("Dimensional Door", 1970).getInt();
|
|
||||||
dimHatchID = config.getBlock("Transdimensional Trapdoor", 1971).getInt();
|
|
||||||
linkDimDoorID= config.getBlock("Dimensional Door Link", 1972).getInt();
|
|
||||||
blockDimWallID=config.getBlock("Fabric of Reality", 1973).getInt();
|
|
||||||
ExitDoorID = config.getBlock("Warp Door", 1975).getInt();
|
|
||||||
linkExitDoorID = config.getBlock("Warp Door Link", 1976).getInt();
|
|
||||||
blockRiftID = config.getBlock("Rift", 1977).getInt();
|
|
||||||
transientDoorID = config.getBlock("transientDoorID", 1979).getInt();
|
|
||||||
|
|
||||||
itemRiftBladeID=config.getItem("Rift Blade", 5676).getInt();
|
|
||||||
itemChaosDoorID=config.getItem("Chaos Door", 5673).getInt();
|
|
||||||
itemRiftRemoverID=config.getItem("Rift Remover", 5671).getInt();
|
|
||||||
itemStableFabricID=config.getItem("Stable Fabric", 5672).getInt();
|
|
||||||
itemExitDoorID=config.getItem("Warp Door Item", 5673).getInt();
|
|
||||||
itemDimDoorID=config.getItem("Dimensional Door Item", 5674).getInt();
|
|
||||||
itemLinkSignatureID=config.getItem("Rift Signature Item", 5675).getInt();
|
|
||||||
|
|
||||||
|
|
||||||
TNFREAKINGT = config.get("BOOLEAN", "EXPLOSIONS!!???!!!?!?!!", false).getBoolean(false);
|
|
||||||
this.enableRiftGrief = config.get("BOOLEAN", "toggles whether rifts eat blocks around them or not", true).getBoolean(true);
|
|
||||||
HOW_MUCH_TNT=config.get("Int", "Chance that a block will not be TNT. must be greater than 1. Explosions!?!?? must be set to true, and you figure out what it does. ", 25).getInt(25);
|
|
||||||
|
|
||||||
|
|
||||||
blockLimboID=config.get("Int", "Block ID for Limbo- must be below 256", 217).getInt();
|
|
||||||
blockDimWallPermID=config.get("Int", "Block ID for blockDimWallPermID- must be below 256", 220).getInt();
|
|
||||||
this.limboDimID=config.get("Int", "Limbo Dimension ID", -23).getInt();
|
|
||||||
this.limboExitRange=config.get("Int", "The farthest possible distance that limbo can send you upon return to the overworld.", 100000).getInt();
|
|
||||||
|
|
||||||
providerID=config.get("Int", "ProviderID", 12).getInt();
|
|
||||||
this.limboProviderID=config.get("Int", "Limbo Provider ID", 13).getInt();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.riftsInWorldGen = config.get("BOOLEAN", "Should rifts generate natrually in the world? ", true).getBoolean(true);
|
|
||||||
this.isLimboActive = config.get("BOOLEAN", "Toggles limbo", true).getBoolean(true);
|
|
||||||
|
|
||||||
this.riftSpreadFactor = config.get("Int", "How many times a rift can spread- 0 prevents rifts from spreading at all. I dont recommend putting it highter than 5, because its rather exponential. ", 3).getInt();
|
|
||||||
|
|
||||||
|
|
||||||
config.save();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Init
|
|
||||||
public void Init(FMLInitializationEvent event)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
transientDoor = (new TransientDoor(transientDoorID, Material.iron)).setHardness(1.0F).setRequiresSelfNotify().setBlockName("transientDoor");
|
|
||||||
|
|
||||||
linkDimDoor = (new linkDimDoor(linkDimDoorID, Material.iron)).setHardness(1.0F).setRequiresSelfNotify().setBlockName("dimDoor");
|
|
||||||
blockDimWall = (new BlockDimWall(blockDimWallID, 0, Material.iron)).setLightValue(1.0F).setHardness(0.1F).setBlockName("blockDimWall");
|
|
||||||
blockDimWallPerm = (new BlockDimWallPerm(blockDimWallPermID, 0, Material.iron)).setLightValue(1.0F).setBlockUnbreakable().setHardness(100000.0F).setBlockName("blockDimWallPerm");
|
|
||||||
ExitDoor = (new ExitDoor(ExitDoorID, Material.wood)).setHardness(1.0F).setRequiresSelfNotify().setBlockName("dimDoorexit");
|
|
||||||
linkExitDoor = (new linkExitDoor(linkExitDoorID, Material.wood)).setHardness(1.0F).setRequiresSelfNotify().setBlockName("dimDoorexitlink");
|
|
||||||
blockRift = (new BlockRift(blockRiftID, 0, Material.air).setHardness(1.0F).setRequiresSelfNotify().setBlockName("rift"));
|
|
||||||
blockLimbo = (new BlockLimbo(blockLimboID, 15, Material.iron).setHardness(.2F).setBlockName("limob").setLightValue(.0F));
|
|
||||||
chaosDoor = (new ChaosDoor(chaosDoorID, Material.iron).setHardness(.2F).setBlockName("chaosDoor").setLightValue(.0F).setRequiresSelfNotify());
|
|
||||||
dimDoor = (new dimDoor(dimDoorID, Material.iron)).setHardness(1.0F).setRequiresSelfNotify().setBlockName("dimDoor");
|
|
||||||
dimHatch = (new dimHatch(dimHatchID, 84, Material.iron)).setHardness(1.0F).setRequiresSelfNotify().setBlockName("dimHatch");
|
|
||||||
// dimRail = (new DimRail(dimRailID, 88, false)).setHardness(.5F).setRequiresSelfNotify().setBlockName("dimRail");
|
|
||||||
|
|
||||||
itemDimDoor = (new itemDimDoor(itemDimDoorID, Material.iron)).setItemName("itemDimDoor");
|
|
||||||
itemExitDoor = (new itemExitDoor(itemExitDoorID, Material.wood)).setItemName("itemDimDoorexit");
|
|
||||||
itemLinkSignature = (new itemLinkSignature(itemLinkSignatureID, Material.wood)).setItemName("itemLinkSignature");
|
|
||||||
itemRiftRemover = (new itemRiftRemover(itemRiftRemoverID, Material.wood)).setItemName("itemRiftRemover");
|
|
||||||
itemStableFabric = (new ItemStableFabric(itemStableFabricID, 0)).setItemName("itemStableFabric");
|
|
||||||
itemChaosDoor = (new ItemChaosDoor(itemChaosDoorID, Material.iron)).setItemName("itemChaosDoor");
|
|
||||||
itemRiftBlade = (new ItemRiftBlade(itemRiftBladeID, Material.iron)).setItemName("ItemRiftBlade");
|
|
||||||
|
|
||||||
|
|
||||||
proxy.loadTextures();
|
|
||||||
proxy.registerRenderers();
|
|
||||||
GameRegistry.registerWorldGenerator(this.riftGen);
|
|
||||||
|
|
||||||
//GameRegistry.registerBlock(dimRail, "Dimensional Rail");
|
|
||||||
GameRegistry.registerBlock(chaosDoor, "Unstable Door");
|
|
||||||
GameRegistry.registerBlock(ExitDoor, "Warp Door");
|
|
||||||
GameRegistry.registerBlock(linkExitDoor, "Warp Door link");
|
|
||||||
GameRegistry.registerBlock(blockRift, "Rift");
|
|
||||||
GameRegistry.registerBlock(blockLimbo, "Unraveled Fabric");
|
|
||||||
GameRegistry.registerBlock(linkDimDoor, "Dimensional Door link");
|
|
||||||
GameRegistry.registerBlock(dimDoor, "Dimensional Door");
|
|
||||||
GameRegistry.registerBlock(dimHatch,"Transdimensional Trapdoor");
|
|
||||||
GameRegistry.registerBlock(blockDimWall, "Fabric of Reality");
|
|
||||||
GameRegistry.registerBlock(blockDimWallPerm, "Fabric of RealityPerm");
|
|
||||||
GameRegistry.registerBlock(transientDoor, "transientDoor");
|
|
||||||
|
|
||||||
GameRegistry.registerPlayerTracker(tracker);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DimensionManager.registerProviderType(this.providerID, pocketProvider.class, false);
|
|
||||||
DimensionManager.registerProviderType(this.limboProviderID, LimboProvider.class, false);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DimensionManager.registerDimension(this.limboDimID , this.limboProviderID);
|
|
||||||
|
|
||||||
LanguageRegistry.addName(transientDoor , "transientDoor");
|
|
||||||
|
|
||||||
LanguageRegistry.addName(blockRift , "Rift");
|
|
||||||
LanguageRegistry.addName(blockLimbo , "Unraveled Fabric");
|
|
||||||
LanguageRegistry.addName(ExitDoor , "Warp Door");
|
|
||||||
LanguageRegistry.addName(chaosDoor , "Unstable Door");
|
|
||||||
LanguageRegistry.addName(linkDimDoor, "Dimensional Door");
|
|
||||||
LanguageRegistry.addName(blockDimWall , "Fabric of Reality");
|
|
||||||
LanguageRegistry.addName(blockDimWallPerm , "Fabric of Reality");
|
|
||||||
LanguageRegistry.addName(dimDoor, "Dimensional Door");
|
|
||||||
LanguageRegistry.addName(dimHatch, "Transdimensional Trapdoor");
|
|
||||||
|
|
||||||
LanguageRegistry.addName(itemExitDoor , "Warp Door");
|
|
||||||
LanguageRegistry.addName(itemLinkSignature , "Rift Signature");
|
|
||||||
LanguageRegistry.addName(itemRiftRemover , "Rift Remover");
|
|
||||||
LanguageRegistry.addName(itemStableFabric , "Stable Fabric");
|
|
||||||
LanguageRegistry.addName(itemChaosDoor , "Unstable Door");
|
|
||||||
LanguageRegistry.addName(itemDimDoor, "Dimensional Door");
|
|
||||||
LanguageRegistry.addName(itemRiftBlade , "Rift Blade");
|
|
||||||
|
|
||||||
|
|
||||||
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
|
|
||||||
TickRegistry.registerTickHandler(new CommonTickHandler(), Side.SERVER);
|
|
||||||
|
|
||||||
// GameRegistry.registerTileEntity(TileEntityDimDoor.class, "TileEntityDimRail");
|
|
||||||
|
|
||||||
GameRegistry.registerTileEntity(TileEntityDimDoor.class, "TileEntityDimDoor");
|
|
||||||
GameRegistry.registerTileEntity(TileEntityRift.class, "TileEntityRift");
|
|
||||||
|
|
||||||
if(this.enableIronDimDoor)
|
|
||||||
{
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemDimDoor, 1), new Object[]
|
|
||||||
{
|
|
||||||
" ", "yxy", " ", 'x', Item.enderPearl, 'y', Item.doorSteel
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemDimDoor, 1), new Object[]
|
|
||||||
{
|
|
||||||
" ", "yxy", " ", 'x', this.itemStableFabric, 'y', Item.doorSteel
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
if(this.enableDimRail)
|
|
||||||
{
|
|
||||||
GameRegistry.addRecipe(new ItemStack(dimRail, 1), new Object[]
|
|
||||||
{
|
|
||||||
" ", "yxy", " ", 'x', this.itemDimDoor, 'y', Block.rail
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(dimRail, 1), new Object[]
|
|
||||||
{
|
|
||||||
" ", "yxy", " ", 'x', this.itemExitDoor, 'y', Block.rail
|
|
||||||
});
|
|
||||||
}
|
|
||||||
**/
|
|
||||||
|
|
||||||
if(this.enableUnstableDoor)
|
|
||||||
{
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemChaosDoor, 1), new Object[]
|
|
||||||
{
|
|
||||||
" ", "yxy", " ", 'x', Item.eyeOfEnder, 'y', this.itemDimDoor
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if(this.enableWoodenDimDoor)
|
|
||||||
{
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemExitDoor, 1), new Object[]
|
|
||||||
{
|
|
||||||
" ", "yxy", " ", 'x', Item.enderPearl, 'y', Item.doorWood
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemExitDoor, 1), new Object[]
|
|
||||||
{
|
|
||||||
" ", "yxy", " ", 'x', this.itemStableFabric, 'y', Item.doorWood
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if(this.enableDimTrapDoor)
|
|
||||||
{
|
|
||||||
GameRegistry.addRecipe(new ItemStack(dimHatch, 1), new Object[]
|
|
||||||
{
|
|
||||||
" y ", " x ", " y ", 'x', Item.enderPearl, 'y', Block.trapdoor
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(dimHatch, 1), new Object[]
|
|
||||||
{
|
|
||||||
" y ", " x ", " y ", 'x', this.itemStableFabric, 'y', Block.trapdoor
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if(this.enableRiftSignature)
|
|
||||||
{
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemLinkSignature, 1), new Object[]
|
|
||||||
{
|
|
||||||
" y ", "yxy", " y ", 'x', Item.enderPearl, 'y', Item.ingotIron
|
|
||||||
});
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemLinkSignature, 1), new Object[]
|
|
||||||
{
|
|
||||||
" y ", "yxy", " y ", 'x', this.itemStableFabric, 'y', Item.ingotIron
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if(this.enableRiftRemover)
|
|
||||||
{
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemRiftRemover, 1), new Object[]
|
|
||||||
{
|
|
||||||
" y ", "yxy", " y ", 'x', Item.enderPearl, 'y', Item.ingotGold
|
|
||||||
});
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemRiftRemover, 1), new Object[]
|
|
||||||
{
|
|
||||||
" y ", "yxy", " y ", 'x', this.itemStableFabric, 'y', Item.ingotGold
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(this.enableRiftBlade)
|
|
||||||
{
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemRiftBlade, 1), new Object[]
|
|
||||||
{
|
|
||||||
" x ", " x ", " y ", 'x', Item.enderPearl, 'y',this.itemRiftRemover
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemStableFabric, 4), new Object[]
|
|
||||||
{
|
|
||||||
" y ", "yxy", " y ", 'x', Item.eyeOfEnder, 'y', this.blockLimbo
|
|
||||||
});
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
this.blocksImmuneToRift.add(this.blockDimWallID);
|
|
||||||
this.blocksImmuneToRift.add(this.blockDimWallPermID);
|
|
||||||
this.blocksImmuneToRift.add(this.dimDoorID);
|
|
||||||
this.blocksImmuneToRift.add(this.ExitDoorID);
|
|
||||||
this.blocksImmuneToRift.add(this.linkDimDoorID);
|
|
||||||
this.blocksImmuneToRift.add(this.linkExitDoorID);
|
|
||||||
this.blocksImmuneToRift.add(this.dimHatchID);
|
|
||||||
this.blocksImmuneToRift.add(this.chaosDoorID);
|
|
||||||
this.blocksImmuneToRift.add(this.blockRiftID);
|
|
||||||
this.blocksImmuneToRift.add(this.transientDoorID);
|
|
||||||
this.blocksImmuneToRift.add(Block.blockSteel.blockID);
|
|
||||||
this.blocksImmuneToRift.add(Block.blockDiamond.blockID);
|
|
||||||
this.blocksImmuneToRift.add(Block.blockEmerald.blockID);
|
|
||||||
this.blocksImmuneToRift.add(Block.blockGold.blockID);
|
|
||||||
this.blocksImmuneToRift.add(Block.blockLapis.blockID);
|
|
||||||
this.blocksImmuneToRift.add(Block.bedrock.blockID);
|
|
||||||
|
|
||||||
|
|
||||||
this.hubs.add(new DungeonGenerator(0, "4WayBasicHall.schematic", null));
|
|
||||||
this.hubs.add(new DungeonGenerator(0, "4WayBasicHall.schematic", null));
|
|
||||||
this.hubs.add(new DungeonGenerator(0, "doorTotemRuins.schematic", null));
|
|
||||||
this.hubs.add(new DungeonGenerator(0, "hallwayTrapRooms1.schematic", null));
|
|
||||||
this.hubs.add(new DungeonGenerator(0, "longDoorHallway.schematic", null));
|
|
||||||
this.hubs.add(new DungeonGenerator(0, "smallRotundaWithExit.schematic", null));
|
|
||||||
this.hubs.add(new DungeonGenerator(0, "fortRuins.schematic", null));
|
|
||||||
this.hubs.add(new DungeonGenerator(0, "4WayHallExit.schematic", null));
|
|
||||||
this.hubs.add(new DungeonGenerator(0, "4WayHallExit.schematic", null));
|
|
||||||
|
|
||||||
|
|
||||||
this.simpleHalls.add(new DungeonGenerator(0, "collapsedSingleTunnel1.schematic", null));
|
|
||||||
this.simpleHalls.add(new DungeonGenerator(0, "singleStraightHall1.schematic", null));
|
|
||||||
this.simpleHalls.add(new DungeonGenerator(0, "smallBranchWithExit.schematic", null));
|
|
||||||
this.simpleHalls.add(new DungeonGenerator(0, "smallSimpleLeft.schematic", null));
|
|
||||||
this.simpleHalls.add(new DungeonGenerator(0, "smallSimpleRight.schematic", null));
|
|
||||||
this.simpleHalls.add(new DungeonGenerator(0, "simpleStairsUp.schematic", null));
|
|
||||||
this.simpleHalls.add(new DungeonGenerator(0, "simpleStairsDown.schematic", null));
|
|
||||||
this.simpleHalls.add(new DungeonGenerator(0, "simpleSmallT1.schematic", null));
|
|
||||||
|
|
||||||
|
|
||||||
this.complexHalls.add(new DungeonGenerator(0, "brokenPillarsO.schematic", null));
|
|
||||||
this.complexHalls.add(new DungeonGenerator(0, "buggyTopEntry1.schematic", null));
|
|
||||||
this.complexHalls.add(new DungeonGenerator(0, "exitRuinsWithHiddenDoor.schematic", null));
|
|
||||||
this.complexHalls.add(new DungeonGenerator(0, "hallwayHiddenTreasure.schematic", null));
|
|
||||||
this.complexHalls.add(new DungeonGenerator(0, "mediumPillarStairs.schematic", null));
|
|
||||||
this.complexHalls.add(new DungeonGenerator(0, "ruinsO.schematic", null));
|
|
||||||
this.complexHalls.add(new DungeonGenerator(0, "pitStairs.schematic", null));
|
|
||||||
|
|
||||||
|
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "azersDungeonO.schematic", null));
|
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "diamondTowerTemple1.schematic", null));
|
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "fallingTrapO.schematic", null));
|
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "hiddenStaircaseO.schematic", null));
|
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "lavaTrapO.schematic", null));
|
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "randomTree.schematic", null));
|
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "smallHiddenTowerO.schematic", null));
|
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "smallSilverfishRoom.schematic", null));
|
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "tntTrapO.schematic", null));
|
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "smallDesert.schematic", null));
|
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "smallPond.schematic", null));
|
|
||||||
|
|
||||||
|
|
||||||
this.pistonTraps.add(new DungeonGenerator(0, "fakeTNTTrap.schematic", null));
|
|
||||||
this.pistonTraps.add(new DungeonGenerator(0, "hallwayPitFallTrap.schematic", null));
|
|
||||||
this.pistonTraps.add(new DungeonGenerator(0, "hallwayPitFallTrap.schematic", null));
|
|
||||||
this.pistonTraps.add(new DungeonGenerator(0, "pistonFallRuins.schematic", null));
|
|
||||||
this.pistonTraps.add(new DungeonGenerator(0, "pistonFloorHall.schematic", null));
|
|
||||||
this.pistonTraps.add(new DungeonGenerator(0, "pistonFloorHall.schematic", null));
|
|
||||||
// this.pistonTraps.add(new DungeonGenerator(0, "pistonHallway.schematic", null));
|
|
||||||
this.pistonTraps.add(new DungeonGenerator(0, "pistonSmasherHall.schematic", null));
|
|
||||||
this.pistonTraps.add(new DungeonGenerator(0, "raceTheTNTHall.schematic", null));
|
|
||||||
this.pistonTraps.add(new DungeonGenerator(0, "simpleDropHall.schematic", null));
|
|
||||||
this.pistonTraps.add(new DungeonGenerator(0, "wallFallcomboPistonHall.schematic", null));
|
|
||||||
this.pistonTraps.add(new DungeonGenerator(0, "wallFallcomboPistonHall.schematic", null));
|
|
||||||
|
|
||||||
|
|
||||||
this.mazes.add(new DungeonGenerator(0, "smallMaze1.schematic", null));
|
|
||||||
this.mazes.add(new DungeonGenerator(0, "smallMultilevelMaze.schematic", null));
|
|
||||||
|
|
||||||
|
|
||||||
this.exits.add(new DungeonGenerator(0, "exitCube.schematic", null));
|
|
||||||
this.exits.add(new DungeonGenerator(0, "lockingExitHall.schematic", null));
|
|
||||||
this.exits.add(new DungeonGenerator(0, "smallExitPrison.schematic", null));
|
|
||||||
this.exits.add(new DungeonGenerator(0, "lockingExitHall.schematic", null));
|
|
||||||
|
|
||||||
this.registeredDungeons.addAll(this.simpleHalls);
|
|
||||||
this.registeredDungeons.addAll(this.exits);
|
|
||||||
this.registeredDungeons.addAll(this.pistonTraps);
|
|
||||||
this.registeredDungeons.addAll(this.mazes);
|
|
||||||
this.registeredDungeons.addAll(this.deadEnds);
|
|
||||||
this.registeredDungeons.addAll(this.complexHalls);
|
|
||||||
this.registeredDungeons.addAll(this.hubs);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.metadataFlipList.add(Block.dispenser.blockID);
|
|
||||||
this.metadataFlipList.add(Block.stairsStoneBrickSmooth.blockID);
|
|
||||||
this.metadataFlipList.add(Block.lever.blockID);
|
|
||||||
this.metadataFlipList.add(Block.stoneButton.blockID);
|
|
||||||
this.metadataFlipList.add(Block.redstoneRepeaterIdle.blockID);
|
|
||||||
this.metadataFlipList.add(Block.redstoneRepeaterActive.blockID);
|
|
||||||
this.metadataFlipList.add(Block.tripWireSource.blockID);
|
|
||||||
this.metadataFlipList.add(Block.torchWood.blockID);
|
|
||||||
this.metadataFlipList.add(Block.torchRedstoneIdle.blockID);
|
|
||||||
this.metadataFlipList.add(Block.torchRedstoneActive.blockID);
|
|
||||||
this.metadataFlipList.add(Block.doorSteel.blockID);
|
|
||||||
this.metadataFlipList.add(Block.doorWood.blockID);
|
|
||||||
this.metadataFlipList.add(Block.pistonBase.blockID);
|
|
||||||
this.metadataFlipList.add(Block.pistonStickyBase.blockID);
|
|
||||||
|
|
||||||
this.metadataNextList.add(Block.redstoneRepeaterIdle.blockID);
|
|
||||||
this.metadataNextList.add(Block.redstoneRepeaterActive.blockID);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostInit
|
|
||||||
public void PostInit(FMLPostInitializationEvent event)
|
|
||||||
{
|
|
||||||
//dimHelper.instance.dimList.put(this.limboDimID, new DimData( this.limboDimID, false, 0, new LinkData()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@ServerStopping
|
|
||||||
public void serverStopping(FMLServerStoppingEvent event)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
dimHelper.instance.save();
|
|
||||||
dimHelper.instance.unregsisterDims();
|
|
||||||
dimHelper.dimList.clear();
|
|
||||||
dimHelper.blocksToDecay.clear();
|
|
||||||
dimHelper.instance.interDimLinkList.clear();
|
|
||||||
this.hasInitDims=false;
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ServerStarting
|
|
||||||
public void serverStarting(FMLServerStartingEvent event)
|
|
||||||
{
|
|
||||||
event.registerServerCommand(removeRiftsCommand);
|
|
||||||
event.registerServerCommand(pruneDimsCommand);
|
|
||||||
event.registerServerCommand(removeAllLinksCommand);
|
|
||||||
event.registerServerCommand(deleteDimDataCommand);
|
|
||||||
|
|
||||||
dimHelper.instance.load();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EnumCreatureType;
|
|
||||||
import net.minecraft.world.ChunkPosition;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.Chunk;
|
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
|
||||||
import net.minecraft.world.gen.ChunkProviderGenerate;
|
|
||||||
|
|
||||||
public class pocketGenerator extends ChunkProviderGenerate implements IChunkProvider
|
|
||||||
{
|
|
||||||
private World world;
|
|
||||||
|
|
||||||
public pocketGenerator(World par1World, long par2, boolean par4)
|
|
||||||
{
|
|
||||||
|
|
||||||
super(par1World, par2, par4);
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
this.world=par1World;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Chunk provideChunk(int par1, int par2)
|
|
||||||
{
|
|
||||||
|
|
||||||
byte[] var3 = new byte[32768];
|
|
||||||
|
|
||||||
Chunk var4 = new Chunk(this.world, var3, par1, par2);
|
|
||||||
|
|
||||||
return var4;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Chunk loadChunk(int var1, int var2) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.loadChunk(var1, var2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void populate(IChunkProvider var1, int var2, int var3) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3,
|
|
||||||
int var4)
|
|
||||||
{
|
|
||||||
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ChunkPosition findClosestStructure(World var1, String var2,
|
|
||||||
int var3, int var4, int var5) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.util.Vec3;
|
|
||||||
import net.minecraft.world.WorldProvider;
|
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class pocketProvider extends WorldProvider
|
|
||||||
|
|
||||||
{
|
|
||||||
public int exitXCoord;
|
|
||||||
public int exitYCoord;
|
|
||||||
public int exitZCoord;
|
|
||||||
public int exitDimID;
|
|
||||||
public boolean hasNoSky = true;
|
|
||||||
public pocketProvider()
|
|
||||||
{
|
|
||||||
this.hasNoSky=true;
|
|
||||||
|
|
||||||
}
|
|
||||||
// @SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public String getSaveFolder()
|
|
||||||
{
|
|
||||||
return (dimensionId == 0 ? null : "DimensionalDoors/pocketDimID" + dimensionId);
|
|
||||||
}
|
|
||||||
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
|
|
||||||
{
|
|
||||||
setCloudRenderer( new CloudRenderBlank());
|
|
||||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful)
|
|
||||||
{
|
|
||||||
super.setAllowedSpawnTypes(false, false);
|
|
||||||
}
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public Vec3 getFogColor(float par1, float par2)
|
|
||||||
{
|
|
||||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
|
||||||
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public double getHorizon()
|
|
||||||
{
|
|
||||||
return worldObj.getHeight();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public IChunkProvider createChunkGenerator()
|
|
||||||
{
|
|
||||||
return new pocketGenerator(worldObj, dimensionId, false);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public boolean canSnowAt(int x, int y, int z)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public boolean canBlockFreeze(int x, int y, int z, boolean byWater)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDimensionName()
|
|
||||||
{
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return "PocketDim "+this.dimensionId;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public int getRespawnDimension(EntityPlayerMP player)
|
|
||||||
{
|
|
||||||
if(mod_pocketDim.isLimboActive)
|
|
||||||
{
|
|
||||||
return mod_pocketDim.limboDimID;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return dimHelper.dimList.get(this.dimensionId).exitDimLink.destDimID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canRespawnHere()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,218 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.item.EntityMinecart;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.world.Teleporter;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.WorldServer;
|
|
||||||
|
|
||||||
public class pocketTeleporter extends Teleporter
|
|
||||||
{
|
|
||||||
int x,y,z;
|
|
||||||
World world;
|
|
||||||
LinkData sendingLink;
|
|
||||||
|
|
||||||
|
|
||||||
public pocketTeleporter(WorldServer par1WorldServer, LinkData link)
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
super(par1WorldServer);
|
|
||||||
this.x=link.destXCoord;
|
|
||||||
this.y=link.destYCoord;
|
|
||||||
this.z=link.destZCoord;
|
|
||||||
this.sendingLink=link;
|
|
||||||
world = par1WorldServer;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new portal near an entity.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
|
|
||||||
{
|
|
||||||
if(par1Entity instanceof EntityPlayer)
|
|
||||||
{
|
|
||||||
EntityPlayer player = (EntityPlayer) par1Entity;
|
|
||||||
|
|
||||||
|
|
||||||
int id;
|
|
||||||
|
|
||||||
|
|
||||||
id=dimHelper.instance.getDestOrientation(sendingLink);
|
|
||||||
//System.out.println("Teleporting with link oreintation "+id);
|
|
||||||
|
|
||||||
|
|
||||||
player.rotationYaw=(id*90)+90;
|
|
||||||
if(id==2||id==6)
|
|
||||||
{
|
|
||||||
player.setPositionAndUpdate( x+1.5, y-1, z+.5 );
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==3||id==7)
|
|
||||||
{
|
|
||||||
|
|
||||||
player.setPositionAndUpdate( x+.5, y-1, z+1.5 );
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==0||id==4)
|
|
||||||
{
|
|
||||||
|
|
||||||
player.setPositionAndUpdate(x-.5, y-1, z+.5);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==1||id==5)
|
|
||||||
{
|
|
||||||
player.setPositionAndUpdate(x+.5, y-1, z-.5);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.setPositionAndUpdate(x, y-1, z);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(par1Entity instanceof EntityMinecart)
|
|
||||||
{
|
|
||||||
par1Entity.motionX=0;
|
|
||||||
par1Entity.motionZ=0;
|
|
||||||
par1Entity.motionY=0;
|
|
||||||
int id;
|
|
||||||
|
|
||||||
id=dimHelper.instance.getDestOrientation(sendingLink);
|
|
||||||
|
|
||||||
|
|
||||||
par1Entity.rotationYaw=(id*90)+90;
|
|
||||||
|
|
||||||
if(id==2||id==6)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity, x+1.5, y, z+.5 );
|
|
||||||
par1Entity.motionX =.39;
|
|
||||||
par1Entity.worldObj.updateEntityWithOptionalForce(par1Entity, false);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==3||id==7)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity, x+.5, y, z+1.5 );
|
|
||||||
par1Entity.motionZ =.39;
|
|
||||||
par1Entity.worldObj.updateEntityWithOptionalForce(par1Entity, false);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==0||id==4)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity,x-.5, y, z+.5);
|
|
||||||
par1Entity.motionX =-.39;
|
|
||||||
par1Entity.worldObj.updateEntityWithOptionalForce(par1Entity, false);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==1||id==5)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity,x+.5, y, z-.5);
|
|
||||||
par1Entity.motionZ =-.39;
|
|
||||||
par1Entity.worldObj.updateEntityWithOptionalForce(par1Entity, false);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.setEntityPosition(par1Entity,x, y, z);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
else if(par1Entity instanceof Entity)
|
|
||||||
{
|
|
||||||
int id;
|
|
||||||
|
|
||||||
|
|
||||||
id=dimHelper.instance.getDestOrientation(sendingLink);
|
|
||||||
//System.out.println("Teleporting with link oreintation "+id);
|
|
||||||
|
|
||||||
|
|
||||||
par1Entity.rotationYaw=(id*90)+90;
|
|
||||||
|
|
||||||
// EntityMinecart.class.cast(par1Entity).isinreverse=false;
|
|
||||||
if(id==2||id==6)
|
|
||||||
{
|
|
||||||
this.setEntityPosition(par1Entity, x+1.5, y, z+.5 );
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==3||id==7)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity, x+.5, y, z+1.5 );
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==0||id==4)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity,x-.5, y, z+.5);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==1||id==5)
|
|
||||||
{
|
|
||||||
this.setEntityPosition(par1Entity,x+.5, y, z-.5);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.setEntityPosition(par1Entity,x, y, z);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEntityPosition(Entity entity, double x, double y, double z)
|
|
||||||
{
|
|
||||||
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
|
||||||
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
|
|
||||||
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
|
||||||
entity.setPosition(x, y, z);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean func_85188_a(Entity par1Entity)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void func_85189_a(long par1)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
// This is my package declaration, do not mess with the standard (package net.minecraft.src;) like I did,
|
|
||||||
// Because I know what Im doing in this part, If you don't know what your doing keep it the normal (package net.minecraft.src;)
|
|
||||||
package StevenDimDoors.mod_pocketDimClient;
|
|
||||||
|
|
||||||
// Theses are all the imports you need
|
|
||||||
import net.minecraft.network.INetworkManager;
|
|
||||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
|
||||||
import cpw.mods.fml.common.network.IPacketHandler;
|
|
||||||
import cpw.mods.fml.common.network.Player;
|
|
||||||
|
|
||||||
// Create a class and implement IPacketHandler
|
|
||||||
// This just handles the data packets in the server
|
|
||||||
public class ClientPacketHandler implements IPacketHandler{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPacketData(INetworkManager manager,
|
|
||||||
Packet250CustomPayload packet, Player player) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDimClient;
|
|
||||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
|
||||||
import net.minecraft.src.ModLoader;
|
|
||||||
import net.minecraftforge.client.MinecraftForgeClient;
|
|
||||||
import StevenDimDoors.mod_pocketDim.CommonProxy;
|
|
||||||
import StevenDimDoors.mod_pocketDim.TileEntityDimDoor;
|
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
||||||
|
|
||||||
|
|
||||||
public class ClientProxy extends CommonProxy
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void registerRenderers()
|
|
||||||
{
|
|
||||||
|
|
||||||
MinecraftForgeClient.preloadTexture(BLOCK_PNG);
|
|
||||||
MinecraftForgeClient.preloadTexture(WARP_PNG);
|
|
||||||
MinecraftForgeClient.preloadTexture(RIFT_PNG);
|
|
||||||
|
|
||||||
MinecraftForgeClient.preloadTexture(RIFT2_PNG);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void loadTextures()
|
|
||||||
{
|
|
||||||
|
|
||||||
mod_pocketDim.itemStableFabric.setIconIndex(9).setItemName("451");
|
|
||||||
mod_pocketDim.itemRiftBlade.setIconIndex(10).setItemName("445");
|
|
||||||
|
|
||||||
mod_pocketDim.itemDimDoor.setIconIndex(8).setItemName("45");
|
|
||||||
mod_pocketDim.itemExitDoor.setIconIndex(7).setItemName("233");
|
|
||||||
mod_pocketDim.itemLinkSignature.setIconIndex(5).setItemName("5");
|
|
||||||
mod_pocketDim.itemRiftRemover.setIconIndex(6).setItemName("6");
|
|
||||||
mod_pocketDim.blockRift.blockIndexInTexture=0;
|
|
||||||
mod_pocketDim.blockDimWall.blockIndexInTexture=0;
|
|
||||||
mod_pocketDim.blockLimbo.blockIndexInTexture=15;
|
|
||||||
mod_pocketDim.itemChaosDoor.setIconIndex(21).setItemName("9");
|
|
||||||
|
|
||||||
mod_pocketDim.blockDimWallPerm.blockIndexInTexture=0;
|
|
||||||
mod_pocketDim.blockRift.blockIndexInTexture=200;
|
|
||||||
mod_pocketDim.dimDoor.blockIndexInTexture=18;
|
|
||||||
// mod_pocketDim.dimRail.blockIndexInTexture=13;
|
|
||||||
mod_pocketDim.ExitDoor.blockIndexInTexture=19;
|
|
||||||
mod_pocketDim.chaosDoor.blockIndexInTexture=30;
|
|
||||||
mod_pocketDim.transientDoor.blockIndexInTexture=200;
|
|
||||||
|
|
||||||
mod_pocketDim.linkDimDoor.blockIndexInTexture=17;
|
|
||||||
mod_pocketDim.linkExitDoor.blockIndexInTexture=20;
|
|
||||||
|
|
||||||
|
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDimDoor.class, new RenderDimDoor());
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void printStringClient(String string)
|
|
||||||
{
|
|
||||||
|
|
||||||
ModLoader.getMinecraftInstance().ingameGUI.getChatGUI().printChatMessage(string);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDimClient;
|
|
||||||
import java.util.EnumSet;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
import cpw.mods.fml.common.ITickHandler;
|
|
||||||
import cpw.mods.fml.common.TickType;
|
|
||||||
|
|
||||||
public class ClientTickHandler implements ITickHandler
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void tickStart(EnumSet<TickType> type, Object... tickData) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tickEnd(EnumSet<TickType> type, Object... tickData)
|
|
||||||
{
|
|
||||||
if (type.equals(EnumSet.of(TickType.RENDER)))
|
|
||||||
{
|
|
||||||
onRenderTick();
|
|
||||||
}
|
|
||||||
else if (type.equals(EnumSet.of(TickType.CLIENT)))
|
|
||||||
{
|
|
||||||
GuiScreen guiscreen = Minecraft.getMinecraft().currentScreen;
|
|
||||||
if (guiscreen != null)
|
|
||||||
{
|
|
||||||
onTickInGUI(guiscreen);
|
|
||||||
} else {
|
|
||||||
onTickInGame();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumSet<TickType> ticks()
|
|
||||||
{
|
|
||||||
return EnumSet.of(TickType.RENDER, TickType.CLIENT);
|
|
||||||
// In my testing only RENDER, CLIENT, & PLAYER did anything on the client side.
|
|
||||||
// Read 'cpw.mods.fml.common.TickType.java' for a full list and description of available types
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getLabel() { return null; }
|
|
||||||
|
|
||||||
|
|
||||||
public void onRenderTick()
|
|
||||||
{
|
|
||||||
//System.out.println("onRenderTick");
|
|
||||||
//TODO: Your Code Here
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onTickInGUI(GuiScreen guiscreen)
|
|
||||||
{
|
|
||||||
//System.out.println("onTickInGUI");
|
|
||||||
//TODO: Your Code Here
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onTickInGame()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
//System.out.println("onTickInGame");
|
|
||||||
//TODO: Your Code Here
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,192 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDimClient;
|
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
|
||||||
import net.minecraft.client.particle.EffectRenderer;
|
|
||||||
import net.minecraft.client.particle.EntityFX;
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public class ClosingRiftFX extends EntityFX
|
|
||||||
{
|
|
||||||
private int field_92049_a = 160;
|
|
||||||
private boolean field_92054_ax;
|
|
||||||
private boolean field_92048_ay;
|
|
||||||
private final EffectRenderer field_92047_az;
|
|
||||||
private float field_92050_aA;
|
|
||||||
private float field_92051_aB;
|
|
||||||
private float field_92052_aC;
|
|
||||||
private boolean field_92053_aD;
|
|
||||||
|
|
||||||
public ClosingRiftFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, EffectRenderer par14EffectRenderer)
|
|
||||||
{
|
|
||||||
|
|
||||||
super(par1World, par2, par4, par6);
|
|
||||||
this.motionX = par8;
|
|
||||||
this.motionY = par10;
|
|
||||||
this.motionZ = par12;
|
|
||||||
this.field_92047_az = par14EffectRenderer;
|
|
||||||
this.particleScale *= .55F;
|
|
||||||
this.particleMaxAge = 30 + this.rand.nextInt(16);
|
|
||||||
this.noClip = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void func_92045_e(boolean par1)
|
|
||||||
{
|
|
||||||
this.field_92054_ax = par1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void func_92043_f(boolean par1)
|
|
||||||
{
|
|
||||||
this.field_92048_ay = par1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void func_92044_a(int par1)
|
|
||||||
{
|
|
||||||
float var2 = (float)((par1 & 16711680) >> 16) / 255.0F;
|
|
||||||
float var3 = (float)((par1 & 65280) >> 8) / 255.0F;
|
|
||||||
float var4 = (float)((par1 & 255) >> 0) / 255.0F;
|
|
||||||
float var5 = 1.0F;
|
|
||||||
this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void func_92046_g(int par1)
|
|
||||||
{
|
|
||||||
this.field_92050_aA = (float)((par1 & 16711680) >> 16) / 255.0F;
|
|
||||||
this.field_92051_aB = (float)((par1 & 65280) >> 8) / 255.0F;
|
|
||||||
this.field_92052_aC = (float)((par1 & 255) >> 0) / 255.0F;
|
|
||||||
this.field_92053_aD = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* returns the bounding box for this entity
|
|
||||||
*/
|
|
||||||
public AxisAlignedBB getBoundingBox()
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if this entity should push and be pushed by other entities when colliding.
|
|
||||||
*/
|
|
||||||
public boolean canBePushed()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
|
||||||
{
|
|
||||||
if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
|
|
||||||
{
|
|
||||||
this.doRenderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void doRenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
|
||||||
{
|
|
||||||
float var8 = (float)(super.getParticleTextureIndex() % 16) / 16.0F;
|
|
||||||
float var9 = var8 + 0.0624375F;
|
|
||||||
float var10 = (float)(this.getParticleTextureIndex() / 16) / 16.0F;
|
|
||||||
float var11 = var10 + 0.0624375F;
|
|
||||||
float var12 = 0.1F * this.particleScale;
|
|
||||||
float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
|
|
||||||
float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
|
|
||||||
float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
|
|
||||||
float var16 = .8F;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if(dimHelper.dimList.get(this.worldObj.provider.dimensionId).isPocket)
|
|
||||||
{
|
|
||||||
var16=.4F;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(Exception E)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, (float) .7);
|
|
||||||
|
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11);
|
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10);
|
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10);
|
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called to update the entity's position/logic.
|
|
||||||
*/
|
|
||||||
public void onUpdate()
|
|
||||||
{
|
|
||||||
this.prevPosX = this.posX;
|
|
||||||
this.prevPosY = this.posY;
|
|
||||||
this.prevPosZ = this.posZ;
|
|
||||||
|
|
||||||
if (this.particleAge++ >= this.particleMaxAge)
|
|
||||||
{
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.particleAge > this.particleMaxAge / 2)
|
|
||||||
{
|
|
||||||
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge);
|
|
||||||
|
|
||||||
if (this.field_92053_aD)
|
|
||||||
{
|
|
||||||
this.particleRed += (this.field_92050_aA - this.particleRed) * 0.2F;
|
|
||||||
this.particleGreen += (this.field_92051_aB - this.particleGreen) * 0.2F;
|
|
||||||
this.particleBlue += (this.field_92052_aC - this.particleBlue) * 0.2F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setParticleTextureIndex(this.field_92049_a + (7 - this.particleAge * 8 / this.particleMaxAge));
|
|
||||||
// this.motionY -= 0.004D;
|
|
||||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
|
||||||
this.motionX *= 0.9100000262260437D;
|
|
||||||
this.motionY *= 0.9100000262260437D;
|
|
||||||
this.motionZ *= 0.9100000262260437D;
|
|
||||||
|
|
||||||
if (this.onGround)
|
|
||||||
{
|
|
||||||
this.motionX *= 0.699999988079071D;
|
|
||||||
this.motionZ *= 0.699999988079071D;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.field_92054_ax && this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0)
|
|
||||||
{
|
|
||||||
ClosingRiftFX var1 = new ClosingRiftFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, this.field_92047_az);
|
|
||||||
var1.setRBGColorF(this.particleRed, this.particleGreen, this.particleBlue);
|
|
||||||
var1.particleAge = var1.particleMaxAge / 2;
|
|
||||||
|
|
||||||
if (this.field_92053_aD)
|
|
||||||
{
|
|
||||||
var1.field_92053_aD = true;
|
|
||||||
var1.field_92050_aA = this.field_92050_aA;
|
|
||||||
var1.field_92051_aB = this.field_92051_aB;
|
|
||||||
var1.field_92052_aC = this.field_92052_aC;
|
|
||||||
}
|
|
||||||
|
|
||||||
var1.field_92048_ay = this.field_92048_ay;
|
|
||||||
this.field_92047_az.addEffect(var1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getBrightnessForRender(float par1)
|
|
||||||
{
|
|
||||||
return 15728880;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets how bright this entity is.
|
|
||||||
*/
|
|
||||||
public float getBrightness(float par1)
|
|
||||||
{
|
|
||||||
return 1.0F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,192 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDimClient;
|
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
|
||||||
import net.minecraft.client.particle.EffectRenderer;
|
|
||||||
import net.minecraft.client.particle.EntityFX;
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public class GoggleRiftFX extends EntityFX
|
|
||||||
{
|
|
||||||
private int field_92049_a = 160;
|
|
||||||
private boolean field_92054_ax;
|
|
||||||
private boolean field_92048_ay;
|
|
||||||
private final EffectRenderer field_92047_az;
|
|
||||||
private float field_92050_aA;
|
|
||||||
private float field_92051_aB;
|
|
||||||
private float field_92052_aC;
|
|
||||||
private boolean field_92053_aD;
|
|
||||||
|
|
||||||
public GoggleRiftFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, EffectRenderer par14EffectRenderer)
|
|
||||||
{
|
|
||||||
|
|
||||||
super(par1World, par2, par4, par6);
|
|
||||||
this.motionX = par8;
|
|
||||||
this.motionY = par10;
|
|
||||||
this.motionZ = par12;
|
|
||||||
this.field_92047_az = par14EffectRenderer;
|
|
||||||
this.particleScale *= .55F;
|
|
||||||
this.particleMaxAge = 30 + this.rand.nextInt(16);
|
|
||||||
this.noClip = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void func_92045_e(boolean par1)
|
|
||||||
{
|
|
||||||
this.field_92054_ax = par1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void func_92043_f(boolean par1)
|
|
||||||
{
|
|
||||||
this.field_92048_ay = par1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void func_92044_a(int par1)
|
|
||||||
{
|
|
||||||
float var2 = (float)((par1 & 16711680) >> 16) / 255.0F;
|
|
||||||
float var3 = (float)((par1 & 65280) >> 8) / 255.0F;
|
|
||||||
float var4 = (float)((par1 & 255) >> 0) / 255.0F;
|
|
||||||
float var5 = 1.0F;
|
|
||||||
this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void func_92046_g(int par1)
|
|
||||||
{
|
|
||||||
this.field_92050_aA = (float)((par1 & 16711680) >> 16) / 255.0F;
|
|
||||||
this.field_92051_aB = (float)((par1 & 65280) >> 8) / 255.0F;
|
|
||||||
this.field_92052_aC = (float)((par1 & 255) >> 0) / 255.0F;
|
|
||||||
this.field_92053_aD = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* returns the bounding box for this entity
|
|
||||||
*/
|
|
||||||
public AxisAlignedBB getBoundingBox()
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if this entity should push and be pushed by other entities when colliding.
|
|
||||||
*/
|
|
||||||
public boolean canBePushed()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
|
||||||
{
|
|
||||||
if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
|
|
||||||
{
|
|
||||||
this.doRenderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void doRenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
|
||||||
{
|
|
||||||
float var8 = (float)(super.getParticleTextureIndex() % 16) / 16.0F;
|
|
||||||
float var9 = var8 + 0.0624375F;
|
|
||||||
float var10 = (float)(this.getParticleTextureIndex() / 16) / 16.0F;
|
|
||||||
float var11 = var10 + 0.0624375F;
|
|
||||||
float var12 = 0.1F * this.particleScale;
|
|
||||||
float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
|
|
||||||
float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
|
|
||||||
float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
|
|
||||||
float var16 = .0F;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if(dimHelper.dimList.get(this.worldObj.provider.dimensionId).isPocket)
|
|
||||||
{
|
|
||||||
var16=.7F;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(Exception E)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, (float) .7);
|
|
||||||
|
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11);
|
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10);
|
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10);
|
|
||||||
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called to update the entity's position/logic.
|
|
||||||
*/
|
|
||||||
public void onUpdate()
|
|
||||||
{
|
|
||||||
this.prevPosX = this.posX;
|
|
||||||
this.prevPosY = this.posY;
|
|
||||||
this.prevPosZ = this.posZ;
|
|
||||||
|
|
||||||
if (this.particleAge++ >= this.particleMaxAge)
|
|
||||||
{
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.particleAge > this.particleMaxAge / 2)
|
|
||||||
{
|
|
||||||
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge);
|
|
||||||
|
|
||||||
if (this.field_92053_aD)
|
|
||||||
{
|
|
||||||
this.particleRed += (this.field_92050_aA - this.particleRed) * 0.2F;
|
|
||||||
this.particleGreen += (this.field_92051_aB - this.particleGreen) * 0.2F;
|
|
||||||
this.particleBlue += (this.field_92052_aC - this.particleBlue) * 0.2F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setParticleTextureIndex(this.field_92049_a + (7 - this.particleAge * 8 / this.particleMaxAge));
|
|
||||||
// this.motionY -= 0.004D;
|
|
||||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
|
||||||
this.motionX *= 0.9100000262260437D;
|
|
||||||
this.motionY *= 0.9100000262260437D;
|
|
||||||
this.motionZ *= 0.9100000262260437D;
|
|
||||||
|
|
||||||
if (this.onGround)
|
|
||||||
{
|
|
||||||
this.motionX *= 0.699999988079071D;
|
|
||||||
this.motionZ *= 0.699999988079071D;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.field_92054_ax && this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0)
|
|
||||||
{
|
|
||||||
GoggleRiftFX var1 = new GoggleRiftFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, this.field_92047_az);
|
|
||||||
var1.setRBGColorF(this.particleRed, this.particleGreen, this.particleBlue);
|
|
||||||
var1.particleAge = var1.particleMaxAge / 2;
|
|
||||||
|
|
||||||
if (this.field_92053_aD)
|
|
||||||
{
|
|
||||||
var1.field_92053_aD = true;
|
|
||||||
var1.field_92050_aA = this.field_92050_aA;
|
|
||||||
var1.field_92051_aB = this.field_92051_aB;
|
|
||||||
var1.field_92052_aC = this.field_92052_aC;
|
|
||||||
}
|
|
||||||
|
|
||||||
var1.field_92048_ay = this.field_92048_ay;
|
|
||||||
this.field_92047_az.addEffect(var1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getBrightnessForRender(float par1)
|
|
||||||
{
|
|
||||||
return 15728880;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets how bright this entity is.
|
|
||||||
*/
|
|
||||||
public float getBrightness(float par1)
|
|
||||||
{
|
|
||||||
return 1.0F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,276 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDimClient;
|
|
||||||
|
|
||||||
import java.nio.FloatBuffer;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
|
||||||
import net.minecraft.client.renderer.GLAllocation;
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.TileEntityDimDoor;
|
|
||||||
import StevenDimDoors.mod_pocketDim.dimDoor;
|
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public class RenderDimDoor extends TileEntitySpecialRenderer
|
|
||||||
{
|
|
||||||
FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders the dimdoor.
|
|
||||||
*/
|
|
||||||
public void renderDimDoorTileEntity(TileEntityDimDoor tile, double x, double y, double z, float par8)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
dimDoor.class.cast(Block.blocksList[mod_pocketDim.dimDoorID]).updateAttatchedTile(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord).getFullMetadata(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord);
|
|
||||||
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// float playerX = (float)this.tileEntityRenderer.playerX;
|
|
||||||
// float playerY = (float)this.tileEntityRenderer.playerY;
|
|
||||||
// float playerZ = (float)this.tileEntityRenderer.playerZ;
|
|
||||||
|
|
||||||
//float distance = (float) tile.getDistanceFrom(playerX, playerY, playerZ);
|
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
|
||||||
Random rand = new Random(31100L);
|
|
||||||
float var13 = 0.75F;
|
|
||||||
|
|
||||||
for (int count = 0; count < 16; ++count)
|
|
||||||
{
|
|
||||||
GL11.glPushMatrix();
|
|
||||||
float var15 = (float)(16 - count);
|
|
||||||
float var16 = 0.2625F;
|
|
||||||
float var17 = 1.0F / (var15 + 1.0F);
|
|
||||||
|
|
||||||
if (count == 0)
|
|
||||||
{
|
|
||||||
this.bindTextureByName("/RIFT.png");
|
|
||||||
var17 = 0.1F;
|
|
||||||
var15 = 25.0F;
|
|
||||||
var16 = 0.125F;
|
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
|
||||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count == 1)
|
|
||||||
{
|
|
||||||
this.bindTextureByName("/WARP.png");
|
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
|
||||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
|
||||||
var16 = .5F;
|
|
||||||
}
|
|
||||||
|
|
||||||
float startY = (float)(+(y + (double)var13));
|
|
||||||
float ratioY = startY + ActiveRenderInfo.objectY;
|
|
||||||
float ratioY2 = startY + var15 + ActiveRenderInfo.objectY;
|
|
||||||
float yConverted = ratioY / ratioY2;
|
|
||||||
|
|
||||||
float startZ = (float)(+(z + (double)var13));
|
|
||||||
float ratioZ = startZ + ActiveRenderInfo.objectZ;
|
|
||||||
float ratioZ2 = startZ + var15 + ActiveRenderInfo.objectZ;
|
|
||||||
float zConverted = ratioZ / ratioZ2;
|
|
||||||
|
|
||||||
float startX = (float)(+(x + (double)var13));
|
|
||||||
float ratioX = startX + ActiveRenderInfo.objectX;
|
|
||||||
float ratioX2 = startX + var15 + ActiveRenderInfo.objectX;
|
|
||||||
float xConverted = ratioX / ratioX2;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
yConverted += (float)(y + (double)var13);
|
|
||||||
xConverted += (float)(x + (double)var13);
|
|
||||||
zConverted += (float)(z + (double)var13);
|
|
||||||
|
|
||||||
GL11.glTranslatef( (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F,0, 0.0F);
|
|
||||||
GL11.glTranslatef(0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F, 0.0F);
|
|
||||||
|
|
||||||
GL11.glTranslatef(0,0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F);
|
|
||||||
|
|
||||||
GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
|
||||||
GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
|
||||||
GL11.glTexGeni(GL11.GL_R, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
|
||||||
GL11.glTexGeni(GL11.GL_Q, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
|
||||||
switch ((tile.orientation%4)+4)
|
|
||||||
{
|
|
||||||
case 4:
|
|
||||||
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
|
|
||||||
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_S);
|
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_T);
|
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_R);
|
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_Q);
|
|
||||||
GL11.glPopMatrix();
|
|
||||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
|
||||||
GL11.glPushMatrix();
|
|
||||||
GL11.glLoadIdentity();
|
|
||||||
GL11.glTranslatef(0.0F, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F*var15, 0.0F);
|
|
||||||
GL11.glScalef(var16, var16, var16);
|
|
||||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
|
||||||
GL11.glRotatef((float)(count * count * 4321 + count * 9) * 2.0F, 0.0F, 0.0F, 1.0F);
|
|
||||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
|
||||||
|
|
||||||
Tessellator var24 = Tessellator.instance;
|
|
||||||
var24.startDrawingQuads();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float var21 = rand.nextFloat() * 0.5F + 0.1F;
|
|
||||||
float var22 = rand.nextFloat() * 0.4F + 0.4F;
|
|
||||||
float var23 = rand.nextFloat() * 0.6F + 0.5F;
|
|
||||||
|
|
||||||
if (count == 0)
|
|
||||||
{
|
|
||||||
var23 = 1.0F;
|
|
||||||
var22 = 1.0F;
|
|
||||||
yConverted = 1.0F;
|
|
||||||
}
|
|
||||||
var24.setColorRGBA_F(var21 * var17, var22 * var17, var23 * var17, 1.0F);
|
|
||||||
if(tile.openOrClosed)
|
|
||||||
{
|
|
||||||
|
|
||||||
switch (tile.orientation)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
|
|
||||||
var24.addVertex(x+.01F, y-1 , z);
|
|
||||||
var24.addVertex(x+.01, y-1, z+1.0D);
|
|
||||||
var24.addVertex(x+.01 , y+1 , z + 1.0D);
|
|
||||||
var24.addVertex(x+.01 , y+1 , z);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
var24.addVertex(x , y+1 , z+.01);
|
|
||||||
var24.addVertex(x+1 , y+1 , z+.01);
|
|
||||||
var24.addVertex(x+1, y-1, z+.01);
|
|
||||||
var24.addVertex(x, y-1, z+.01);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 2: //
|
|
||||||
var24.addVertex(x+.99 , y+1 , z);
|
|
||||||
var24.addVertex(x+.99 , y+1 , z + 1.0D);
|
|
||||||
var24.addVertex(x+.99, y-1, z+1.0D);
|
|
||||||
var24.addVertex(x+.99, y-1, z);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
var24.addVertex(x, y-1, z+.99);
|
|
||||||
var24.addVertex(x+1, y-1, z+.99);
|
|
||||||
var24.addVertex(x+1 , y+1 , z+.99);
|
|
||||||
var24.addVertex(x , y+1 , z+.99);
|
|
||||||
break;
|
|
||||||
case 4://
|
|
||||||
// GL11.glTranslatef();
|
|
||||||
|
|
||||||
var24.addVertex(x+.15F, y-1 , z);
|
|
||||||
var24.addVertex(x+.15, y-1, z+1.0D);
|
|
||||||
var24.addVertex(x+.15 , y+1 , z + 1.0D);
|
|
||||||
var24.addVertex(x+.15 , y+1 , z);
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
var24.addVertex(x , y+1 , z+.15);
|
|
||||||
var24.addVertex(x+1 , y+1 , z+.15);
|
|
||||||
var24.addVertex(x+1, y-1, z+.15);
|
|
||||||
var24.addVertex(x, y-1, z+.15);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 6: //
|
|
||||||
var24.addVertex(x+.85 , y+1 , z);
|
|
||||||
var24.addVertex(x+.85 , y+1 , z + 1.0D);
|
|
||||||
var24.addVertex(x+.85, y-1, z+1.0D);
|
|
||||||
var24.addVertex(x+.85, y-1, z);
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
var24.addVertex(x, y-1, z+.85);
|
|
||||||
var24.addVertex(x+1, y-1, z+.85);
|
|
||||||
var24.addVertex(x+1 , y+1 , z+.85);
|
|
||||||
var24.addVertex(x , y+1 , z+.85);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var24.draw();
|
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
|
||||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
|
||||||
}
|
|
||||||
|
|
||||||
GL11.glDisable(GL11.GL_BLEND);
|
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_S);
|
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_T);
|
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_R);
|
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_Q);
|
|
||||||
GL11.glEnable(GL11.GL_LIGHTING);
|
|
||||||
}
|
|
||||||
|
|
||||||
private FloatBuffer getFloatBuffer(float par1, float par2, float par3, float par4)
|
|
||||||
{
|
|
||||||
this.field_76908_a.clear();
|
|
||||||
this.field_76908_a.put(par1).put(par2).put(par3).put(par4);
|
|
||||||
this.field_76908_a.flip();
|
|
||||||
return this.field_76908_a;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
|
||||||
{
|
|
||||||
if(mod_pocketDim.enableDoorOpenGL)
|
|
||||||
{
|
|
||||||
this.renderDimDoorTileEntity((TileEntityDimDoor)par1TileEntity, par2, par4, par6, par8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,274 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDimClient;
|
|
||||||
|
|
||||||
import java.nio.FloatBuffer;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
|
||||||
import net.minecraft.client.renderer.GLAllocation;
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.TileEntityDimDoor;
|
|
||||||
import StevenDimDoors.mod_pocketDim.dimDoor;
|
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public class RenderDimRail extends TileEntitySpecialRenderer
|
|
||||||
{
|
|
||||||
FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders the dimdoor.
|
|
||||||
*/
|
|
||||||
public void renderDimDoorTileEntity(TileEntityDimDoor tile, double x, double y, double z, float par8)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
dimDoor.class.cast(Block.blocksList[mod_pocketDim.dimDoorID]).updateAttatchedTile(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord).getFullMetadata(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord);
|
|
||||||
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
float playerX = (float)this.tileEntityRenderer.playerX;
|
|
||||||
float playerY = (float)this.tileEntityRenderer.playerY;
|
|
||||||
float playerZ = (float)this.tileEntityRenderer.playerZ;
|
|
||||||
|
|
||||||
float distance = (float) tile.getDistanceFrom(playerX, playerY, playerZ);
|
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
|
||||||
Random rand = new Random(31100L);
|
|
||||||
float var13 = 0.75F;
|
|
||||||
|
|
||||||
for (int count = 0; count < 16; ++count)
|
|
||||||
{
|
|
||||||
GL11.glPushMatrix();
|
|
||||||
float var15 = (float)(16 - count);
|
|
||||||
float var16 = 0.2625F;
|
|
||||||
float var17 = 1.0F / (var15 + 1.0F);
|
|
||||||
|
|
||||||
if (count == 0)
|
|
||||||
{
|
|
||||||
this.bindTextureByName("/RIFT.png");
|
|
||||||
var17 = 0.1F;
|
|
||||||
var15 = 25.0F;
|
|
||||||
var16 = 0.125F;
|
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
|
||||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count == 1)
|
|
||||||
{
|
|
||||||
this.bindTextureByName("/WARP.png");
|
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
|
||||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
|
||||||
var16 = .5F;
|
|
||||||
}
|
|
||||||
|
|
||||||
float startY = (float)(+(y + (double)var13));
|
|
||||||
float ratioY = startY + ActiveRenderInfo.objectY;
|
|
||||||
float ratioY2 = startY + var15 + ActiveRenderInfo.objectY;
|
|
||||||
float yConverted = ratioY / ratioY2;
|
|
||||||
|
|
||||||
float startZ = (float)(+(z + (double)var13));
|
|
||||||
float ratioZ = startZ + ActiveRenderInfo.objectZ;
|
|
||||||
float ratioZ2 = startZ + var15 + ActiveRenderInfo.objectZ;
|
|
||||||
float zConverted = ratioZ / ratioZ2;
|
|
||||||
|
|
||||||
float startX = (float)(+(x + (double)var13));
|
|
||||||
float ratioX = startX + ActiveRenderInfo.objectX;
|
|
||||||
float ratioX2 = startX + var15 + ActiveRenderInfo.objectX;
|
|
||||||
float xConverted = ratioX / ratioX2;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
yConverted += (float)(y + (double)var13);
|
|
||||||
xConverted += (float)(x + (double)var13);
|
|
||||||
zConverted += (float)(z + (double)var13);
|
|
||||||
|
|
||||||
GL11.glTranslatef( (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F,0, 0.0F);
|
|
||||||
GL11.glTranslatef(0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F, 0.0F);
|
|
||||||
|
|
||||||
GL11.glTranslatef(0,0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F);
|
|
||||||
|
|
||||||
GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
|
||||||
GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
|
||||||
GL11.glTexGeni(GL11.GL_R, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
|
||||||
GL11.glTexGeni(GL11.GL_Q, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
|
||||||
switch ((tile.orientation%4)+4)
|
|
||||||
{
|
|
||||||
case 4:
|
|
||||||
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
|
|
||||||
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
|
||||||
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_S);
|
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_T);
|
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_R);
|
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_Q);
|
|
||||||
GL11.glPopMatrix();
|
|
||||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
|
||||||
GL11.glPushMatrix();
|
|
||||||
GL11.glLoadIdentity();
|
|
||||||
GL11.glTranslatef(0.0F, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F*var15, 0.0F);
|
|
||||||
GL11.glScalef(var16, var16, var16);
|
|
||||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
|
||||||
GL11.glRotatef((float)(count * count * 4321 + count * 9) * 2.0F, 0.0F, 0.0F, 1.0F);
|
|
||||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
|
||||||
|
|
||||||
Tessellator var24 = Tessellator.instance;
|
|
||||||
var24.startDrawingQuads();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float var21 = rand.nextFloat() * 0.5F + 0.1F;
|
|
||||||
float var22 = rand.nextFloat() * 0.4F + 0.4F;
|
|
||||||
float var23 = rand.nextFloat() * 0.6F + 0.5F;
|
|
||||||
|
|
||||||
if (count == 0)
|
|
||||||
{
|
|
||||||
var23 = 1.0F;
|
|
||||||
var22 = 1.0F;
|
|
||||||
yConverted = 1.0F;
|
|
||||||
}
|
|
||||||
var24.setColorRGBA_F(var21 * var17, var22 * var17, var23 * var17, 1.0F);
|
|
||||||
if(tile.openOrClosed)
|
|
||||||
{
|
|
||||||
|
|
||||||
switch (tile.orientation)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
|
|
||||||
var24.addVertex(x+.01F, y-1 , z);
|
|
||||||
var24.addVertex(x+.01, y-1, z+1.0D);
|
|
||||||
var24.addVertex(x+.01 , y+1 , z + 1.0D);
|
|
||||||
var24.addVertex(x+.01 , y+1 , z);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
var24.addVertex(x , y+1 , z+.01);
|
|
||||||
var24.addVertex(x+1 , y+1 , z+.01);
|
|
||||||
var24.addVertex(x+1, y-1, z+.01);
|
|
||||||
var24.addVertex(x, y-1, z+.01);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 2: //
|
|
||||||
var24.addVertex(x+.99 , y+1 , z);
|
|
||||||
var24.addVertex(x+.99 , y+1 , z + 1.0D);
|
|
||||||
var24.addVertex(x+.99, y-1, z+1.0D);
|
|
||||||
var24.addVertex(x+.99, y-1, z);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
var24.addVertex(x, y-1, z+.99);
|
|
||||||
var24.addVertex(x+1, y-1, z+.99);
|
|
||||||
var24.addVertex(x+1 , y+1 , z+.99);
|
|
||||||
var24.addVertex(x , y+1 , z+.99);
|
|
||||||
break;
|
|
||||||
case 4://
|
|
||||||
// GL11.glTranslatef();
|
|
||||||
|
|
||||||
var24.addVertex(x+.15F, y-1 , z);
|
|
||||||
var24.addVertex(x+.15, y-1, z+1.0D);
|
|
||||||
var24.addVertex(x+.15 , y+1 , z + 1.0D);
|
|
||||||
var24.addVertex(x+.15 , y+1 , z);
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
var24.addVertex(x , y+1 , z+.15);
|
|
||||||
var24.addVertex(x+1 , y+1 , z+.15);
|
|
||||||
var24.addVertex(x+1, y-1, z+.15);
|
|
||||||
var24.addVertex(x, y-1, z+.15);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 6: //
|
|
||||||
var24.addVertex(x+.85 , y+1 , z);
|
|
||||||
var24.addVertex(x+.85 , y+1 , z + 1.0D);
|
|
||||||
var24.addVertex(x+.85, y-1, z+1.0D);
|
|
||||||
var24.addVertex(x+.85, y-1, z);
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
var24.addVertex(x, y-1, z+.85);
|
|
||||||
var24.addVertex(x+1, y-1, z+.85);
|
|
||||||
var24.addVertex(x+1 , y+1 , z+.85);
|
|
||||||
var24.addVertex(x , y+1 , z+.85);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var24.draw();
|
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
|
||||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
|
||||||
}
|
|
||||||
|
|
||||||
GL11.glDisable(GL11.GL_BLEND);
|
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_S);
|
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_T);
|
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_R);
|
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_Q);
|
|
||||||
GL11.glEnable(GL11.GL_LIGHTING);
|
|
||||||
}
|
|
||||||
|
|
||||||
private FloatBuffer getFloatBuffer(float par1, float par2, float par3, float par4)
|
|
||||||
{
|
|
||||||
this.field_76908_a.clear();
|
|
||||||
this.field_76908_a.put(par1).put(par2).put(par3).put(par4);
|
|
||||||
this.field_76908_a.flip();
|
|
||||||
return this.field_76908_a;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
|
||||||
{
|
|
||||||
if(mod_pocketDim.enableDoorOpenGL)
|
|
||||||
{
|
|
||||||
this.renderDimDoorTileEntity((TileEntityDimDoor)par1TileEntity, par2, par4, par6, par8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
49
build.gradle
Normal file
49
build.gradle
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven {
|
||||||
|
name = "forge"
|
||||||
|
url = "http://files.minecraftforge.net/maven"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'forge'
|
||||||
|
|
||||||
|
version = "2.2.4-" + System.getenv("BUILD_NUMBER")
|
||||||
|
group = "com.stevenrs11.dimdoors" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
archivesBaseName = "DimensionalDoors"
|
||||||
|
|
||||||
|
minecraft {
|
||||||
|
version = "1.6.4-9.11.1.964"
|
||||||
|
|
||||||
|
replaceIn "mod_pocketDim.java"
|
||||||
|
replace "@VERSION@", project.version
|
||||||
|
}
|
||||||
|
|
||||||
|
targetCompatibility = '1.6'
|
||||||
|
sourceCompatibility = '1.6'
|
||||||
|
|
||||||
|
processResources
|
||||||
|
{
|
||||||
|
// Replace stuff $version and $mcversion in mcmod.info
|
||||||
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
|
include 'mcmod.info'
|
||||||
|
|
||||||
|
// Replace version and mcversion
|
||||||
|
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy everything else
|
||||||
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
|
exclude 'mcmod.info'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jar
|
||||||
|
{
|
||||||
|
destinationDir = new File("build/dist/")
|
||||||
|
}
|
||||||
@@ -1,62 +1,93 @@
|
|||||||
|
|
||||||
|
|
||||||
<project name="DimensionalDoors" default="install" basedir=".">
|
<project name="DimensionalDoors" default="install" basedir=".">
|
||||||
|
|
||||||
<property environment="env" />
|
<property environment="env" />
|
||||||
|
|
||||||
|
<property name="project.name" value="DimDoors" />
|
||||||
|
<property name="src.dir" value="StevenDimDoors" />
|
||||||
|
<property name="resources.dir" value="resources" />
|
||||||
|
<property name="schematics.dir" value="schematics" />
|
||||||
|
<property name="versionclass.dir" value="mod_pocketDim" />
|
||||||
|
<property name="versionclass.file" value="mod_pocketDim.java"/>
|
||||||
|
|
||||||
|
<property name="minecraft.version" value="1.6.4" />
|
||||||
|
<property name="forge.forgeversion" value="9.11.1" />
|
||||||
|
<property name="forge.buildnum" value="953" />
|
||||||
|
|
||||||
<property name="build.dir" value="build" />
|
<property name="build.dir" value="build" />
|
||||||
<property name="classes.dir" value="${build.dir}/packaging" />
|
<property name="classes.dir" value="${build.dir}/packaging" />
|
||||||
<property name="src.dir" value="src" />
|
<property name="resourcePack.dir" value="${classes.dir}" />
|
||||||
<property name="forge.version" value="1.4.7-6.6.2.534" />
|
<property name="schematicPack.dir" value="${classes.dir}/schematics/" />
|
||||||
|
<property name="apiclasses.dir" value="${build.dir}/api-packaging" />
|
||||||
|
<property name="forge.version" value="${minecraft.version}-${forge.forgeversion}.${forge.buildnum}" />
|
||||||
<property name="forge.url" value="http://files.minecraftforge.net/minecraftforge/minecraftforge-src-${forge.version}.zip" />
|
<property name="forge.url" value="http://files.minecraftforge.net/minecraftforge/minecraftforge-src-${forge.version}.zip" />
|
||||||
<property name="mcp.version" value="726a" />
|
|
||||||
<property name="forge.dir" value="${build.dir}/forge" />
|
<property name="forge.dir" value="${build.dir}/forge" />
|
||||||
<property name="mcp.dir" value="${forge.dir}/mcp" />
|
<property name="mcp.dir" value="${forge.dir}/mcp" />
|
||||||
<property name="mcpsrc.dir" value="${mcp.dir}/src/minecraft" />
|
<property name="mcpsrc.dir" value="${mcp.dir}/src/minecraft/StevenDimDoors" />
|
||||||
<property name="resources.dir" value="resources" />
|
|
||||||
|
|
||||||
<property name="package.meta-inf" value="META-INF" />
|
<property name="package.meta-inf" value="META-INF" />
|
||||||
<property name="build.ver" value="1.4.7" />
|
|
||||||
<property name="dist.dir" value="${build.dir}/dist" />
|
<property name="dist.dir" value="${build.dir}/dist" />
|
||||||
|
|
||||||
<property name="download.dir" value="downloads" />
|
<property name="download.dir" value="${build.dir}/downloads" />
|
||||||
|
|
||||||
<property name="lib.dir" value="${mcp.dir}/lib" />
|
<property name="lib.dir" value="${mcp.dir}/lib" />
|
||||||
|
|
||||||
<property file="${forge.dir}/forgeversion.properties" />
|
<property file="${forge.dir}/forgeversion.properties" />
|
||||||
<condition property="forge.already.installed">
|
<condition property="forge.already.installed">
|
||||||
<equals arg1="${forge.build.number}" arg2="534" />
|
<equals arg1="${forge.build.number}" arg2="${forge.buildnum}" />
|
||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
<property name="verclass.dir" value="${mcpsrc.dir}/StevenDimDoors/mod_pocketDim/" />
|
|
||||||
<property name="verclass.name" value="mod_pocketDim.java"/>
|
|
||||||
|
|
||||||
|
|
||||||
<mkdir dir="${download.dir}"/>
|
<mkdir dir="${download.dir}"/>
|
||||||
<mkdir dir="${build.dir}" />
|
<mkdir dir="${build.dir}" />
|
||||||
|
|
||||||
<target name="get-version" depends="setup-forge">
|
|
||||||
<mkdir dir="${mcpsrc.dir}/StevenDimDoors" />
|
|
||||||
<copy todir="${mcpsrc.dir}/StevenDimDoors" overwrite="true">
|
|
||||||
<fileset dir="StevenDimDoors" />
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
|
<target name="get-version" depends="setup-forge">
|
||||||
|
<!-- Copy source -->
|
||||||
<exec dir="${verclass.dir}" executable="sh" osfamily="unix" outputproperty="grep.out">
|
<copy todir="${mcpsrc.dir}" overwrite="true">
|
||||||
<arg value="-c"/>
|
<fileset dir="${src.dir}"/>
|
||||||
<arg value="grep -o -P '[0-9.]+R[0-9.]+(RC[0-9]+)?(B[0-9]+)?' ${verclass.name}"/>
|
</copy>
|
||||||
</exec>
|
|
||||||
<exec executable="python" osfamily="unix">
|
<!-- Get the version from the mcmod.info -->
|
||||||
<arg value="versionscript.py" />
|
<script language="javascript">
|
||||||
<arg value="${grep.out}" />
|
importClass(java.io.File);
|
||||||
</exec>
|
importClass(java.nio.file.Files)
|
||||||
<echo message="Grepped version: ${grep.out}"/>
|
importClass(java.io.FileReader);
|
||||||
<copy todir="${classes.dir}" file="mcmod.info" overwrite="true"/>
|
importClass(java.io.BufferedReader);
|
||||||
|
importClass(java.io.FileWriter);
|
||||||
|
importClass(java.io.BufferedWriter);
|
||||||
|
|
||||||
|
echo = project.createTask("echo");
|
||||||
|
echo.setMessage("Parsing mcmod.info...");
|
||||||
|
echo.perform();
|
||||||
|
|
||||||
|
var file = new File("./mcmod.info");
|
||||||
|
|
||||||
|
fr = new FileReader(file);
|
||||||
|
br = new BufferedReader(fr);
|
||||||
|
|
||||||
|
// Read the file.
|
||||||
|
// This assumes the file has no line
|
||||||
|
var line;
|
||||||
|
var json = "";
|
||||||
|
while ((line = br.readLine()) != null) {
|
||||||
|
json += line;
|
||||||
|
}
|
||||||
|
|
||||||
|
var struct = JSON.parse(json);
|
||||||
|
var version = struct["modlist"][0].version;
|
||||||
|
|
||||||
|
echo = project.createTask("echo");
|
||||||
|
echo.setMessage("Parsed version: " + version);
|
||||||
|
echo.perform();
|
||||||
|
|
||||||
|
project.setProperty("mod.version", version);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Replace the version information in the mod class -->
|
||||||
|
<replace file="${mcpsrc.dir}/${versionclass.dir}/${versionclass.file}">
|
||||||
|
<replacefilter token="$VERSION$" value="${mod.version}"/>
|
||||||
|
</replace>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<available property="forge-exists" file="${download.dir}/minecraftforge-src-${forge.version}.zip" />
|
<available property="forge-exists" file="${download.dir}/minecraftforge-src-${forge.version}.zip" />
|
||||||
<available property="already-compiled" file="${classes.dir}/deathrat" />
|
<available property="already-compiled" file="${classes.dir}/${src.dir}" />
|
||||||
<condition property="should-download-ant-contrib">
|
<condition property="should-download-ant-contrib">
|
||||||
<or>
|
<or>
|
||||||
<available file="${download.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
|
<available file="${download.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
|
||||||
@@ -65,14 +96,13 @@
|
|||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
<target name="install" depends="build">
|
<target name="install" depends="build">
|
||||||
<copy todir="${classes.dir}/schematics" overwrite="true">
|
<delete dir="${mcpsrc.dir}/${src.dir}" />
|
||||||
<fileset dir="schematics" />
|
<delete dir="${dist.dir}" />
|
||||||
</copy>
|
<jar destfile="${dist.dir}/${project.name}-${mod.version}-${build.number}.jar" basedir="${classes.dir}"/>
|
||||||
<zip destfile="${dist.dir}/DimensionalDoors-${grep.out}-${build.number}.zip" basedir="${classes.dir}"/>
|
|
||||||
<delete dir="${classes.dir}" />
|
<delete dir="${classes.dir}" />
|
||||||
<delete dir="${mcp.dir}/reobf"/>
|
<delete dir="${mcp.dir}/reobf"/>
|
||||||
<delete dir="${mcpsrc}/StevenDimDoors" />
|
<delete dir="{$apiclasses.dir}" />
|
||||||
<delete dir="${mcpsrc}/Steven" />
|
<delete dir="${mcpsrc.dir}/${src.dir}" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="build" depends="get-version" unless="already-compiled">
|
<target name="build" depends="get-version" unless="already-compiled">
|
||||||
@@ -87,7 +117,7 @@
|
|||||||
|
|
||||||
<!-- Reobf -->
|
<!-- Reobf -->
|
||||||
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
|
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
|
||||||
<arg line="/c reobfuscate.bat"/>
|
<arg line="/c reobfuscate.bat --srgnames"/>
|
||||||
</exec>
|
</exec>
|
||||||
|
|
||||||
<exec dir="${mcp.dir}" executable="sh" osfamily="unix">
|
<exec dir="${mcp.dir}" executable="sh" osfamily="unix">
|
||||||
@@ -97,9 +127,26 @@
|
|||||||
<copy todir="${classes.dir}">
|
<copy todir="${classes.dir}">
|
||||||
<fileset dir="${mcp.dir}/reobf/minecraft"/>
|
<fileset dir="${mcp.dir}/reobf/minecraft"/>
|
||||||
</copy>
|
</copy>
|
||||||
<copy todir="${classes.dir}">
|
|
||||||
<fileset dir="${resources.dir}"/>
|
<copy todir="${resourcePack.dir}">
|
||||||
|
<fileset dir="${resources.dir}" />
|
||||||
</copy>
|
</copy>
|
||||||
|
|
||||||
|
<copy todir="${schematicPack.dir}">
|
||||||
|
<fileset dir="${schematics.dir}" />
|
||||||
|
</copy>
|
||||||
|
|
||||||
|
<copy todir="${classes.dir}">
|
||||||
|
<fileset file="mcmod.info" />
|
||||||
|
</copy>
|
||||||
|
|
||||||
|
<copy todir="${classes.dir}">
|
||||||
|
<fileset file="${resources.dir}/pack.mcmeta" />
|
||||||
|
</copy>
|
||||||
|
|
||||||
|
<delete file="${resourcePack.dir}/mcmod.info" />
|
||||||
|
|
||||||
|
<delete file="${resourcePack.dir}/pack.mcmeta" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="build-number-there" if="env.BUILD_NUMBER" >
|
<target name="build-number-there" if="env.BUILD_NUMBER" >
|
||||||
@@ -109,7 +156,7 @@
|
|||||||
|
|
||||||
<target name="build-number-not-there" unless="env.BUILD_NUMBER" >
|
<target name="build-number-not-there" unless="env.BUILD_NUMBER" >
|
||||||
<echo message="!! No build number set !!" />
|
<echo message="!! No build number set !!" />
|
||||||
<property name="build.number" value="CUSTOM_BUILD" />
|
<property name="build.number" value="0" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="setup-forge" depends="download-forge,build-number-there,build-number-not-there" unless="forge.already.installed">
|
<target name="setup-forge" depends="download-forge,build-number-there,build-number-not-there" unless="forge.already.installed">
|
||||||
@@ -120,16 +167,10 @@
|
|||||||
<include name="minecraftforge-src-${forge.version}.zip"/>
|
<include name="minecraftforge-src-${forge.version}.zip"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
</unzip>
|
</unzip>
|
||||||
|
|
||||||
|
|
||||||
<!-- Change executables' permitions -->
|
<!-- Change executables' permitions -->
|
||||||
|
|
||||||
<chmod file="${forge.dir}/install.sh" perm="+x"/>
|
<chmod file="${forge.dir}/install.sh" perm="+x"/>
|
||||||
|
|
||||||
<!-- if your building on OSX these 2 should be executable -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Install forge -->
|
<!-- Install forge -->
|
||||||
<delete dir="${mcp.dir}" failonerror="no"/>
|
<delete dir="${mcp.dir}" failonerror="no"/>
|
||||||
<exec dir="${forge.dir}" executable="cmd" osfamily="windows" inputstring="Yes\n">
|
<exec dir="${forge.dir}" executable="cmd" osfamily="windows" inputstring="Yes\n">
|
||||||
@@ -138,21 +179,13 @@
|
|||||||
|
|
||||||
<exec dir="${forge.dir}" executable="sh" osfamily="unix" inputstring="Yes\n">
|
<exec dir="${forge.dir}" executable="sh" osfamily="unix" inputstring="Yes\n">
|
||||||
<arg value="install.sh" />
|
<arg value="install.sh" />
|
||||||
|
|
||||||
</exec>
|
</exec>
|
||||||
|
|
||||||
|
|
||||||
<chmod file="${mcp.dir}/updatemd5.sh" perm="+x"/>
|
<chmod file="${mcp.dir}/updatemd5.sh" perm="+x"/>
|
||||||
<chmod file="${mcp.dir}/recompile.sh" perm="+x"/>
|
<chmod file="${mcp.dir}/recompile.sh" perm="+x"/>
|
||||||
<chmod file="${mcp.dir}/reobfuscate.sh" perm="+x"/>
|
<chmod file="${mcp.dir}/reobfuscate.sh" perm="+x"/>
|
||||||
<chmod file="${mcp.dir}/runtime/bin/astyle-osx" perm="+x" />
|
<chmod file="${mcp.dir}/runtime/bin/astyle-osx" perm="+x" />
|
||||||
<chmod file="${mcp.dir}/runtime/bin/jad-osx" perm="+x" />
|
<chmod file="${mcp.dir}/runtime/bin/jad-osx" perm="+x" />
|
||||||
<!-- Copy libraries -->
|
|
||||||
<!-- <copy todir="${mcp.dir}/lib" >
|
|
||||||
<fileset dir="lib" >
|
|
||||||
<patternset includes="*.jar" />
|
|
||||||
</fileset>
|
|
||||||
</copy> -->
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="download-forge" depends="download-ant-contrib" unless="forge-exists">
|
<target name="download-forge" depends="download-ant-contrib" unless="forge-exists">
|
||||||
@@ -165,10 +198,8 @@
|
|||||||
</classpath>
|
</classpath>
|
||||||
</taskdef>
|
</taskdef>
|
||||||
<echo message="Downloading forge... " />
|
<echo message="Downloading forge... " />
|
||||||
<getMethod url="http://files.minecraftforge.net/minecraftforge-src-${forge.version}.zip"
|
<get src="http://files.minecraftforge.net/minecraftforge-src-${forge.version}.zip"
|
||||||
responseDataFile="${download.dir}/minecraftforge-src-${forge.version}.zip">
|
dest="${download.dir}/minecraftforge-src-${forge.version}.zip" />
|
||||||
<header name="User-Agent" value="Ant-${ant.version}/${ant.java.version}"/>
|
|
||||||
</getMethod>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="download-ant-contrib" unless="should-download-ant-contrib">
|
<target name="download-ant-contrib" unless="should-download-ant-contrib">
|
||||||
@@ -196,5 +227,4 @@
|
|||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#Tue Oct 29 18:00:54 CDT 2013
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
|
||||||
164
gradlew
vendored
Executable file
164
gradlew
vendored
Executable file
@@ -0,0 +1,164 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
##
|
||||||
|
## Gradle start up script for UN*X
|
||||||
|
##
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS=""
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
warn ( ) {
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die ( ) {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN* )
|
||||||
|
cygwin=true
|
||||||
|
;;
|
||||||
|
Darwin* )
|
||||||
|
darwin=true
|
||||||
|
;;
|
||||||
|
MINGW* )
|
||||||
|
msys=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||||
|
if $cygwin ; then
|
||||||
|
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
PRG="$0"
|
||||||
|
# Need this for relative symlinks.
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG=`dirname "$PRG"`"/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
SAVED="`pwd`"
|
||||||
|
cd "`dirname \"$PRG\"`/" >&-
|
||||||
|
APP_HOME="`pwd -P`"
|
||||||
|
cd "$SAVED" >&-
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="java"
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||||
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
|
MAX_FD="$MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
ulimit -n $MAX_FD
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Darwin, add options to specify how the application appears in the dock
|
||||||
|
if $darwin; then
|
||||||
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin ; then
|
||||||
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
|
||||||
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
SEP=""
|
||||||
|
for dir in $ROOTDIRSRAW ; do
|
||||||
|
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||||
|
SEP="|"
|
||||||
|
done
|
||||||
|
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||||
|
# Add a user-defined pattern to the cygpath arguments
|
||||||
|
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||||
|
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||||
|
fi
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
i=0
|
||||||
|
for arg in "$@" ; do
|
||||||
|
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||||
|
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
else
|
||||||
|
eval `echo args$i`="\"$arg\""
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
done
|
||||||
|
case $i in
|
||||||
|
(0) set -- ;;
|
||||||
|
(1) set -- "$args0" ;;
|
||||||
|
(2) set -- "$args0" "$args1" ;;
|
||||||
|
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
|
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
|
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
|
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
|
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
|
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
|
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||||
|
function splitJvmOpts() {
|
||||||
|
JVM_OPTS=("$@")
|
||||||
|
}
|
||||||
|
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||||
|
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||||
|
|
||||||
|
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||||
90
gradlew.bat
vendored
Normal file
90
gradlew.bat
vendored
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
@if "%DEBUG%" == "" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS=
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:init
|
||||||
|
@rem Get command-line arguments, handling Windowz variants
|
||||||
|
|
||||||
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||||
|
|
||||||
|
:win9xME_args
|
||||||
|
@rem Slurp the command line arguments.
|
||||||
|
set CMD_LINE_ARGS=
|
||||||
|
set _SKIP=2
|
||||||
|
|
||||||
|
:win9xME_args_slurp
|
||||||
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
|
set CMD_LINE_ARGS=%*
|
||||||
|
goto execute
|
||||||
|
|
||||||
|
:4NT_args
|
||||||
|
@rem Get arguments from the 4NT Shell from JP Software
|
||||||
|
set CMD_LINE_ARGS=%$
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
19
mcmod.info
19
mcmod.info
@@ -1,19 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"modid": "DimensionalDoors",
|
|
||||||
"name": "Dimensional Doors",
|
|
||||||
"description": "Bend and twist reality itelf, creating pocket dimensions, rifts, and much more",
|
|
||||||
"version": "1.3.1",
|
|
||||||
"credits": "Created by StevenRS11, logo by Jaitsu",
|
|
||||||
"logoFile": "/dimdoors_logo.png",
|
|
||||||
"mcversion": "",
|
|
||||||
"url": "http://www.minecraftforum.net/topic/1650007-147smpssplan-dimensional-doors-v110-physics-what-physics-updated-with-fancy-opengl/",
|
|
||||||
"updateUrl": "",
|
|
||||||
"authors": [ "StevenRS11" ],
|
|
||||||
"parent":"",
|
|
||||||
"screenshots": [],
|
|
||||||
"dependencies": [
|
|
||||||
"mod_MinecraftForge"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 146 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user