mirror of
https://github.com/Updated-NoCheatPlus/NoCheatPlus.git
synced 2026-11-08 09:35:18 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61d329edc5 | ||
|
|
457284858e | ||
|
|
059727e2bd | ||
|
|
0694419f52 | ||
|
|
6089ec3f7b | ||
|
|
2d51e4f8cb | ||
|
|
3b60ae8aa9 | ||
|
|
1e75c342c7 | ||
|
|
4f9a3fb605 | ||
|
|
33a2b1c7fe | ||
|
|
b173710280 | ||
|
|
04d8e6ccde | ||
|
|
0e802ca9de | ||
|
|
26a053d6cf | ||
|
|
a1f11aa32a | ||
|
|
f5ed107e2b | ||
|
|
8b98ac72b9 | ||
|
|
80dc6bb8e0 | ||
|
|
3bfb217896 | ||
|
|
2e73401803 | ||
|
|
d1a88dbc23 | ||
|
|
0a56ded6d3 | ||
|
|
f01bcefa58 | ||
|
|
c0a66a56ee | ||
|
|
05f9b9f1de | ||
|
|
32edebf3ba | ||
|
|
6c73899fa9 | ||
|
|
9a9f195d03 | ||
|
|
e0fa64c213 | ||
|
|
a310b9ebef | ||
|
|
f8502fe8e6 | ||
|
|
89643cc734 | ||
|
|
676dedb199 | ||
|
|
aa45920d88 | ||
|
|
6bb5820e3a | ||
|
|
39dca7f8b8 | ||
|
|
2e3c7244f7 | ||
|
|
867a5b66b4 | ||
|
|
804d5964d6 | ||
|
|
0dfb553965 | ||
|
|
814b48cc3c | ||
|
|
dfe93bd98a | ||
|
|
07f7eba2f4 | ||
|
|
cceb7cfd30 | ||
|
|
0cddcd1ff1 | ||
|
|
7cbd79789e | ||
|
|
ea24fa1c57 | ||
|
|
71252d72cf | ||
|
|
4a9bccd205 | ||
|
|
894f3b4779 | ||
|
|
6f25a0f0f8 | ||
|
|
fd92cde1d9 | ||
|
|
11163230ac | ||
|
|
c9741a3e33 | ||
|
|
9bb34f6f2d | ||
|
|
cce1a0ef72 | ||
|
|
9201ff03ec | ||
|
|
db3237f1ee | ||
|
|
957c1d8ea2 | ||
|
|
5e1f775d59 | ||
|
|
14a19a9512 | ||
|
|
a094328cde | ||
|
|
91b40d88f3 | ||
|
|
aad0e617dd | ||
|
|
da64b55ec1 | ||
|
|
dfa26533cb | ||
|
|
2e172a4de7 | ||
|
|
0665155d9f | ||
|
|
a87262f64b | ||
|
|
5e857b225e | ||
|
|
c0578c52b6 | ||
|
|
2ac54c712f | ||
|
|
a2bc2e5c58 | ||
|
|
f965f2ad3d | ||
|
|
c4bd3f2e20 | ||
|
|
bd501b6a68 | ||
|
|
e15d614bb8 | ||
|
|
fd872fe26c | ||
|
|
610b4b082c | ||
|
|
c163bbe76b | ||
|
|
b7b2a6d12a | ||
|
|
5877736f84 | ||
|
|
126c135c0b | ||
|
|
7604b8601c | ||
|
|
ef4e959dfa | ||
|
|
49ad9f9f41 | ||
|
|
92f1c8ff78 | ||
|
|
15cc6e11e1 | ||
|
|
1c5d8ebb97 | ||
|
|
ae2ab3543f | ||
|
|
c56a33351d | ||
|
|
6e88781512 | ||
|
|
d0015cb7c1 | ||
|
|
bd56b867af | ||
|
|
682240e8e7 | ||
|
|
785c19dfdc | ||
|
|
9dc3e81f46 | ||
|
|
349c96b9ef | ||
|
|
2d8255400d | ||
|
|
7cc3a81631 | ||
|
|
c00fc5c857 | ||
|
|
a212480ca1 | ||
|
|
47000d1061 | ||
|
|
1da6229bef | ||
|
|
1e8ad02740 | ||
|
|
8d7f6573cf | ||
|
|
dd4492dca2 | ||
|
|
fdb2c7b42a | ||
|
|
50b9eae3fd | ||
|
|
64bf374fd3 | ||
|
|
a3acd8d522 | ||
|
|
edacb1a04f | ||
|
|
b099ebd807 | ||
|
|
a394b9e29a | ||
|
|
572a26ae3f | ||
|
|
35bee4cbef | ||
|
|
de0486cf6f | ||
|
|
9c96e3c6d8 | ||
|
|
cb92b0eed7 | ||
|
|
243cbe45d0 | ||
|
|
ebd5bb84aa | ||
|
|
0da57d8f77 | ||
|
|
85f6305c9f | ||
|
|
3fc2a499ec | ||
|
|
eeb55ad552 | ||
|
|
ebd4c02ec7 | ||
|
|
2475e70d29 | ||
|
|
d98ccbe81e | ||
|
|
1defbc3305 | ||
|
|
012a1c45fd | ||
|
|
032731fc5a | ||
|
|
990a45b4a8 | ||
|
|
d6c1621e65 | ||
|
|
4817eed02e | ||
|
|
1ae66d387b | ||
|
|
25ae0a7cdc | ||
|
|
8ef0946234 | ||
|
|
3e64428d79 | ||
|
|
4a985be6cf | ||
|
|
62b07535ad | ||
|
|
bd229b0621 | ||
|
|
aaeeec8bf6 | ||
|
|
05f7064866 | ||
|
|
72f76d7f2c | ||
|
|
a6ef1b5251 | ||
|
|
62bf94cf08 | ||
|
|
53f1642bff | ||
|
|
dc3a487ca5 | ||
|
|
bef2c4e23b | ||
|
|
c1a691baaf | ||
|
|
fb5efa0d93 | ||
|
|
64a70f731c | ||
|
|
7d289a0ad1 | ||
|
|
10c50653e8 | ||
|
|
96ac4df374 | ||
|
|
81cf339560 | ||
|
|
98e96350d5 | ||
|
|
095dc1a5ba | ||
|
|
7b56ee4c40 | ||
|
|
1c609e7e4a | ||
|
|
8c1fe17749 | ||
|
|
5429c8481e | ||
|
|
715491f1ec | ||
|
|
a36053faed | ||
|
|
3ac7a45e67 | ||
|
|
2f267b5650 | ||
|
|
fc37194fd5 | ||
|
|
e3300f1e5c | ||
|
|
29f0ecdf36 | ||
|
|
b36081fc6f | ||
|
|
d23161e1a6 | ||
|
|
fcbe674233 | ||
|
|
c26fa72aaf | ||
|
|
873139546f | ||
|
|
72df6a2f97 | ||
|
|
441ab8871a | ||
|
|
b6d5c04d4d | ||
|
|
47b56fbf88 | ||
|
|
4db7e95dab | ||
|
|
e4e8b0d90c | ||
|
|
8430404436 | ||
|
|
a9e693c730 | ||
|
|
f42aafaa14 | ||
|
|
c3fc896b3d | ||
|
|
9562a277ee | ||
|
|
4029e6f4db | ||
|
|
410f88866e | ||
|
|
cfb83b4904 | ||
|
|
b1c6258675 | ||
|
|
25242e13a9 | ||
|
|
6f670ce7c8 | ||
|
|
d7fa6c1644 | ||
|
|
f56e9a9dbc | ||
|
|
0c737f3c1e | ||
|
|
602199256a | ||
|
|
d98c96c87b | ||
|
|
1b795bb9ea | ||
|
|
5713f956d9 | ||
|
|
c37908eec6 | ||
|
|
0fc194a17a | ||
|
|
07bdc0ea10 | ||
|
|
91aca1e671 | ||
|
|
552fbb446e | ||
|
|
3bebafdbe8 | ||
|
|
3ea2dc46d8 | ||
|
|
353969053d | ||
|
|
d5d16d3db5 | ||
|
|
1e6c8e3780 | ||
|
|
576379cd3e | ||
|
|
f8a5169a5a | ||
|
|
804206bf22 | ||
|
|
13d80f3166 | ||
|
|
02159d280d | ||
|
|
d2c8e080cd | ||
|
|
e2dfa93fa2 | ||
|
|
78e6c4cede | ||
|
|
4ae5b45972 | ||
|
|
46da5e3654 | ||
|
|
aa13a825da | ||
|
|
6264b5dc5c | ||
|
|
dec3253416 | ||
|
|
664a901de9 | ||
|
|
abbd90e943 | ||
|
|
2901f792a0 | ||
|
|
e2e0b0dacd | ||
|
|
4a42adf93b | ||
|
|
5883a28948 | ||
|
|
e1399ddf3b | ||
|
|
320adc16bc | ||
|
|
cbdc63e746 | ||
|
|
dcd5e1f96f | ||
|
|
0bc27d83e3 | ||
|
|
9293cde9ed | ||
|
|
a4dda13e8c | ||
|
|
9069b86c86 | ||
|
|
c69e62fc18 | ||
|
|
5a7fc17183 | ||
|
|
95b3405356 | ||
|
|
37c0db896d | ||
|
|
8c00cb5936 | ||
|
|
7d7a0a6bad | ||
|
|
7f13311ec4 | ||
|
|
3dff8c5b78 | ||
|
|
ae62126479 | ||
|
|
3f5f64396b | ||
|
|
2cff2963c9 | ||
|
|
78526facf6 | ||
|
|
939fe1fa55 | ||
|
|
b58c24e2bf | ||
|
|
b61607a4ba | ||
|
|
69a088bdcc | ||
|
|
1957f6ff0a | ||
|
|
9582d4260a | ||
|
|
bee2c1e349 | ||
|
|
5b4dc5afe9 | ||
|
|
03dd91c49b | ||
|
|
d40090def0 | ||
|
|
28504d4891 | ||
|
|
ce6d0bd42c | ||
|
|
d3594c3d75 | ||
|
|
3a4a3ae3e0 | ||
|
|
1e2015fa56 | ||
|
|
45b196c47b | ||
|
|
c4949ac0ac | ||
|
|
3695671d3b | ||
|
|
31bbfcff7d | ||
|
|
f1cb04a485 | ||
|
|
12ae08f21d | ||
|
|
8ea9b33bc9 | ||
|
|
b9f78ab326 | ||
|
|
7098895eda | ||
|
|
6b8087c380 | ||
|
|
b82b898695 | ||
|
|
f56b9375f0 | ||
|
|
01780f936f | ||
|
|
41c798f26e | ||
|
|
fffb1f4fde | ||
|
|
83d3da960d | ||
|
|
8af2853bdd | ||
|
|
fbafbdbbf2 | ||
|
|
4687a96543 | ||
|
|
0951915aa1 | ||
|
|
a1c652f2ab | ||
|
|
a5dfaa4c58 | ||
|
|
a3ea9dec8d | ||
|
|
07fb893d65 | ||
|
|
980a58e570 | ||
|
|
a684a107f0 | ||
|
|
79ecc18778 | ||
|
|
ed4e682d9b | ||
|
|
7ef94a5339 | ||
|
|
7ef4f3a1e5 | ||
|
|
ba59a57dc7 | ||
|
|
aeaabcd6a4 | ||
|
|
c995139c3a | ||
|
|
7a00d4a308 | ||
|
|
39e2ac9d71 | ||
|
|
33c9a60d6e | ||
|
|
06562f7109 | ||
|
|
670b12e5b5 | ||
|
|
03c889619a | ||
|
|
732b4aadc2 | ||
|
|
17675e4d46 | ||
|
|
b2d015adc8 | ||
|
|
fb52e44fe4 | ||
|
|
b789af5665 | ||
|
|
df1241dd0b | ||
|
|
4ad4a4e5fc | ||
|
|
b6b1c67277 | ||
|
|
4ab7fdfbbe | ||
|
|
52e6920bce | ||
|
|
9a77cbef0b | ||
|
|
447385f6e1 | ||
|
|
33a3764bbf | ||
|
|
21cd344ddb | ||
|
|
baf251defe | ||
|
|
d270be233e | ||
|
|
1a8b79fc36 | ||
|
|
2c252c8384 | ||
|
|
4a637f86fb | ||
|
|
0b1588b0c8 | ||
|
|
69bdb60ce5 | ||
|
|
b484d4fb23 | ||
|
|
d07dd10c93 | ||
|
|
b7de72ab27 | ||
|
|
f5fe83b0ed | ||
|
|
1d4c126785 | ||
|
|
aa0333bdf4 | ||
|
|
d629fbd6f9 | ||
|
|
547b9d11b6 | ||
|
|
722169edb0 | ||
|
|
3923b500dd | ||
|
|
b7489407c5 | ||
|
|
4403723ac5 | ||
|
|
7b4da789bb | ||
|
|
23842e1b75 | ||
|
|
2e8ae828b5 | ||
|
|
9089bd7cbf | ||
|
|
365fdac2c4 | ||
|
|
bcf0fc4a8f | ||
|
|
6d5c8ec4a2 | ||
|
|
2f752f7219 | ||
|
|
4c54b0e15e | ||
|
|
b8a94ee458 | ||
|
|
f2ce81bf8b | ||
|
|
4be10fb890 | ||
|
|
a77205007c | ||
|
|
1a29c99b9f | ||
|
|
d96610e752 | ||
|
|
dc1f705ed6 | ||
|
|
f96008ea3a | ||
|
|
795609fe23 | ||
|
|
0e22f6bf7c | ||
|
|
eb7115bd71 | ||
|
|
4844837775 | ||
|
|
77a2dd97b0 | ||
|
|
b74b66b869 | ||
|
|
2703135cc0 | ||
|
|
3723bef21c | ||
|
|
2373174ba0 | ||
|
|
2cd1922dc3 | ||
|
|
1287d0e811 | ||
|
|
401f5f87dd | ||
|
|
44eac16b13 | ||
|
|
f4d62900e1 | ||
|
|
920e5e15e7 | ||
|
|
698b5cc56a | ||
|
|
2dc45a01b4 | ||
|
|
7d873f5e01 | ||
|
|
7ef74117d7 | ||
|
|
efbabce522 | ||
|
|
effb084924 | ||
|
|
51d8efd250 | ||
|
|
deb1bd56a8 | ||
|
|
33207d4660 | ||
|
|
4c9df98e14 | ||
|
|
b4e282758f | ||
|
|
afe95ebb63 | ||
|
|
8d1a639b65 | ||
|
|
a2ea05806e | ||
|
|
0d4ac78b79 | ||
|
|
e98f8851e4 | ||
|
|
f99936f885 | ||
|
|
8e45a98bee | ||
|
|
e5424e121e | ||
|
|
5624aff987 | ||
|
|
fb45e3b798 | ||
|
|
bc36036556 | ||
|
|
09214d70f1 | ||
|
|
760df0833e | ||
|
|
d3196c7d60 | ||
|
|
92a9f664fd | ||
|
|
27bf8b8286 | ||
|
|
6598084cba | ||
|
|
57df2668b3 | ||
|
|
d10b419a6f | ||
|
|
9aba4269e0 | ||
|
|
8a6cf17694 | ||
|
|
d3181cc5eb | ||
|
|
259224cace | ||
|
|
84a028769f | ||
|
|
a5a2edd6db | ||
|
|
670ee03204 | ||
|
|
1aab5373af | ||
|
|
400e243187 | ||
|
|
4ad490abfa | ||
|
|
77da69bb7e | ||
|
|
deb18487cb | ||
|
|
147122f861 | ||
|
|
6f48befc93 | ||
|
|
8a74478763 | ||
|
|
c2676cd232 | ||
|
|
df88a2c2c7 | ||
|
|
96047b8e98 | ||
|
|
4d91509a43 | ||
|
|
1e04f50538 | ||
|
|
fa9e276e20 | ||
|
|
e7ed68c0c7 | ||
|
|
280a72d02d | ||
|
|
f1ec6fc408 | ||
|
|
6076d31418 | ||
|
|
ed4f3c4b36 | ||
|
|
1b67972766 | ||
|
|
5780c62e96 | ||
|
|
92ddd08b83 | ||
|
|
eb55d00b55 | ||
|
|
477e8669f0 | ||
|
|
a2f405c1a8 | ||
|
|
9cf9f14b23 | ||
|
|
8dc3066538 | ||
|
|
249297fe35 | ||
|
|
1819e42e68 | ||
|
|
7d35ed49a3 | ||
|
|
e6391dc370 | ||
|
|
03e05d84d8 | ||
|
|
dfdb9690aa | ||
|
|
844c2d6713 | ||
|
|
79b530c0fb | ||
|
|
163ba53660 | ||
|
|
ad816bacd7 | ||
|
|
99bc68b30a | ||
|
|
2b5820cd19 | ||
|
|
bb706b7391 | ||
|
|
fe11c9d1a8 | ||
|
|
8173938a16 | ||
|
|
8210643615 | ||
|
|
2ebf5b2334 | ||
|
|
c7a2c6a1e0 | ||
|
|
0c93ad1310 | ||
|
|
520a1986b4 | ||
|
|
363353ba34 | ||
|
|
bb7406dd58 | ||
|
|
078d16014b | ||
|
|
a94246f43f | ||
|
|
d42f1d11f2 | ||
|
|
e14c9a0f5d | ||
|
|
27bab89272 | ||
|
|
33daf6803a | ||
|
|
1d9d415b40 | ||
|
|
76fbb0b204 | ||
|
|
1392afb735 | ||
|
|
432b4b0a0a | ||
|
|
e5930d300d | ||
|
|
9396d10a43 | ||
|
|
b5e3525425 | ||
|
|
58a678e65c | ||
|
|
dba3d6d21d | ||
|
|
a9e79ca0c2 | ||
|
|
ba5ed1723b | ||
|
|
e7cc8e66bb | ||
|
|
4eeacda376 | ||
|
|
b0985fed7a | ||
|
|
932b8572ef | ||
|
|
b8336a93a6 | ||
|
|
bd26244017 | ||
|
|
b41de9364a | ||
|
|
a0cb3869a9 | ||
|
|
be8b6f79f0 | ||
|
|
631d6ee33c | ||
|
|
188d32e205 | ||
|
|
0fb3084664 | ||
|
|
b30eaaa747 | ||
|
|
de135cb63e | ||
|
|
4c50fd1df7 | ||
|
|
765188057b | ||
|
|
72f26af2df | ||
|
|
1aee48a853 | ||
|
|
7e0d7e3a7e | ||
|
|
6c5e1f7764 | ||
|
|
921af4dd31 | ||
|
|
295478a5ff | ||
|
|
b3e0c1738b | ||
|
|
fac8a1a73e | ||
|
|
1b77786920 | ||
|
|
03d307af2f | ||
|
|
c2473b1ed1 | ||
|
|
7f10889d39 | ||
|
|
4666291b73 | ||
|
|
f437ced44f | ||
|
|
ccd77773b5 | ||
|
|
64bb2bc278 | ||
|
|
9ceafc002b | ||
|
|
0b54230d48 | ||
|
|
8a4e2e2dfb | ||
|
|
ca43bbe550 | ||
|
|
6309766916 | ||
|
|
880217785e | ||
|
|
f8564980d0 | ||
|
|
f99afbdb1d | ||
|
|
0a7848db0f | ||
|
|
e0ee784d22 | ||
|
|
0a3b9a7829 | ||
|
|
53439f7e8a | ||
|
|
90570420b5 | ||
|
|
2bd0bd8992 | ||
|
|
540259d4aa | ||
|
|
4c85fee6f9 | ||
|
|
eb4202b5b5 | ||
|
|
3a64a90f42 | ||
|
|
69276a1315 | ||
|
|
c4331e1ffd | ||
|
|
95fb0d2494 | ||
|
|
7d421b5289 | ||
|
|
c155042a75 | ||
|
|
56af2482de | ||
|
|
5129a2df0a | ||
|
|
e5eec8905a | ||
|
|
71ba3ee690 | ||
|
|
3ecc4a89f1 | ||
|
|
0ac72f653a | ||
|
|
9fd079f24a | ||
|
|
aafb786518 | ||
|
|
1475915222 | ||
|
|
b2e62180bd | ||
|
|
b71c113440 | ||
|
|
1ba40eb66c | ||
|
|
713af9fd47 | ||
|
|
3137ce938d | ||
|
|
1dc8bcff71 | ||
|
|
f6fab19e99 | ||
|
|
141bb548a5 | ||
|
|
16465bff7f | ||
|
|
0e9f1f6ba3 | ||
|
|
d16be6b8db | ||
|
|
8433a983c0 | ||
|
|
cafa7d1015 | ||
|
|
187ee39e31 | ||
|
|
f8ecb8b8e8 | ||
|
|
8c192a0be9 | ||
|
|
eaee221150 | ||
|
|
72bd9483cb | ||
|
|
8daea7978c | ||
|
|
97522875e1 | ||
|
|
40daa9bb19 | ||
|
|
01eb504cde | ||
|
|
74a6a1ffc2 | ||
|
|
6f557b58fc | ||
|
|
0ba9540700 | ||
|
|
e7abf96e4b | ||
|
|
6f748c2fd1 | ||
|
|
b891313f80 | ||
|
|
097e36f50e | ||
|
|
4a19cd6b22 | ||
|
|
77559a7b5f | ||
|
|
e377abe342 | ||
|
|
f22055bf81 | ||
|
|
90d9aa740f | ||
|
|
ae980a1936 | ||
|
|
78190886d8 | ||
|
|
0b885f1061 | ||
|
|
bec522d41b | ||
|
|
5050724f6f | ||
|
|
97fdd00a18 | ||
|
|
77eeb66d7e | ||
|
|
8771c894bf | ||
|
|
fc2d86d87d | ||
|
|
73c14dda4d | ||
|
|
1ddfa28470 | ||
|
|
2e4cfe5957 | ||
|
|
4138b346bf | ||
|
|
18da617e05 | ||
|
|
282ef7c6be | ||
|
|
7910f6c771 | ||
|
|
9af10564b2 | ||
|
|
7dcf8e4333 | ||
|
|
a78b7833c6 | ||
|
|
7053d0a0c7 | ||
|
|
f5c7d7adc6 | ||
|
|
5527a65288 | ||
|
|
7c83c8af36 | ||
|
|
133f480a7b | ||
|
|
d9ed26a45f | ||
|
|
9828c7e2be | ||
|
|
68f187e38c | ||
|
|
5116bdbdb3 | ||
|
|
ac6b3dbe43 | ||
|
|
49d3a119f7 | ||
|
|
61b1227596 |
No files matched your search
@@ -6,13 +6,13 @@ labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
#### *Complete* output of the `ncp version` command (please prefer text here)
|
||||
|
||||
### Full output of /ncp version
|
||||
#### Short description of the issue and how to reproduce (is it random / always happens / side conditions ?)
|
||||
|
||||
### Describe the issue
|
||||
#### Have you made any (noteworthy) changes to the default configuration of NCP?
|
||||
|
||||
### How to reproduce the issue
|
||||
#### Do you run any other special plugins that affect game mechanics next to NC+ (skills, machines, adding/changing blocks, other anti-cheating)?
|
||||
|
||||
### Extra links/Videos (Including debug logs)
|
||||
#### Provide additional information: for bypasses, vulnerabilities and reproducible issues, we request a [debug log. ](https://github.com/Updated-NoCheatPlus/Docs/blob/master/Development/Debugging.md#on-the-fly-debug-output-for-individual-players) Use [GitHub gists](https://gist.github.com/) or [PasteBin](http://pastebin.com/) or similar for errors and huge logs, or attach a (zip-) file here.
|
||||
|
||||
### Any possible config options changed or plugins that may cause interference?
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
# Git
|
||||
*.orig
|
||||
!.gitignore
|
||||
|
||||
# Windows
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
*.stackdump
|
||||
[Dd]esktop.ini
|
||||
$RECYCLE.BIN/
|
||||
*.lnk
|
||||
|
||||
# Linux
|
||||
*~
|
||||
.fuse_hidden*
|
||||
.directory
|
||||
.Trash-*
|
||||
.nfs*
|
||||
|
||||
# MacOS
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
._*
|
||||
|
||||
# Java
|
||||
*.class
|
||||
*.log
|
||||
*.ctxt
|
||||
.mtj.tmp/
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
hs_err_pid*
|
||||
|
||||
# Maven
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
|
||||
# Intellij
|
||||
*.iml
|
||||
*.java___jb_tmp___
|
||||
.idea/*
|
||||
*.ipr
|
||||
*.iws
|
||||
/out/
|
||||
.idea_modules/
|
||||
|
||||
# Eclipse
|
||||
*.pydevproject
|
||||
.metadata
|
||||
.gradle
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
.project
|
||||
.externalToolBuilders/
|
||||
*.launch
|
||||
.cproject
|
||||
.classpath
|
||||
.buildpath
|
||||
.target
|
||||
|
||||
# NetBeans
|
||||
nbproject/private/
|
||||
build/
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
nbactions.xml
|
||||
nb-configuration.xml
|
||||
.nb-gradle/
|
||||
@@ -1,676 +0,0 @@
|
||||
# Custom NoCheatPlus Config
|
||||
# Version 3.2
|
||||
# Type: Auto-Ban
|
||||
# Config Developed by Captain_Obvious
|
||||
# Config support can be found here: https://goo.gl/Du4BpY
|
||||
# Reminder: You must be using the latest build of NoCheatPlus in order to run the config. Link: https://ci.md-5.net/job/NoCheatPlus/
|
||||
savebackconfig: true
|
||||
configversion:
|
||||
notify: false
|
||||
notifymaxpaths: 5
|
||||
created: 1104
|
||||
saved: 1104
|
||||
logging:
|
||||
active: true
|
||||
maxqueuesize: 5000
|
||||
extended:
|
||||
status: false
|
||||
commands:
|
||||
actions: false
|
||||
allviolations:
|
||||
debug: true
|
||||
debugonly: false
|
||||
backend:
|
||||
trace: false
|
||||
notify: false
|
||||
backend:
|
||||
console:
|
||||
active: true
|
||||
asynchronous: true
|
||||
file:
|
||||
active: false
|
||||
prefix: ''
|
||||
filename: nocheatplus.log
|
||||
ingamechat:
|
||||
active: true
|
||||
prefix: '&c&lNCP &7»&r '
|
||||
subscriptions: false
|
||||
data:
|
||||
expiration:
|
||||
active: true
|
||||
duration: 75
|
||||
history: false
|
||||
consistencychecks:
|
||||
active: true
|
||||
interval: 10
|
||||
maxtime: 2
|
||||
suppresswarnings: false
|
||||
protection:
|
||||
plugins:
|
||||
hide:
|
||||
active: true
|
||||
nopermission:
|
||||
message: '&c&lNCP &7» &rYou do not have permission to run this command.'
|
||||
commands:
|
||||
- '?'
|
||||
- plugins
|
||||
- version
|
||||
- icanhasbukkit
|
||||
- bukkit:help
|
||||
- bukkit:?
|
||||
- about
|
||||
unknowncommand:
|
||||
message: '&c&lNCP &7» &rThe server currently runs a custom &cNoCheatPlus Config &rVersion &c3.2'
|
||||
commands:
|
||||
- ncp
|
||||
commands:
|
||||
consoleonly:
|
||||
active: true
|
||||
message: '&c&lNCP &7» &rThis command could cause problems. Please execute in console if you wish to continue.'
|
||||
commands:
|
||||
- restart
|
||||
- stop
|
||||
- rl
|
||||
- reload
|
||||
clients:
|
||||
motd:
|
||||
active: true
|
||||
allowall: false
|
||||
checks:
|
||||
blockbreak:
|
||||
direction:
|
||||
active: true
|
||||
actions: cancel vl>10 log:bdirection:0:8:i cancel
|
||||
fastbreak:
|
||||
active: true
|
||||
strict: true
|
||||
delay: 95
|
||||
intervalsurvival: 100
|
||||
grace: 2000
|
||||
actions: cancel vl>2 log:fastbreak:1:10:i cancel vl>110 cmd:cheatwarn:0:15 log:fastbreak:1:7:i cancel vl>95 cmd:cccheatban:0:2 cancel vl>110 cmd:cheatban:0:2 cancel vl>125 cmd:ccheatban:0:2 cancel vl>1000 cancel log:highvlerror:0:5:i
|
||||
frequency:
|
||||
active: true
|
||||
intervalcreative: 95
|
||||
intervalsurvival: 49
|
||||
shortterm:
|
||||
ticks: 5
|
||||
limit: 6
|
||||
actions: cancel vl>12 log:bbfrequency:2:7:i cancel vl>25 cmd:cccheatkick:0:2 cancel vl>35 cancel cmd:kickfrequency:0:2 vl>50 cmd:ccheatkick:0:2 cancel
|
||||
noswing:
|
||||
active: false
|
||||
actions: vl>20 log:noswing:0:12:i
|
||||
reach:
|
||||
active: true
|
||||
actions: cancel vl>5 log:breach:0:10:i cancel
|
||||
wrongblock:
|
||||
active: true
|
||||
level: 10
|
||||
actions: cancel vl>10 log:bwrong:0:8:i cancel vl>16 cmd:cccheatkick:0:2 cancel vl>25 cancel cmd:kickwb:0:2 vl>35 cmd:ccheatkick:0:2 cancel
|
||||
blockinteract:
|
||||
direction:
|
||||
active: true
|
||||
actions: vl>5 cancel vl>24 log:bdirection:0:7:i cancel
|
||||
reach:
|
||||
active: true
|
||||
actions: cancel vl>5 log:breach:0:8:i cancel
|
||||
speed:
|
||||
active: true
|
||||
interval: 2000
|
||||
limit: 52
|
||||
actions: cancel vl>200 log:bspeed:0:8:i cancel vl>3000 cmd:cccheatban:0:2 cancel vl>4250 cmd:cheatban:0:2 cancel vl>5000 cmd:ccheatban:0:2 cancel
|
||||
visible:
|
||||
active: true
|
||||
actions: vl>4 cancel vl>50 log:bvisible:0:10:i cancel
|
||||
blockplace:
|
||||
against:
|
||||
active: true
|
||||
actions: cancel
|
||||
autosign:
|
||||
active: true
|
||||
skipempty: false
|
||||
actions: cancel vl>5 log:bautosign:0:6:i cancel vl>12 cmd:cccheatban:0:2 cancel vl>15 cmd:cheatban:0:2 cancel vl>20 cmd:ccheatban:0:2 cancel
|
||||
direction:
|
||||
active: true
|
||||
actions: cancel vl>10 log:bdirection:0:8:i cancel
|
||||
fastplace:
|
||||
active: true
|
||||
limit: 14
|
||||
shortterm:
|
||||
ticks: 12
|
||||
limit: 5
|
||||
actions: cancel vl>15 log:fastplace:1:8:i cancel vl>190 cmd:cheatwarn:0:15 log:fastplace:1:6:i cancel vl>225 cmd:cccheatban:0:2 cancel vl>275 cmd:cheatban:0:2 cancel vl>320 cmd:ccheatban:0:2 cancel
|
||||
reach:
|
||||
active: true
|
||||
actions: cancel vl>5 log:breach:0:7:i cancel
|
||||
noswing:
|
||||
active: false
|
||||
exceptions:
|
||||
- WATER_LILY
|
||||
- FLINT_AND_STEEL
|
||||
actions: cancel vl>10 log:noswing:0:7:i cancel
|
||||
speed:
|
||||
active: true
|
||||
interval: 70
|
||||
actions: cancel vl>150 log:bpspeed:3:5:i cancel vl>400 cmd:cccheatkick:0:2 cancel vl>500 cmd:cheatkick:0:2 cancel vl>600 cmd:ccheatkick:0:2 cancel
|
||||
preventmisc:
|
||||
boatsanywhere: true
|
||||
chat:
|
||||
captcha:
|
||||
active: true
|
||||
skip:
|
||||
commands: false
|
||||
characters: abcdefghjkmnpqrtuvwxyzABCDEFGHJKMNPQRTUVWXYZ2346789
|
||||
length: 4
|
||||
question: '&c&lNCP &7» &cPlease type ''&6[captcha]&c'' to continue sending messages/commands.'
|
||||
success: '&c&lNCP &7» &aYou can keep chatting now'
|
||||
tries: 3
|
||||
actions: cancel cmd:kickcaptcha:0:2 vl>4 cancel cmd:kickcaptcha:0:2
|
||||
color:
|
||||
active: false
|
||||
actions: log:color:0:6:i cancel
|
||||
commands:
|
||||
active: true
|
||||
exclusions: []
|
||||
handleaschat:
|
||||
- /me
|
||||
- /msg
|
||||
- /emsg
|
||||
- /r
|
||||
- /reply
|
||||
- /pm
|
||||
- /epm
|
||||
- /whisper
|
||||
- /tell
|
||||
- /etell
|
||||
level: 10
|
||||
shortterm:
|
||||
ticks: 18
|
||||
level: 3
|
||||
actions: cancel cmd:kickcommands:0:2 vl>20 cancel cmd:tempkick1:0:2:i
|
||||
text:
|
||||
active: true
|
||||
allowvlreset: true
|
||||
frequency:
|
||||
normal:
|
||||
minimum: 0.0
|
||||
factor: 0.9
|
||||
weight: 6
|
||||
level: 135
|
||||
actions: cancel cmd:tellchatnormal:0:2 vl>7 cancel cmd:tellchatnormal:0:2 vl>20 cancel cmd:kickchatnormal:0:2 vl>40 cancel cmd:kickchat5:0:2
|
||||
shortterm:
|
||||
minimum: 2.0
|
||||
factor: 0.7
|
||||
weight: 3.0
|
||||
level: 18.0
|
||||
actions: cancel cmd:kickchatfast:0:6 vl>20 cancel cmd:kickchat1:0:2 vl>40 cancel cmd:kickchat5:0:2
|
||||
message:
|
||||
lettercount: 1.0
|
||||
partition: 1.0
|
||||
uppercase: 1.2
|
||||
afterjoin: 1.5
|
||||
nomoving: 1.5
|
||||
repeatviolation: 1.2
|
||||
repeatglobal: 1.0
|
||||
repeatself: 1.5
|
||||
words:
|
||||
lengthav: 1.0
|
||||
lengthmsg: 1.0
|
||||
noletter: 0.0
|
||||
global:
|
||||
active: true
|
||||
weight: 1.0
|
||||
words:
|
||||
active: false
|
||||
prefixes:
|
||||
active: false
|
||||
similarity:
|
||||
active: false
|
||||
player:
|
||||
active: true
|
||||
words:
|
||||
active: false
|
||||
prefixes:
|
||||
active: false
|
||||
similarity:
|
||||
active: false
|
||||
warning:
|
||||
active: true
|
||||
level: 71
|
||||
message: '&c&lNCP &7» &cSlow down in chat!'
|
||||
timeout: 10
|
||||
relog:
|
||||
active: true
|
||||
timeout: 3250
|
||||
warning:
|
||||
message: '&cNCP &7» &cYou relogged too fast!'
|
||||
number: 1
|
||||
timeout: 60000
|
||||
kickmessage: Too fast re-login, try with a little delay.
|
||||
actions: cancel vl>15 cancel cmd:tempkick5:0:2
|
||||
logins:
|
||||
active: true
|
||||
startupdelay: 600
|
||||
perworldcount: false
|
||||
seconds: 10
|
||||
limit: 7
|
||||
kickmessage: Too many players are logging in at a time! Try again later.
|
||||
combined:
|
||||
bedleave:
|
||||
active: true
|
||||
actions: cancel log:bedleave:0:7:i cmd:kickbedleave:0:2
|
||||
enderpearl:
|
||||
active: true
|
||||
preventclickblock: true
|
||||
improbable:
|
||||
active: true
|
||||
level: 198
|
||||
actions: cancel vl>4 log:improbable:0:6:i cancel vl>520 cmd:cccheatban:0:2 cancel vl>600 cmd:cheatban:0:2 cancel vl>720 cmd:ccheatban:0:2 cancel vl>12000 cancel log:highvlerror:0:5:i
|
||||
invulnerable:
|
||||
active: true
|
||||
triggers:
|
||||
always: false
|
||||
falldistance: true
|
||||
initialticks:
|
||||
join: -1
|
||||
ignore:
|
||||
- FALL
|
||||
modifiers:
|
||||
all: 0
|
||||
munchhausen:
|
||||
active: false
|
||||
actions: cancel vl>100 cancel log:munchhausen:0:60:i
|
||||
yawrate:
|
||||
rate: 105
|
||||
penalty:
|
||||
factor: 1.0
|
||||
minimum: 250
|
||||
maximum: 2000
|
||||
improbable: true
|
||||
fight:
|
||||
canceldead: true
|
||||
toolchangepenalty: 150
|
||||
pvp:
|
||||
knockbackvelocity: default
|
||||
yawrate:
|
||||
active: true
|
||||
angle:
|
||||
active: true
|
||||
threshold: 55
|
||||
actions: cancel vl>160 log:angle:0:6:i cancel vl>310 cmd:cccheatban:0:2 cancel vl>370 cmd:cheatban:0:2 cancel vl>410 cmd:ccheatban:0:2 cancel
|
||||
critical:
|
||||
active: true
|
||||
cancel:
|
||||
cancel: 125
|
||||
dividedamage: 0.08
|
||||
falldistance: 0.075
|
||||
actions: vl>2 cancel vl>17 log:critical:0:6:i cancel vl>28 cmd:cccheatban:0:2 cancel vl>35 cmd:cheatban:0:2 cancel vl>45 cmd:ccheatban:0:2 cancel
|
||||
direction:
|
||||
active: true
|
||||
strict: false
|
||||
penalty: 160
|
||||
actions: vl>1 cancel vl>6 log:fdirection:0:6:i cancel vl>30 cmd:cheatwarn:0:15 log:fdirection:0:5:i cancel vl>38 cmd:cccheatban:0:2 cancel vl>60 cmd:cheatban:0:2 cancel vl>50 cmd:ccheatban:0:2 cancel
|
||||
fastheal:
|
||||
active: true
|
||||
interval: 4000
|
||||
buffer: 1000
|
||||
actions: cancel vl>10 cancel log:fastheal:0:10:i
|
||||
godmode:
|
||||
active: true
|
||||
minage: 1100
|
||||
maxage: 5000
|
||||
actions: log:godmode:1:8:i cancel
|
||||
noswing:
|
||||
active: true
|
||||
actions: vl>1 cancel vl>7 log:noswing:0:8:i cancel
|
||||
reach:
|
||||
active: true
|
||||
survivaldistance: 4.2
|
||||
penalty: 250
|
||||
reduce: true
|
||||
reducedistance: 0.9
|
||||
reducestep: 0.15
|
||||
actions: vl>1 cancel vl>4 log:freach:0:5:i cancel vl>22 cmd:cccheatban:0:2 cancel vl>28 cmd:cheatban:0:2 cancel vl>34 cmd:ccheatban:0:2 cancel
|
||||
selfhit:
|
||||
active: true
|
||||
actions: log:fselfhit:1:8:i cancel vl>10 cancel cmd:kickselfhit:0:2 vl>15 cmd:ccheatkick:0:2 cancel
|
||||
speed:
|
||||
active: true
|
||||
limit: 13
|
||||
actions: cancel vl>8 log:fspeed:0:6:i cancel vl>25 cmd:cccheatban:0:2 cancel vl>32 cmd:cheatban:0:2 cancel vl>40 cmd:ccheatban:0:2 cancel
|
||||
shortterm:
|
||||
ticks: 8
|
||||
limit: 6
|
||||
inventory:
|
||||
drop:
|
||||
active: true
|
||||
limit: 4
|
||||
timeframe: 15
|
||||
actions: log:drop:0:6:i cancel vl>6 cancel cmd:cheatkick:0:2
|
||||
fastclick:
|
||||
active: true
|
||||
sparecreative: true
|
||||
tweaks1_5: true
|
||||
limit:
|
||||
shortterm: 3
|
||||
normal: 9
|
||||
actions: vl>3 cancel vl>80 log:fastclick:1:8:i cancel
|
||||
instantbow:
|
||||
active: true
|
||||
strict: true
|
||||
delay: 129
|
||||
improbable:
|
||||
feedonly: false
|
||||
weight: 0.6
|
||||
actions: cancel vl>15 log:instantbow:2:6:i cancel
|
||||
instanteat:
|
||||
active: true
|
||||
actions: log:instanteat:2:5:i cancel
|
||||
fastconsume:
|
||||
active: true
|
||||
duration: 0.67
|
||||
whitelist: false
|
||||
items: []
|
||||
actions: log:fastconsume:2:8:i cancel
|
||||
gutenberg:
|
||||
active: true
|
||||
actions: cancel log:gutenberg:0:10:i cmd:kickinvaliddata:0:2
|
||||
items:
|
||||
active: true
|
||||
open:
|
||||
active: true
|
||||
close: true
|
||||
cancelother: true
|
||||
hotfix:
|
||||
duplication:
|
||||
fallingblockendportal: true
|
||||
moving:
|
||||
creativefly:
|
||||
active: true
|
||||
ignoreallowflight: true
|
||||
ignorecreative: true
|
||||
model:
|
||||
creative:
|
||||
horizontal:
|
||||
speed: 114
|
||||
vertical:
|
||||
ascend:
|
||||
speed: 97
|
||||
maxheight: 128
|
||||
spectator:
|
||||
horizontal:
|
||||
speed: 450
|
||||
vertical:
|
||||
ascend:
|
||||
speed: 170
|
||||
maxheight: 128
|
||||
gravity: false
|
||||
ground: false
|
||||
levitation:
|
||||
horizontal:
|
||||
speed: 50
|
||||
vertical:
|
||||
ascend:
|
||||
speed: 10
|
||||
maxheight: 128
|
||||
gravity: false
|
||||
modifiers: false
|
||||
gravity: false
|
||||
ground: false
|
||||
elytra:
|
||||
horizontal:
|
||||
speed: 345
|
||||
modsprint: 1.0
|
||||
vertical:
|
||||
ascend:
|
||||
speed: 0
|
||||
maxheight: 128
|
||||
modifiers: false
|
||||
actions: vl>6 cancel vl>180 cmdc:flyshort:0:6 cancel vl>1750 log:flylong:0:4:i cancel vl>6000 cmd:cheatwarn:0:15 log:flylong:0:4:i cancel vl>7000 cmd:cheatban:0:5 cancel vl>8000 cmd:ccheatban:0:2 cancel
|
||||
morepackets:
|
||||
active: true
|
||||
seconds: 6
|
||||
epsideal: 20
|
||||
epsmax: 22
|
||||
burst:
|
||||
packets: 20
|
||||
directviolation: 30
|
||||
epmviolation: 60
|
||||
setbackage: 40
|
||||
actions: cancel vl>25 log:morepackets:2:7:i cancel vl>90 cmd:cccheatkick:0:3 cancel vl>100 cmd:kickpackets:0:3 cancel vl>180 cmd:ccheatkick:0:3 cancel
|
||||
nofall:
|
||||
active: true
|
||||
dealdamage: true
|
||||
skipallowflight: true
|
||||
resetonviolation: false
|
||||
resetonteleport: false
|
||||
resetonvehicle: true
|
||||
anticriticals: true
|
||||
actions: log:nofall:0:7:i cancel vl>4 cancel cmd:cccheatkick:0:12 vl>8 cmd:cheatban:0:2 cancel vl>12 cmd:ccheatban:0:2:ci cancel
|
||||
passable:
|
||||
active: true
|
||||
actions: vl>2 cancel vl>24 log:passable:1:5:i cancel vl>170 cmd:cccheatkick:0:2 cancel vl>200 cancel cmd:cheatkick:0:2 vl>220 cmd:ccheatkick:0:2 cancel
|
||||
untracked:
|
||||
teleport:
|
||||
active: true
|
||||
command:
|
||||
active: true
|
||||
tryteleport: true
|
||||
prefixes:
|
||||
- sethome
|
||||
- home set
|
||||
- setwarp
|
||||
- warp set
|
||||
- setback
|
||||
- set back
|
||||
- back set
|
||||
- spawn
|
||||
- hub
|
||||
- tpaccept
|
||||
- tphere
|
||||
- tpaccept
|
||||
- home
|
||||
- wild
|
||||
- randomtp
|
||||
- wildtp
|
||||
survivalfly:
|
||||
active: true
|
||||
extended:
|
||||
vertical-accounting: true
|
||||
stepheight: default
|
||||
hbufmax: 1.0
|
||||
setbackpolicy:
|
||||
falldamage: true
|
||||
voidtovoid: true
|
||||
actions: vl>45 cancel vl>175 cmdc:flyshort:1:7 cancel vl>1800 log:flylong:0:6:i cancel vl>6800 cancel cmd:cheatwarn:0:15 log:flylong:0:5:i vl>9000 cmd:cccheatban:0:2 cancel vl>1000 cmd:cheatban:0:5 cancel vl>12000 cmd:ccheatban:0:2 cancel vl>25000 cancel log:highvlerror:0:5:i
|
||||
hover:
|
||||
active: true
|
||||
step: 5
|
||||
ticks: 85
|
||||
loginticks: 100
|
||||
falldamage: true
|
||||
sfviolation: 550
|
||||
velocity:
|
||||
activationcounter: 80
|
||||
activationticks: 140
|
||||
strictinvalidation: true
|
||||
splitmoves: default
|
||||
ignorestance: default
|
||||
tempkickillegal: true
|
||||
loadchunks:
|
||||
join: true
|
||||
move: true
|
||||
teleport: true
|
||||
worldchange: true
|
||||
sprintinggrace: 2.0
|
||||
assumesprint: true
|
||||
speedgrace: 4.0
|
||||
enforcelocation: default
|
||||
setback:
|
||||
method: default
|
||||
vehicle:
|
||||
preventdestroyown: true
|
||||
enforcelocation: default
|
||||
schedulesetbacks: default
|
||||
morepackets:
|
||||
active: true
|
||||
actions: cancel vl>12 log:morepackets:0:8:i cancel
|
||||
envelope:
|
||||
active: default
|
||||
actions: cancel vl>100 cancel log:vehicleenvelope:0:15:i
|
||||
message:
|
||||
illegalplayermove: Illegal move.
|
||||
illegalvehiclemove: Illegal vehicle move.
|
||||
net:
|
||||
attackfrequency:
|
||||
active: true
|
||||
limitforseconds:
|
||||
half: 9
|
||||
one: 14
|
||||
two: 39
|
||||
four: 55
|
||||
eight: 100
|
||||
actions: cancel vl>15 cancel log:attackfrequency:0:5:i vl>60 cancel cmd:kickinvaliddata:0:12 vl>75 cmd:cheatban:0:2 cancel vl>95 cmd:ccheatban:0:2 cancel
|
||||
flyingfrequency:
|
||||
active: true
|
||||
seconds: 5
|
||||
packetspersecond: 60
|
||||
actions: cancel
|
||||
reduceredundant:
|
||||
active: true
|
||||
seconds: 3
|
||||
actions: cancel vl>2500 cmd:kickinvaliddata:0:2 cancel
|
||||
keepalivefrequency:
|
||||
active: true
|
||||
actions: cancel vl>10 cancel log:keepalive:0:10:i vl>100 cancel cmd:kickalive:0:2
|
||||
packetfrequency:
|
||||
active: default
|
||||
limitpersecond: 200
|
||||
seconds: 4
|
||||
actions: cancel cmd:kickpacketfrequency:0:4 vl>4 cmd:ccheatkick:0:5 cancel
|
||||
sounddistance:
|
||||
active: true
|
||||
maxdistance: 200
|
||||
superseded:
|
||||
flying:
|
||||
cancelwaiting: true
|
||||
strings:
|
||||
angle: '&c[player] &7could be using &6KillAura &7VL &c[violations] &7(Combat Hacks)'
|
||||
attackfrequency: '&c[player] &7could be using &6MultiAura &7VL &c[violations] &7(Combat Hacks)'
|
||||
ban: ban [player]
|
||||
ban-ip: ban-ip [ip]
|
||||
bautosign: '&c[player] &7could be using &6Auto Sign &7VL &c[violations]'
|
||||
bbfrequency: '&c[player] &7could be using &6Nuker &7VL &c[violations]'
|
||||
bdirection: '&c[player] &7failed &6Impossible Interact &7VL &c[violations]'
|
||||
bedleave: '&c[player] &7failed &6Bed Leave &7VL &c[violations]'
|
||||
bpspeed: '&c[player] &7could be using &6Fast Throw &7VL &c[violations]'
|
||||
breach: '&c[player] &7could be using &6Block Reach &7VL &c[violations]'
|
||||
bspeed: '&c[player] &7could be using &6Fast Interact &7VL &c[violations]'
|
||||
bvisible: '&c[player] &7could be using &6Block Cheats &7VL &c[violations] &7(Block was not in sight)'
|
||||
bwrong: '&c[player] &7could be using &6Fast Interact &7VL &c[violations] &7(Broke a different block than clicked)'
|
||||
captcha: '&c[player] &7could be using &6Spam Bots &7VL &c[violations]'
|
||||
chatnormal: '&c[player] &7could be using &6Spam Bots &7VL &c[violations]'
|
||||
color: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
commands: '&c[player] &7could be &6Spamming &7VL &c[violations]'
|
||||
combspeed: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
critical: '&c[player] &7could be using &6Criticals &7VL &c[violations] &7(Combat Hacks)'
|
||||
drop: '&c[player] &7could be using &6Fast Drop &7VL &c[violations]'
|
||||
dropkick: ccmd [player] unless -time_online-<30|-uptime-<80 do /0/ kick [player] &cNCP &7» &cYou dropped too many items!
|
||||
fastbreak: '&c[player] &7could be using &6Fast Break &7VL &c[violations]'
|
||||
fastclick: '&c[player] &7could be using &6Fast Click &7VL &c[violations]'
|
||||
fastconsume: '&c[player] &7could be using &6Fast Eat &7VL &c[violations]'
|
||||
fastheal: '&c[player] &7could be using &6Regen &7VL &c[violations]'
|
||||
fastplace: '&c[player] &7could be using &6Fast Place &7VL &c[violations]'
|
||||
fdirection: '&c[player] &7could be using &6AimBot &7VL &c[violations] &7(Combat Hacks)'
|
||||
flyshort: ccmd [player] unless -time_online-<30|-uptime-<80 do ncp log stream notify &c[player] &7could be &6Speeding &7VL &c[violations]
|
||||
flylong: '&c[player] &7could be &6Flying &7VL &c[violations]'
|
||||
flyfile: '[player] failed [check]: tried to move: [locationfrom] -> [locationto], d=[distance] ([tags]). &7VL [violations].'
|
||||
freach: '&c[player] &7could be using &6Reach &7VL &c[violations]&7 (Combat Hacks)'
|
||||
fselfhit: '&c[player] &7could be using &6Self Hit &7VL &c[violations]&7 (Combat Hacks)'
|
||||
fspeed: '&c[player] &7could be using a &6Macro &7VL &c[violations]&7 (13+ CPS)'
|
||||
gutenberg: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
godmode: '&c[player] &7could be using &6God Mode &7VL &c[violations]'
|
||||
improbable: '&c[player] &7could be using &6KillAura &7VL &c[violations] &7(Suspicious Activity)'
|
||||
instantbow: '&c[player] &7could be using &6Instant Bow &7VL &c[violations]'
|
||||
instanteat: '&c[player] &7could be using &6Instant Eat &7VL &c[violations]'
|
||||
keepalive: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
kick: kick [player]
|
||||
kickalive: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<40 do /0/ kick [player] &cNCP &7» &cAbnormal Packets! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickattackfrequency: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickbedleave: ccmd [player] unless -time_online-<30 do /0/ kick [player] &cNCP &7» &cAbnormal Packets! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickbspeed: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickcaptcha: kick [player] &cNCP &7» &cPlease enter the captcha
|
||||
kickchat1: ncp tempkick [player] 1 &cNCP &7» You're not allowed to spam!
|
||||
kickchat5: ncp tempkick [player] 5 &cNCP &7» You're not allowed to spam!
|
||||
kickchatfast: kick [player] &cNCP &7» &cYou're not allowed to spam!
|
||||
kickchatnormal: kick [player] &cNCP &7» &cYou sent too many messages!
|
||||
kickcommands: ncp tempkick [player] 1 &cNCP &7» You sent too many commands!
|
||||
kickfly: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickfrequency: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickgod: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickinvaliddata: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &cAbnormal Packets! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickpacketfrequency: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &cAbnormal Packets! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickpackets: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30|-uptime-<80 do /0/ kick [player] &cNCP &7» &cAbnormal Packets! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickselfhit: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickwb: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
knockback: '&c[player] &7could be using &6[check] &7VL &c[violations]&7'
|
||||
morepackets: '&c[player] &7could be using &6Timer &7VL &c[violations]&7 (Too many packets)'
|
||||
msgtempdenylogin: You are temporarily denied to join this server.
|
||||
munchhausen: '&c[player] &7could be using &6[check] &7VL &c[violations]&7'
|
||||
nofall: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
chatfast: c[player] &7could be using &6[check] &7VL &c[violations]&7.
|
||||
noswing: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
passable: '&c[player] &7could be using &6Phase &7VL &c[violations]'
|
||||
relog: '&c[player] &7relogged too fast &7VL &c[violations]&7.'
|
||||
tellchatnormal: ncp tell [player] Slow down in chat!
|
||||
tempkick1: ncp tempkick [player] Please wait 1 minute before logging in
|
||||
tempkick5: ncp tempkick [player] Please wait 5 minutes before logging in
|
||||
vehicleenvelope: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
cheatwarn: tellraw [player] ["",{"text":"\n§2████████\n§2█§8██§2██§8██§2█\n§2█§8██§2██§8██§2█\n§2███§8██§2███ §fCheating has been detected. Please disable\n§2██§8████§2██ §fand continue to play. If you continue, you\n§2██§8████§2██ §fwill be punished.\n§2██§8█§2██§8█§2██\n§2████████\n","color":"gray","hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"If you are not hacking, you will not be punished.","color":"red"}]}}}]
|
||||
cccheatkick: ccmd [player] unless -ping->90|-tps-<19.5|-time_online-<30|-uptime-<80 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 90 - TPS > 19.5)
|
||||
ccheatkick: ccmd [player] unless -time_online-<30|-uptime-<80 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
cheatkick: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30|-uptime-<80 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - High VL, TPS & Ping not checked)
|
||||
cccheatban: ccmd [player] unless -ping->90|-tps-<19.5|-time_online-<30|-uptime-<80 do /0/ ban [player] &cNCP &7» &rUnfair Advantages /5/ ncp log stream notify?c+console?nc &c&lAUTOBAN:&r &7The player &c[player] &7has been banned due to &6[check] &7(&7VL &c[violations]&7 - Ping < 90 - TPS > 19.5) /40/ tellraw @a ["",{"text":"§8(§cWarning§8) §rA player has been removed from the server for cheating or abuse. Players caught cheating or abusing will be banned. Never turn your back."}]
|
||||
ccheatban: ccmd [player] unless -time_online-<30|-uptime-<80 do /0/ ban [player] &cNCP &7» &rUnfair Advantages /5/ ncp log stream notify?c+console?nc &c&lAUTOBAN:&r &7The player &c[player] &7may have been banned due to &6[check] &7(&7VL &c[violations]&7 - High VL, TPS & Ping not checked) /40/ tellraw @a ["",{"text":"§8(§cWarning§8) §rA player has been removed from the server for cheating or abuse. Players caught cheating or abusing will be banned. Never turn your back."}]
|
||||
cheatban: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30|-uptime-<80 do /0/ ban [player] &cNCP &7» &rUnfair Advantages /5/ ncp log stream notify?c+console?nc &c&lAUTOBAN:&r &7The player &c[player] &7has been banned due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2) /40/ tellraw @a ["",{"text":"§8(§cWarning§8) §rA player has been removed from the server for cheating or abuse. Players caught cheating or abusing will be banned. Never turn your back."}]
|
||||
highvlerror: '&7The player &c[player] &7caused the check &6[check] &7to go up very high to &c[violations]&7. Please investigate this issue.'
|
||||
compatibility:
|
||||
managelisteners: false
|
||||
exemptions:
|
||||
wildcard:
|
||||
default:
|
||||
metadata:
|
||||
active: true
|
||||
keys:
|
||||
- nocheat.exempt
|
||||
npc:
|
||||
active: true
|
||||
bukkitnpc: true
|
||||
metadata:
|
||||
active: true
|
||||
keys:
|
||||
- NPC
|
||||
- NCPConfigTracking
|
||||
remove:
|
||||
join: true
|
||||
leave: true
|
||||
server:
|
||||
cbdedicated:
|
||||
enable: true
|
||||
cbreflect:
|
||||
enable: true
|
||||
blocks:
|
||||
allowinstantbreak:
|
||||
- LONG_GRASS
|
||||
overrideflags:
|
||||
snow: default
|
||||
piston_moving_piece: default+ign_passable+ground_height
|
||||
WATER_LILY: default+ign_passable+ground_height+height8_1
|
||||
'60': default+ign_passable+ground_height+height8_1
|
||||
'208': solid+ground+height100+ground_height
|
||||
STEP: solid+ground+xz100+height100+ground_height+ign_passable
|
||||
changetracker:
|
||||
active: true
|
||||
pistons: true
|
||||
maxageticks: 80
|
||||
perworld:
|
||||
maxentries: 1000
|
||||
@@ -1,672 +0,0 @@
|
||||
# Custom NoCheatPlus Config
|
||||
# Version 3.2
|
||||
# Type: Auto-Kick
|
||||
# Config Developed by Captain_Obvious
|
||||
# Config support can be found here: https://goo.gl/Du4BpY
|
||||
# Reminder: You must be using the latest build of NoCheatPlus in order to run the config. Link: https://ci.md-5.net/job/NoCheatPlus/
|
||||
savebackconfig: true
|
||||
configversion:
|
||||
notify: false
|
||||
notifymaxpaths: 5
|
||||
created: 1104
|
||||
saved: 1104
|
||||
logging:
|
||||
active: true
|
||||
maxqueuesize: 5000
|
||||
extended:
|
||||
status: false
|
||||
commands:
|
||||
actions: false
|
||||
allviolations:
|
||||
debug: true
|
||||
debugonly: false
|
||||
backend:
|
||||
trace: false
|
||||
notify: false
|
||||
backend:
|
||||
console:
|
||||
active: true
|
||||
asynchronous: true
|
||||
file:
|
||||
active: false
|
||||
prefix: ''
|
||||
filename: nocheatplus.log
|
||||
ingamechat:
|
||||
active: true
|
||||
prefix: '&c&lNCP &7»&r ' # This is the NCP prefix used for all notify messages
|
||||
subscriptions: false
|
||||
data:
|
||||
expiration:
|
||||
active: true
|
||||
duration: 75
|
||||
history: false
|
||||
consistencychecks:
|
||||
active: true
|
||||
interval: 10
|
||||
maxtime: 2
|
||||
suppresswarnings: false
|
||||
protection:
|
||||
plugins:
|
||||
hide:
|
||||
active: true
|
||||
nopermission:
|
||||
message: '&c&lNCP &7» &rYou do not have permission to run this command.'
|
||||
commands: # These commands below will be blocked if the player is not opped and will display the message above
|
||||
- '?'
|
||||
- plugins
|
||||
- version
|
||||
- icanhasbukkit
|
||||
- bukkit:help
|
||||
- bukkit:?
|
||||
- about
|
||||
unknowncommand:
|
||||
message: '&c&lNCP &7» &rThe server currently runs a custom &cNoCheatPlus Config &rVersion &c3.2'
|
||||
commands: # This outputs the message above when users attempt to run the command(s) below
|
||||
- ncp
|
||||
commands:
|
||||
consoleonly:
|
||||
active: true
|
||||
message: '&c&lNCP &7» &rThis command could cause problems. Please execute in console if you wish to continue.'
|
||||
commands: # Blocks all users from using these commands and will display the message above
|
||||
- restart
|
||||
- stop
|
||||
- rl
|
||||
- reload
|
||||
clients:
|
||||
motd:
|
||||
active: true
|
||||
allowall: false
|
||||
checks:
|
||||
blockbreak:
|
||||
direction: # This will check if they are looking at the block when breaking
|
||||
active: true
|
||||
actions: cancel vl>10 log:bdirection:0:8:i cancel
|
||||
fastbreak: # This checks to see if a player broke a block too fast
|
||||
active: true
|
||||
strict: true
|
||||
delay: 95
|
||||
intervalsurvival: 100
|
||||
grace: 2000
|
||||
actions: cancel vl>2 log:fastbreak:1:10:i cancel vl>65 cmd:cccheatkick:0:2 cancel vl>75 cmd:cheatkick:0:2 cancel vl>85 cmd:ccheatkick:0:2 cancel vl>1000 cancel log:highvlerror:0:5:ic
|
||||
frequency: # This checks how many a player broke in a certain amount of time
|
||||
active: true
|
||||
intervalcreative: 95
|
||||
intervalsurvival: 49
|
||||
shortterm: # 20 ticks is one second, so in 1/4 of a second a player is maxed to 6 blocks
|
||||
ticks: 5
|
||||
limit: 6
|
||||
actions: cancel vl>12 log:bbfrequency:1:7:i cancel vl>18 cmd:cccheatkick:0:2 cancel vl>24 cancel cmd:kickfrequency:0:2 vl>31 cmd:ccheatkick:0:2 cancel
|
||||
noswing: # This check was disabled, caused too many problems with blocks coming back
|
||||
active: false
|
||||
actions: vl>20 log:noswing:0:12:i
|
||||
reach: # This checks to see if a player broke a block that they could reach
|
||||
active: true
|
||||
actions: cancel vl>5 log:breach:0:10:i cancel
|
||||
wrongblock: # This checks if a player broke the block they first interacted with/clicked
|
||||
active: true
|
||||
level: 10
|
||||
actions: cancel vl>10 log:bwrong:0:8:i cancel vl>16 cmd:cccheatkick:0:2 cancel vl>25 cancel cmd:cheatkick:0:2 vl>35 cmd:ccheatkick:0:2 cancel
|
||||
blockinteract:
|
||||
direction: # This checks if a player was looking at a block they interacted with/clicked
|
||||
active: true
|
||||
actions: vl>6 cancel vl>24 log:bdirection:0:7:i cancel
|
||||
reach: # This checks if a player could interact/click the block in reach
|
||||
active: true
|
||||
actions: cancel vl>5 log:breach:0:8:i cancel
|
||||
speed: # This checks if a player is interacting with too many blocks
|
||||
active: true
|
||||
interval: 2000
|
||||
limit: 52
|
||||
actions: cancel vl>200 log:bspeed:0:8:i cancel vl>2000 cmd:cccheatkick:0:2 cancel vl>3250 cmd:cheatkick:0:2 cancel vl>4000 cmd:ccheatkick:0:2 cancel
|
||||
visible: # This checks if a block was in sight before the player interacted with it
|
||||
active: true
|
||||
actions: vl>4 cancel vl>50 log:bvisible:0:10:i cancel
|
||||
blockplace:
|
||||
against: # This checks to see if a player places a block on a surface they couldn't, such as water
|
||||
active: true
|
||||
actions: cancel
|
||||
autosign: # Checks if a player is placing a sign too quickly
|
||||
active: true
|
||||
skipempty: false
|
||||
actions: cancel vl>5 log:bautosign:0:6:i cancel vl>8 cmd:cccheatkick:0:2 cancel vl>10 cmd:cheatkick:0:2 cancel vl>12 cmd:ccheatkick:0:2 cancel
|
||||
direction: # This checks if a player was looking at where they placed the block
|
||||
active: true
|
||||
actions: cancel vl>10 log:bdirection:0:8:i cancel
|
||||
fastplace: # This checks to see if a player places too many blocks. The limit stands for 2 seconds, so 14 blocks in two seconds is allowed. The shortterm works the same as the frequency check
|
||||
active: true
|
||||
limit: 14
|
||||
shortterm:
|
||||
ticks: 12
|
||||
limit: 5
|
||||
actions: cancel vl>15 log:fastplace:1:8:i cancel vl>155 cmd:cccheatkick:0:2 cancel vl>200 cmd:cheatkick:0:2 cancel vl>250 cmd:ccheatkick:0:2 cancel
|
||||
reach: # This checks to see if a player placed a block that they could reach
|
||||
active: true
|
||||
actions: cancel vl>5 log:breach:0:7:i cancel
|
||||
noswing: # Check disabled, caused too many issues when placing blocks
|
||||
active: false
|
||||
exceptions:
|
||||
- WATER_LILY
|
||||
- FLINT_AND_STEEL
|
||||
actions: cancel vl>10 log:noswing:0:7:i cancel
|
||||
speed: # This checks the amount of throwable obejects thrown. The interval is the time allowed between each throw (In MS)
|
||||
active: true
|
||||
interval: 70
|
||||
actions: cancel vl>150 log:bpspeed:3:5:i cancel vl>400 cmd:cccheatkick:0:2 cancel vl>500 cmd:cheatkick:0:2 cancel vl>600 cmd:ccheatkick:0:2 cancel
|
||||
preventmisc:
|
||||
boatsanywhere: true
|
||||
chat:
|
||||
captcha:
|
||||
active: true
|
||||
skip:
|
||||
commands: false
|
||||
characters: abcdefghjkmnpqrtuvwxyzABCDEFGHJKMNPQRTUVWXYZ2346789
|
||||
length: 4
|
||||
question: '&c&lNCP &7» &cPlease type ''&6[captcha]&c'' to continue sending messages/commands.'
|
||||
success: '&c&lNCP &7» &aYou can keep on chatting now'
|
||||
tries: 3
|
||||
actions: cancel cmd:kickcaptcha vl>4 log:captcha:2:5:cf cancel cmd:kickcaptcha:0:2:i
|
||||
color:
|
||||
active: false
|
||||
actions: log:color:0:6:i cancel
|
||||
commands:
|
||||
active: true
|
||||
exclusions: []
|
||||
handleaschat:
|
||||
- /me
|
||||
- /msg
|
||||
- /emsg
|
||||
- /r
|
||||
- /reply
|
||||
- /pm
|
||||
- /epm
|
||||
- /whisper
|
||||
- /tell
|
||||
- /etell
|
||||
level: 8
|
||||
shortterm:
|
||||
ticks: 19
|
||||
level: 3
|
||||
actions: log:commands:0:5:cf cancel cmd:kickcommands:0:2 vl>20 log:commands:0:5:cf cancel cmd:tempkick1:0:2:i
|
||||
text: # Advanced chat checks, adjusting may cause problems
|
||||
active: true
|
||||
allowvlreset: true
|
||||
frequency:
|
||||
normal:
|
||||
minimum: 0.0
|
||||
factor: 0.9
|
||||
weight: 6
|
||||
level: 135
|
||||
actions: cancel cmd:tellchatnormal vl>7 log:chatnormal:0:5:c cancel cmd:tellchatnormal:0:2 vl>20 log:chatnormal:0:5:cf cancel cmd:kickchatnormal:0:2 vl>40 log:chatnormal:0:5:cf cancel cmd:kickchat5:0:2
|
||||
shortterm:
|
||||
minimum: 2.0
|
||||
factor: 0.7
|
||||
weight: 3.0
|
||||
level: 18.0
|
||||
actions: log:chatfast:0:5:cf cancel cmd:kickchatfast:0:6 vl>20 log:chatfast:0:5:cf cancel cmd:kickchat1:0:2 vl>40 log:chatfast:0:5:cf cancel cmd:kickchat5:0:2
|
||||
message:
|
||||
lettercount: 1.0
|
||||
partition: 1.0
|
||||
uppercase: 1.2
|
||||
afterjoin: 1.5
|
||||
nomoving: 1.5
|
||||
repeatviolation: 1.2
|
||||
repeatglobal: 1.0
|
||||
repeatself: 1.5
|
||||
words:
|
||||
lengthav: 1.0
|
||||
lengthmsg: 1.0
|
||||
noletter: 0.0
|
||||
global:
|
||||
active: true
|
||||
weight: 1.0
|
||||
words:
|
||||
active: false
|
||||
prefixes:
|
||||
active: false
|
||||
similarity:
|
||||
active: false
|
||||
player:
|
||||
active: true
|
||||
words:
|
||||
active: false
|
||||
prefixes:
|
||||
active: false
|
||||
similarity:
|
||||
active: false
|
||||
warning:
|
||||
active: true
|
||||
level: 70
|
||||
message: '&c&lNCP &7» &cSlow down in chat!'
|
||||
timeout: 10
|
||||
relog: # This checks the amount of time between a quit and a join
|
||||
active: true
|
||||
timeout: 3250
|
||||
warning:
|
||||
message: '&c&lNCP &7» &cYou relogged too fast!'
|
||||
number: 1
|
||||
timeout: 60000
|
||||
kickmessage: Too fast re-login, try with a little delay.
|
||||
actions: log:relog:0:15:cf cancel vl>15 log:relog:0:10:cf cancel cmd:tempkick5:0:2
|
||||
logins: # A simple Anti-Bot defense. Allows 7 players to join in 10 seconds. Adjust to your server size
|
||||
active: true
|
||||
startupdelay: 600
|
||||
perworldcount: false
|
||||
seconds: 10
|
||||
limit: 7
|
||||
kickmessage: Too many players are logging in at a time! Try again later.
|
||||
combined:
|
||||
bedleave: # Prevents players from using BedLeave packets to fly or use god mode
|
||||
active: true
|
||||
actions: cancel log:bedleave:0:7:i cmd:kickbedleave:0:2 vl>2 cmd:ccheatkick:0:2 cancel
|
||||
enderpearl: # Prevents players from glitching through areas using enderpearls
|
||||
active: true
|
||||
preventclickblock: true
|
||||
improbable: # Advanced all around server checks. Can be used most commonly to detect KillAura. Works best in groups.
|
||||
active: true
|
||||
level: 198
|
||||
actions: cancel vl>4 log:improbable:0:6:i cancel vl>425 cmd:cccheatkick:0:2 cancel vl>550 cmd:cheatkick:0:2 cancel vl>640 cmd:ccheatkick:0:2 cancel vl>12000 log:highvlerror:0:5:ci cancel
|
||||
invulnerable: # These values alter the invulnerablity on login
|
||||
active: true
|
||||
triggers:
|
||||
always: false
|
||||
falldistance: true
|
||||
initialticks:
|
||||
join: -1
|
||||
ignore:
|
||||
- FALL
|
||||
modifiers:
|
||||
all: 0
|
||||
munchhausen: # Future proof: Prevents players from abusing knockback from fishing rods to fly
|
||||
active: false
|
||||
actions: cancel vl>100 cancel log:munchhausen:0:60:i
|
||||
yawrate: # This checks if a player turns (rate) amount degrees
|
||||
rate: 105
|
||||
penalty:
|
||||
factor: 1.0
|
||||
minimum: 250
|
||||
maximum: 2000
|
||||
improbable: true
|
||||
fight:
|
||||
canceldead: true
|
||||
toolchangepenalty: 150
|
||||
pvp:
|
||||
knockbackvelocity: default
|
||||
yawrate:
|
||||
active: true
|
||||
angle: # This checks if a player is hitting 2 or more entities at a time.
|
||||
active: true
|
||||
threshold: 55
|
||||
actions: cancel vl>160 log:angle:0:6:i cancel vl>260 cmd:cccheatkick:0:2 cancel vl>300 cmd:cheatkick:0:4 cancel vl>330 cmd:ccheatkick:0:2 cancel
|
||||
critical: # This prevents players from faking critical hits
|
||||
active: true
|
||||
cancel: # FallDistance checks if a player hit another player under that distance
|
||||
cancel: 125
|
||||
dividedamage: 0.08
|
||||
falldistance: 0.075
|
||||
actions: vl>2 cancel vl>17 log:critical:0:6:i cancel vl>20 cmd:cccheatkick:0:2 cancel vl>28 cmd:cheatkick:0:2 cancel vl>35 cmd:ccheatkick:0:2 cancel
|
||||
direction: # Checks to make sure a player is looking at the entity before hitting. Some false positives
|
||||
active: true
|
||||
strict: true
|
||||
penalty: 160
|
||||
actions: vl>1 cancel vl>6 log:fdirection:0:6:i cancel vl>24 cmd:cccheatkick:0:2 cancel vl>31 cmd:cheatkick:0:2 cancel vl>39 cmd:ccheatkick:0:2 cancel
|
||||
fastheal: # Prevents players from healing too fast
|
||||
active: true
|
||||
interval: 4000
|
||||
buffer: 1000
|
||||
actions: cancel vl>10 cancel log:fastheal:0:10:i vl>30 cancel log:fastheal:0:10:i
|
||||
godmode: # Prevents players from canceling any damage dealt to them
|
||||
active: true
|
||||
minage: 1100
|
||||
maxage: 5000
|
||||
actions: log:godmode:1:8:i cancel vl>60 log:godmode:1:8:i cancel
|
||||
noswing: # Prevents players from using the NoSwing cheat, some false positives
|
||||
active: true
|
||||
actions: vl>1 cancel vl>7 log:noswing:0:8:i cancel
|
||||
reach: # Prevents players from hitting an entity out of reach. Lower survival distance for a stricter check, raise for a more leinent check.
|
||||
active: true
|
||||
survivaldistance: 4.2
|
||||
penalty: 250
|
||||
reduce: true
|
||||
reducedistance: 0.9
|
||||
reducestep: 0.15
|
||||
actions: vl>1 cancel vl>4 log:freach:0:6:i cancel vl>15 cmd:cccheatkick:0:2 cancel vl>22 cmd:cheatkick:0:2 cancel vl>30 cmd:ccheatkick:0:2 cancel
|
||||
selfhit: # Prevents players from hitting themselves
|
||||
active: true
|
||||
actions: log:fselfhit:1:8:i cancel vl>10 cancel cmd:cheatkick:0:2 vl>18 cmd:ccheatkick:0:5 cancel
|
||||
speed: # Prevents players from hitting too fast
|
||||
active: true
|
||||
limit: 13
|
||||
actions: cancel vl>5 log:fspeed:0:6:i cancel vl>25 cmd:cccheatkick:0:2 cancel vl>30 cmd:cheatkick:0:2 cancel vl>45 cmd:ccheatkick:0:2 cancel
|
||||
shortterm:
|
||||
ticks: 8
|
||||
limit: 6
|
||||
inventory:
|
||||
drop: # Prevents players from dropping too many things in a time frame
|
||||
active: true
|
||||
limit: 4
|
||||
timeframe: 15
|
||||
actions: log:drop:0:6:i cancel vl>6 cancel cmd:cheatkick:0:2
|
||||
fastclick: # Prevents players from clicking too fast in their inventory
|
||||
active: true
|
||||
sparecreative: true
|
||||
tweaks1_5: true
|
||||
limit:
|
||||
shortterm: 3
|
||||
normal: 9
|
||||
actions: vl>3 cancel vl>80 log:fastclick:1:7:i cancel
|
||||
instantbow: # Prevents players from ignoring the bow dragback
|
||||
active: true
|
||||
strict: true
|
||||
delay: 129
|
||||
improbable:
|
||||
feedonly: false
|
||||
weight: 0.6
|
||||
actions: cancel vl>15 log:instantbow:2:6:i cancel
|
||||
instanteat: # Prevents players from eating food instantly
|
||||
active: true
|
||||
actions: log:instanteat:2:5:i cancel
|
||||
fastconsume: # Prevents players from eating food too fast
|
||||
active: true
|
||||
duration: 0.67
|
||||
whitelist: false
|
||||
items: []
|
||||
actions: log:fastconsume:2:8:i cancel
|
||||
gutenberg: # Old Minecraft exploit allowed crashing of the server by creating a book with tons of pages.
|
||||
active: true
|
||||
actions: cancel log:gutenberg:0:10:i cmd:kickinvaliddata:0:2
|
||||
items:
|
||||
active: true
|
||||
open:
|
||||
active: true
|
||||
close: true
|
||||
cancelother: true
|
||||
hotfix:
|
||||
duplication:
|
||||
fallingblockendportal: true
|
||||
moving:
|
||||
creativefly: # Prevents players from moving too fast than allowed
|
||||
active: true
|
||||
ignoreallowflight: true
|
||||
ignorecreative: true
|
||||
model:
|
||||
creative:
|
||||
horizontal:
|
||||
speed: 114
|
||||
vertical:
|
||||
ascend:
|
||||
speed: 97
|
||||
maxheight: 128
|
||||
spectator:
|
||||
horizontal:
|
||||
speed: 450
|
||||
vertical:
|
||||
ascend:
|
||||
speed: 170
|
||||
maxheight: 128
|
||||
gravity: false
|
||||
ground: false
|
||||
levitation:
|
||||
horizontal:
|
||||
speed: 50
|
||||
vertical:
|
||||
ascend:
|
||||
speed: 10
|
||||
maxheight: 128
|
||||
gravity: false
|
||||
modifiers: false
|
||||
gravity: false
|
||||
ground: false
|
||||
elytra:
|
||||
horizontal:
|
||||
speed: 345
|
||||
modsprint: 1.0
|
||||
vertical:
|
||||
ascend:
|
||||
speed: 0
|
||||
maxheight: 128
|
||||
modifiers: false
|
||||
actions: vl>6 cancel vl>180 cmdc:flyshort:0:6 cancel vl>3000 log:flylong:0:4:i cancel vl>4250 cmd:cccheatkick:0:2 cancel vl>5000 cmd:cheatkick:0:5 cancel vl>6500 cmd:ccheatkick:0:2 cancel
|
||||
morepackets: # Checks if a player is spamming packets or sending too many packets
|
||||
active: true
|
||||
seconds: 6
|
||||
epsideal: 20
|
||||
epsmax: 22
|
||||
burst:
|
||||
packets: 20
|
||||
directviolation: 30
|
||||
epmviolation: 60
|
||||
setbackage: 40
|
||||
actions: cancel vl>30 log:morepackets:2:7:i cancel vl>80 cmd:cccheatkick:0:2 cancel vl>100 cmd:kickpackets:0:2 cancel vl>160 cmd:ccheatkick:0:2 cancel
|
||||
nofall: # Prevents players from ignoring fall damage
|
||||
active: true
|
||||
dealdamage: true
|
||||
skipallowflight: true
|
||||
resetonviolation: false
|
||||
resetonteleport: false
|
||||
resetonvehicle: true
|
||||
anticriticals: true
|
||||
actions: log:nofall:0:7:i cancel vl>4 cancel cmd:cccheatkick:0:2 vl>8 cmd:cheatkick:0:2 cancel vl>12 cmd:ccheatkick:0:5 cancel
|
||||
passable: # Prevents players from glitching through blocks
|
||||
active: true
|
||||
actions: vl>2 cancel vl>30 log:passable:1:7:i cancel vl>170 cmd:cccheatkick:0:2 cancel vl>190 log:passable:0:7:i cancel cmd:cheatkick:0:2 vl>200 cmd:ccheatkick:0:2 cancel
|
||||
untracked:
|
||||
teleport:
|
||||
active: true
|
||||
command:
|
||||
active: true
|
||||
tryteleport: true
|
||||
prefixes:
|
||||
- sethome
|
||||
- home set
|
||||
- setwarp
|
||||
- warp set
|
||||
- setback
|
||||
- set back
|
||||
- back set
|
||||
- spawn
|
||||
- hub
|
||||
- tpaccept
|
||||
- tphere
|
||||
- tpaccept
|
||||
- home
|
||||
- wild
|
||||
- randomtp
|
||||
- wildtp
|
||||
survivalfly: # Prevents players from moving too fast/attempting to fly
|
||||
active: true
|
||||
extended:
|
||||
vertical-accounting: true
|
||||
stepheight: default
|
||||
hbufmax: 1.0
|
||||
setbackpolicy:
|
||||
falldamage: true
|
||||
voidtovoid: true
|
||||
actions: vl>45 cancel vl>175 cmdc:flyshort:1:7 cancel vl>1750 log:flylong:0:6:i cancel vl>5500 cmd:cccheatkick:0:2 cancel vl>7000 cmd:cheatkick:0:5 cancel vl>8000 cmd:ccheatkick:0:2 cancel vl>25000 cancel log:highvlerror:0:2:ic
|
||||
hover:
|
||||
active: true
|
||||
step: 5
|
||||
ticks: 85
|
||||
loginticks: 100
|
||||
falldamage: true
|
||||
sfviolation: 350
|
||||
velocity:
|
||||
activationcounter: 80
|
||||
activationticks: 140
|
||||
strictinvalidation: true
|
||||
splitmoves: default
|
||||
ignorestance: default
|
||||
tempkickillegal: true
|
||||
loadchunks:
|
||||
join: true
|
||||
move: true
|
||||
teleport: true
|
||||
worldchange: true
|
||||
sprintinggrace: 2.0
|
||||
assumesprint: true
|
||||
speedgrace: 4.0
|
||||
enforcelocation: default
|
||||
setback:
|
||||
method: default
|
||||
vehicle:
|
||||
preventdestroyown: true
|
||||
enforcelocation: default
|
||||
schedulesetbacks: default
|
||||
morepackets:
|
||||
active: true
|
||||
actions: cancel vl>10 log:morepackets:0:8:i cancel
|
||||
envelope:
|
||||
active: default
|
||||
actions: cancel vl>100 cancel log:vehicleenvelope:0:15:i
|
||||
message:
|
||||
illegalplayermove: Illegal move.
|
||||
illegalvehiclemove: Illegal vehicle move.
|
||||
net: # Relies on ProtocolLib to work
|
||||
attackfrequency: # Checks if a player is sending too many attack packets
|
||||
active: true
|
||||
limitforseconds:
|
||||
half: 9
|
||||
one: 14
|
||||
two: 39
|
||||
four: 55
|
||||
eight: 100
|
||||
actions: cancel vl>15 cancel log:attackfrequency:0:7:i vl>40 cmd:cccheatkick:0:2 cancel vl>55 cancel cmd:cheatkick:0:2 vl>70 cmd:ccheatkick:0:2 cancel
|
||||
flyingfrequency: # Checks if a player is spamming packets
|
||||
active: true
|
||||
seconds: 5
|
||||
packetspersecond: 60
|
||||
actions: cancel
|
||||
reduceredundant:
|
||||
active: true
|
||||
seconds: 3
|
||||
actions: cancel vl>2500 cmd:kickinvaliddata:0:2 cancel
|
||||
keepalivefrequency: # Checks if a player is using spamming packets to use regen or godmode, some false positives on join
|
||||
active: true
|
||||
actions: cancel vl>10 cancel log:keepalive:0:10:i vl>100 cancel cmd:kickalive:0:2
|
||||
packetfrequency: # Checks if a player is spamming packets
|
||||
active: default
|
||||
limitpersecond: 200
|
||||
seconds: 4
|
||||
actions: cancel cmd:kickpacketfrequency:0:2 vl>4 cmd:ccheatkick:0:5 cancel
|
||||
sounddistance: # Prevents players from abusing an exploit to use render hacks to see far away players during storms
|
||||
active: true
|
||||
maxdistance: 150
|
||||
superseded:
|
||||
flying:
|
||||
cancelwaiting: true
|
||||
strings: # Anything used in the actions of any checks can be defined here
|
||||
angle: '&c[player] &7could be using &6KillAura &7VL &c[violations] &7(Combat Hacks)'
|
||||
attackfrequency: '&c[player] &7could be using &6MultiAura &7VL &c[violations] &7(Combat Hacks)'
|
||||
ban: ban [player]
|
||||
ban-ip: ban-ip [ip]
|
||||
bautosign: '&c[player] &7could be using &6Auto Sign &7VL &c[violations]'
|
||||
bbfrequency: '&c[player] &7could be using &6Nuker &7VL &c[violations]'
|
||||
bdirection: '&c[player] &7failed &6Impossible Interact &7VL &c[violations]'
|
||||
bedleave: '&c[player] &7failed &6Bed Leave &7VL &c[violations]'
|
||||
bpspeed: '&c[player] &7could be using &6Fast Throw &7VL &c[violations]'
|
||||
breach: '&c[player] &7could be using &6Block Reach &7VL &c[violations]'
|
||||
bspeed: '&c[player] &7could be using &6Fast Interact &7VL &c[violations]'
|
||||
bvisible: '&c[player] &7could be using &6Block Cheats &7VL &c[violations] &7(Block out of reach)'
|
||||
bwrong: '&c[player] &7could be using &6Block Cheats &7VL &c[violations] &(Broke a different block than clicked)'
|
||||
captcha: '&c[player] &7could be using &6Spam Bots &7VL &c[violations]'
|
||||
chatnormal: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
color: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
commands: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
combspeed: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
critical: '&c[player] &7could be using &6Criticals &7VL &c[violations] &7(Combat Hacks)'
|
||||
drop: '&c[player] &7could be using &6Fast Drop &7VL &c[violations]'
|
||||
dropkick: ccmd [player] unless -time_online-<30 do /0/ kick [player] &cNCP &7» &cYou dropped too many items!
|
||||
fastbreak: '&c[player] &7could be using &6Fast Break &7VL &c[violations]'
|
||||
fastclick: '&c[player] &7could be using &6Fast Click &7VL &c[violations]'
|
||||
fastconsume: '&c[player] &7could be using &6Fast Eat &7VL &c[violations]'
|
||||
fastheal: '&c[player] &7could be using &6Regen &7VL &c[violations]'
|
||||
fastplace: '&c[player] &7could be using &6Fast Place &7VL &c[violations]'
|
||||
fdirection: '&c[player] &7could be using &6AimBot &7VL &c[violations] &7(Combat Hacks)'
|
||||
flyshort: ccmd [player] unless -time_online-<30|-uptime-<80 do ncp log stream notify &c[player] &7could be &6Speeding &7VL &c[violations]
|
||||
flylong: '&c[player] &7could be &6Flying &7VL &c[violations]'
|
||||
flyfile: '[player] failed [check]: tried to move: [locationfrom] -> [locationto], d=[distance] ([tags]). &7VL [violations].'
|
||||
freach: '&c[player] &7could be using &6Reach &7VL &c[violations]&7 (Combat Hacks)'
|
||||
fselfhit: '&c[player] &7could be using &6Self Hit &7VL &c[violations]&7 (Combat Hacks)'
|
||||
fspeed: '&c[player] &7could be using a &6Macro &7VL &c[violations]&7 (13+ CPS)'
|
||||
gutenberg: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
godmode: '&c[player] &7could be using &6God Mode &7VL &c[violations]'
|
||||
improbable: '&c[player] &7could be using &6KillAura&7 &7VL &c[violations] &7(Suspicious Activity)'
|
||||
instantbow: '&c[player] &7could be using &6Instant Bow &7VL &c[violations]'
|
||||
instanteat: '&c[player] &7could be using &6Instant Eat &7VL &c[violations]'
|
||||
keepalive: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
kick: kick [player]
|
||||
kickalive: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &cSent too many packets! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickattackfrequency: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickbedleave: kick [player] &cNCP &7» &cAbnormal Packets! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping & TPS Not checked)
|
||||
kickbspeed: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickcaptcha: kick [player] &cNCP &7» &cPlease enter the captcha
|
||||
kickchat1: ncp tempkick [player] 1 &cNCP &7» You're not allowed to spam!
|
||||
kickchat5: ncp tempkick [player] 5 &cNCP &7» You're not allowed to spam!
|
||||
kickchatfast: kick [player] &cNCP &7» &cYou're not allowed to spam!
|
||||
kickchatnormal: kick [player] &cNCP &7» &cYou sent too many messages!
|
||||
kickcommands: ncp tempkick [player] 1 &cNCP &7» You sent too many commands!
|
||||
kickfly: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30-time_online-<5 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickfrequency: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickgod: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickinvaliddata: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &cAbnormal Packets! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickpacketfrequency: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &cAbnormal Packets! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickpackets: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &cAbnormal Packets! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickselfhit: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
kickwb: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
knockback: '&c[player] &7could be using &6[check] &7VL &c[violations]&7.'
|
||||
morepackets: '&c[player] &7could be using &6Timer &7VL &c[violations]&7 (Too many packets)'
|
||||
msgtempdenylogin: You are temporarily denied to join this server.
|
||||
munchhausen: '&c[player] &7could be using &6[check] &7VL &c[violations]&7.'
|
||||
nofall: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
chatfast: c[player] &7could be using &6[check] &7VL &c[violations]&7.
|
||||
noswing: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
passable: '&c[player] &7could be using &6Phase &7VL &c[violations]'
|
||||
relog: '&c[player] &7relogged too fast &7VL &c[violations]&7.'
|
||||
tellchatnormal: ncp tell [player] Slow down in chat!
|
||||
tempkick1: ncp tempkick [player] Please wait 1 minute before logging in
|
||||
tempkick5: ncp tempkick [player] Please wait 5 minutes before logging in
|
||||
vehicleenvelope: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
cheatkick: ccmd [player] unless -ping->151|-tps-<19.2|-time_online-<30|-uptime-<80 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 151 - TPS > 19.2)
|
||||
ccheatkick: ccmd [player] unless -time_online-<30|-uptime-<80 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - High VL - Skipped Ping & TPS Check)
|
||||
cccheatkick: ccmd [player] unless -ping->90|-tps-<19.5|-time_online-<30|-uptime-<80 do /0/ kick [player] &cNCP &7» &rSuspicious Server Activity! /5/ ncp log stream notify?c+console?nc &c&lAUTOKICK:&r &7The player &c[player] &7has been kicked due to &6[check] &7(&7VL &c[violations]&7 - Ping < 90 - TPS > 19.5)
|
||||
highvlerror: '&7The player &c[player] &7caused the check &c[check] &7to go up very high to &6[violations]&7. Please investigate this issue.'
|
||||
compatibility:
|
||||
managelisteners: false
|
||||
exemptions:
|
||||
wildcard:
|
||||
default:
|
||||
metadata:
|
||||
active: true
|
||||
keys:
|
||||
- nocheat.exempt
|
||||
npc:
|
||||
active: true
|
||||
bukkitnpc: true
|
||||
metadata:
|
||||
active: true
|
||||
keys:
|
||||
- NPC
|
||||
- NCPConfigTracking
|
||||
remove:
|
||||
join: true
|
||||
leave: true
|
||||
server:
|
||||
cbdedicated:
|
||||
enable: true
|
||||
cbreflect:
|
||||
enable: true
|
||||
blocks: # Allows you to change the block check size to prevent glitching/false positives
|
||||
allowinstantbreak:
|
||||
- LONG_GRASS
|
||||
overrideflags:
|
||||
snow: default
|
||||
piston_moving_piece: default+ign_passable+ground_height
|
||||
WATER_LILY: default+ign_passable+ground_height+height8_1
|
||||
'60': default+ign_passable+ground_height+height8_1
|
||||
'208': solid+ground+height100+ground_height
|
||||
STEP: solid+ground+xz100+height100+ground_height+ign_passable
|
||||
changetracker:
|
||||
active: true
|
||||
pistons: true
|
||||
maxageticks: 80
|
||||
perworld:
|
||||
maxentries: 1000
|
||||
@@ -1,680 +0,0 @@
|
||||
# Custom NoCheatPlus Config
|
||||
# Version 3.2
|
||||
# Type: Notify Only
|
||||
# Config Developed by Captain_Obvious
|
||||
# Config support can be found here: https://goo.gl/Du4BpY
|
||||
# Reminder: You must be using the latest build of NoCheatPlus in order to run the config. Link: https://ci.md-5.net/job/NoCheatPlus/
|
||||
savebackconfig: true
|
||||
configversion:
|
||||
notify: false
|
||||
notifymaxpaths: 5
|
||||
created: 1104
|
||||
saved: 1104
|
||||
logging:
|
||||
active: true
|
||||
maxqueuesize: 5000
|
||||
extended:
|
||||
status: false
|
||||
commands:
|
||||
actions: false
|
||||
allviolations:
|
||||
debug: true
|
||||
debugonly: false
|
||||
backend:
|
||||
trace: false
|
||||
notify: false
|
||||
backend:
|
||||
console:
|
||||
active: true
|
||||
asynchronous: true
|
||||
file:
|
||||
active: false
|
||||
prefix: ''
|
||||
filename: nocheatplus.log
|
||||
ingamechat:
|
||||
active: true
|
||||
prefix: '&c&lNCP &7»&r '
|
||||
subscriptions: false
|
||||
data:
|
||||
expiration:
|
||||
active: true
|
||||
duration: 75
|
||||
history: false
|
||||
consistencychecks:
|
||||
active: true
|
||||
interval: 10
|
||||
maxtime: 2
|
||||
suppresswarnings: false
|
||||
protection:
|
||||
plugins:
|
||||
hide:
|
||||
active: true
|
||||
nopermission:
|
||||
message: '&c&lNCP &7» &rYou do not have permission to run this command.'
|
||||
commands:
|
||||
- '?'
|
||||
- plugins
|
||||
- version
|
||||
- icanhasbukkit
|
||||
- bukkit:help
|
||||
- bukkit:?
|
||||
- about
|
||||
unknowncommand:
|
||||
message: '&c&lNCP &7» &rThe server currently runs a custom &cNoCheatPlus Config &rVersion &c3.2'
|
||||
commands:
|
||||
- ncp
|
||||
commands:
|
||||
consoleonly:
|
||||
active: true
|
||||
message: '&c&lNCP &7» &rThis command could cause problems. Please execute in console if you wish to continue.'
|
||||
commands:
|
||||
- restart
|
||||
- stop
|
||||
- rl
|
||||
- reload
|
||||
clients:
|
||||
motd:
|
||||
active: true
|
||||
allowall: false
|
||||
checks:
|
||||
blockbreak:
|
||||
direction:
|
||||
active: true
|
||||
actions: cancel vl>10 log:notifylvlbb:0:8:i cancel vl>20 log:notifylvlcb:0:8:i cancel
|
||||
fastbreak:
|
||||
active: true
|
||||
strict: true
|
||||
delay: 95
|
||||
intervalsurvival: 100
|
||||
grace: 2000
|
||||
actions: cancel vl>1 log:notifylvlab:1:9:i cancel vl>3 log:notifylvlbb:1:8:i cancel vl>8 log:notifylvlcb:1:7:i cancel
|
||||
frequency:
|
||||
active: true
|
||||
intervalcreative: 95
|
||||
intervalsurvival: 49
|
||||
shortterm:
|
||||
ticks: 5
|
||||
limit: 6
|
||||
actions: cancel vl>2 log:notifylvlab:1:8:i cancel vl>4 log:notifylvlbb:1:7:i cancel vl>8 log:notifylvlcb:1:6:i cancel
|
||||
noswing:
|
||||
active: false
|
||||
actions: vl>20 log:notifylvla:0:12:i
|
||||
reach:
|
||||
active: true
|
||||
actions: cancel vl>5 log:notifylvlab:0:10:i cancel vl>8 log:notifylvlbb:0:8:i cancel vl>12 log:notifylvlcb:0:7:i cancel
|
||||
wrongblock:
|
||||
active: true
|
||||
level: 10
|
||||
actions: cancel vl>8 log:notifylvlab:0:8:i cancel vl>12 log:notifylvlbb:0:7:i cancel vl>18 log:notifylvlcb:0:6:i cancel
|
||||
blockinteract:
|
||||
direction:
|
||||
active: true
|
||||
actions: vl>5 cancel vl>24 log:notifylvlb:0:6:i cancel
|
||||
reach:
|
||||
active: true
|
||||
actions: cancel vl>5 log:notifylvlab:0:8:i cancel vl>8 log:notifylvlbb:0:7:i cancel vl>15 log:notifylvlcb:0:6:i cancel
|
||||
speed:
|
||||
active: true
|
||||
interval: 2000
|
||||
limit: 52
|
||||
actions: cancel vl>110 log:notifylvlab:0:8:i cancel vl>140 log:notifylvlbb:0:7:i cancel vl>195 log:notifylvlcb:0:6:i cancel
|
||||
visible:
|
||||
active: true
|
||||
actions: vl>4 cancel vl>35 log:notifylvlbb:0:9:i cancel
|
||||
blockplace:
|
||||
against:
|
||||
active: true
|
||||
actions: cancel
|
||||
autosign:
|
||||
active: true
|
||||
skipempty: false
|
||||
actions: cancel vl>2 log:notifylvlab:0:8:i cancel vl>4 log:notifylvlbb:0:7:i cancel vl>8 log:notifylvlcb:0:6:i cancel
|
||||
direction:
|
||||
active: true
|
||||
actions: cancel vl>7 log:notifylvlab:0:8:i cancel vl>13 log:notifylvlbb:0:7:i cancel vl>20 log:notifylvlcb:0:6:i cancel
|
||||
fastplace:
|
||||
active: true
|
||||
limit: 14
|
||||
shortterm:
|
||||
ticks: 12
|
||||
limit: 5
|
||||
actions: cancel vl>12 log:notifylvlab:1:8:i cancel vl>35 log:notifylvlbb:0:7:i cancel vl>75 log:notifylvlcb:0:6:i cancel
|
||||
reach:
|
||||
active: true
|
||||
actions: cancel vl>4 log:notifylvlab:0:7:i cancel vl>12 log:notifylvlbb:0:6:i cancel vl>18 log:notifylvlcb:0:6:i cancel
|
||||
noswing:
|
||||
active: false
|
||||
exceptions:
|
||||
- WATER_LILY
|
||||
- FLINT_AND_STEEL
|
||||
actions: cancel vl>10 log:noswing:0:7:i cancel
|
||||
speed:
|
||||
active: true
|
||||
interval: 70
|
||||
actions: cancel vl>140 log:notifylvlab:3:5:i cancel vl>180 log:notifylvlbb:1:6:i cancel vl>250 log:notifylvlcb:0:6:i cancel
|
||||
preventmisc:
|
||||
boatsanywhere: true
|
||||
chat:
|
||||
captcha:
|
||||
active: true
|
||||
skip:
|
||||
commands: false
|
||||
characters: abcdefghjkmnpqrtuvwxyzABCDEFGHJKMNPQRTUVWXYZ2346789
|
||||
length: 4
|
||||
question: '&c&lNCP &7»&r &cPlease type ''&6[captcha]&c'' to continue sending messages/commands.'
|
||||
success: '&c&lNCP &7»&r &aYou can keep chatting now'
|
||||
tries: 3
|
||||
actions: cancel cmd:kickcaptcha vl>4 log:captcha:2:5:i cancel cmd:kickcaptcha:0:2
|
||||
color:
|
||||
active: false
|
||||
actions: log:color:0:6:i cancel
|
||||
commands:
|
||||
active: true
|
||||
exclusions:
|
||||
- server
|
||||
- warps
|
||||
- f
|
||||
handleaschat:
|
||||
- /me
|
||||
- /msg
|
||||
- /emsg
|
||||
- /r
|
||||
- /reply
|
||||
- /pm
|
||||
- /epm
|
||||
- /whisper
|
||||
- /tell
|
||||
- /etell
|
||||
level: 8
|
||||
shortterm:
|
||||
ticks: 19
|
||||
level: 3
|
||||
actions: log:commands:0:5:i cancel cmd:kickcommands:0:2 vl>20 log:commands:0:5:i cancel cmd:tempkick1:0:2:i
|
||||
text:
|
||||
active: true
|
||||
allowvlreset: true
|
||||
frequency:
|
||||
normal:
|
||||
minimum: 0.0
|
||||
factor: 0.9
|
||||
weight: 6
|
||||
level: 135
|
||||
actions: cancel cmd:tellchatnormal vl>7 log:chatnormal:0:5:i cancel cmd:tellchatnormal:0:2 vl>20 log:chatnormal:0:5:i cancel cmd:kickchatnormal:0:2 vl>40 log:chatnormal:0:5:i cancel cmd:kickchat5:0:2
|
||||
shortterm:
|
||||
minimum: 2.0
|
||||
factor: 0.7
|
||||
weight: 3.0
|
||||
level: 18.0
|
||||
actions: log:chatfast:0:5:i cancel cmd:kickchatfast:0:6 vl>20 log:chatfast:0:5:i cancel cmd:kickchat1:0:2 vl>40 log:chatfast:0:5:i cancel cmd:kickchat5:0:2
|
||||
message:
|
||||
lettercount: 1.0
|
||||
partition: 1.0
|
||||
uppercase: 1.2
|
||||
afterjoin: 1.5
|
||||
nomoving: 1.5
|
||||
repeatviolation: 1.2
|
||||
repeatglobal: 1.0
|
||||
repeatself: 1.5
|
||||
words:
|
||||
lengthav: 1.0
|
||||
lengthmsg: 1.0
|
||||
noletter: 0.0
|
||||
global:
|
||||
active: true
|
||||
weight: 1.0
|
||||
words:
|
||||
active: false
|
||||
prefixes:
|
||||
active: false
|
||||
similarity:
|
||||
active: false
|
||||
player:
|
||||
active: true
|
||||
words:
|
||||
active: false
|
||||
prefixes:
|
||||
active: false
|
||||
similarity:
|
||||
active: false
|
||||
warning:
|
||||
active: true
|
||||
level: 71
|
||||
message: '&c&lNCP &7»&r &cSlow down in chat!'
|
||||
timeout: 10
|
||||
relog:
|
||||
active: true
|
||||
timeout: 3250
|
||||
warning:
|
||||
message: '&c&lNCP &7»&r &cYou relogged too fast!'
|
||||
number: 1
|
||||
timeout: 60000
|
||||
kickmessage: Too fast re-login, try with a little delay.
|
||||
actions: log:relog:0:15:i cancel vl>15 log:relog:0:10:i cancel cmd:tempkick5:0:2
|
||||
logins:
|
||||
active: true
|
||||
startupdelay: 600
|
||||
perworldcount: false
|
||||
seconds: 10
|
||||
limit: 7
|
||||
kickmessage: Too many players are logging in at a time! Try again later.
|
||||
combined:
|
||||
bedleave:
|
||||
active: true
|
||||
actions: cancel log:bedleave:0:7:i
|
||||
enderpearl:
|
||||
active: true
|
||||
preventclickblock: true
|
||||
improbable:
|
||||
active: true
|
||||
level: 198
|
||||
actions: cancel vl>2 log:notifylvla:0:6:i cancel vl>12 log:notifylvlb:0:6:i cancel vl>88 log:notifylvlc:0:6:i cancel
|
||||
invulnerable:
|
||||
active: true
|
||||
triggers:
|
||||
always: false
|
||||
falldistance: true
|
||||
initialticks:
|
||||
join: -1
|
||||
ignore:
|
||||
- FALL
|
||||
modifiers:
|
||||
all: 0
|
||||
munchhausen:
|
||||
active: false
|
||||
actions: cancel vl>100 cancel log:munchhausen:0:60:i
|
||||
yawrate:
|
||||
rate: 105
|
||||
penalty:
|
||||
factor: 1.0
|
||||
minimum: 250
|
||||
maximum: 2000
|
||||
improbable: true
|
||||
fight:
|
||||
canceldead: true
|
||||
toolchangepenalty: 150
|
||||
pvp:
|
||||
knockbackvelocity: default
|
||||
yawrate:
|
||||
active: true
|
||||
angle:
|
||||
active: true
|
||||
threshold: 55
|
||||
actions: cancel vl>135 log:notifylvlac:0:6:i cancel vl>170 log:notifylvlbc:0:6:i cancel vl>225 log:notifylvlcc:0:6:i cancel
|
||||
critical:
|
||||
active: true
|
||||
cancel:
|
||||
cancel: 125
|
||||
dividedamage: 0.08
|
||||
falldistance: 0.075
|
||||
actions: vl>2 cancel vl>16 log:notifylvlac:0:6:i cancel vl>22 log:notifylvlbc:0:6:i cancel vl>28 log:notifylvlcc:0:6:i cancel
|
||||
direction:
|
||||
active: true
|
||||
strict: false
|
||||
penalty: 160
|
||||
actions: vl>1 cancel vl>6 log:notifylvlac:0:6:i cancel vl>12 log:notifylvlbc:0:6:i cancel vl>18 log:notifylvlcc:0:6:i cancel
|
||||
fastheal:
|
||||
active: true
|
||||
interval: 4000
|
||||
buffer: 1000
|
||||
actions: cancel vl>10 cancel log:notifylvlac:0:10:i vl>15 log:notifylvlbc:0:9:i cancel vl>20 log:notifylvlcc:0:8:i cancel
|
||||
godmode:
|
||||
active: true
|
||||
minage: 1100
|
||||
maxage: 5000
|
||||
actions: log:notifylvlac:1:8:i cancel vl>10 log:notifylvlbc:0:7:i cancel vl>20 log:notifylvlcc:0:6:i cancel
|
||||
noswing:
|
||||
active: true
|
||||
actions: vl>1 cancel vl>6 log:notifylvlac:0:8:i cancel vl>12 log:notifylvlbc:0:7:i cancel vl>18 log:notifylvlcc:0:6:i cancel
|
||||
reach:
|
||||
active: true
|
||||
survivaldistance: 4.2
|
||||
penalty: 250
|
||||
reduce: true
|
||||
reducedistance: 0.9
|
||||
reducestep: 0.15
|
||||
actions: vl>1 cancel vl>3 log:notifylvlac:0:7:i cancel vl>6 log:notifylvlbc:0:6:i cancel vl>10 log:notifylvlcc:0:6:i cancel
|
||||
selfhit:
|
||||
active: true
|
||||
actions: log:fselfhit:1:8:i cancel
|
||||
speed:
|
||||
active: true
|
||||
limit: 13
|
||||
actions: cancel vl>8 log:notifylvlac:0:6:i cancel vl>12 log:notifylvlbc:0:6:i cancel vl>16 log:notifylvlcc:0:6:i cancel
|
||||
shortterm:
|
||||
ticks: 8
|
||||
limit: 6
|
||||
inventory:
|
||||
drop:
|
||||
active: true
|
||||
limit: 4
|
||||
timeframe: 15
|
||||
actions: log:drop:0:6:i cancel
|
||||
fastclick:
|
||||
active: true
|
||||
sparecreative: true
|
||||
tweaks1_5: true
|
||||
limit:
|
||||
shortterm: 3
|
||||
normal: 9
|
||||
actions: vl>3 cancel vl>75 log:notifylvla:3:8:i cancel vl>160 log:notifylvlb:1:7:i cancel vl>220 log:notifylvlc:1:6:i cancel
|
||||
instantbow:
|
||||
active: true
|
||||
strict: true
|
||||
delay: 129
|
||||
improbable:
|
||||
feedonly: false
|
||||
weight: 0.6
|
||||
actions: cancel vl>12 log:notifylvla:2:6:i cancel vl>16 log:notifylvlb:0:6:i cancel vl>20 log:notifylvlc:0:6:i cancel
|
||||
instanteat:
|
||||
active: true
|
||||
actions: log:instanteat:2:5:i cancel
|
||||
fastconsume:
|
||||
active: true
|
||||
duration: 0.67
|
||||
whitelist: false
|
||||
items: []
|
||||
actions: log:fastconsume:2:8:i cancel
|
||||
gutenberg:
|
||||
active: true
|
||||
actions: cancel log:gutenberg:0:10:i
|
||||
items:
|
||||
active: true
|
||||
open:
|
||||
active: true
|
||||
close: true
|
||||
cancelother: true
|
||||
hotfix:
|
||||
duplication:
|
||||
fallingblockendportal: true
|
||||
moving:
|
||||
creativefly:
|
||||
active: true
|
||||
ignoreallowflight: true
|
||||
ignorecreative: true
|
||||
model:
|
||||
creative:
|
||||
horizontal:
|
||||
speed: 114
|
||||
vertical:
|
||||
ascend:
|
||||
speed: 97
|
||||
maxheight: 128
|
||||
spectator:
|
||||
horizontal:
|
||||
speed: 450
|
||||
vertical:
|
||||
ascend:
|
||||
speed: 170
|
||||
maxheight: 128
|
||||
gravity: false
|
||||
ground: false
|
||||
levitation:
|
||||
horizontal:
|
||||
speed: 50
|
||||
vertical:
|
||||
ascend:
|
||||
speed: 10
|
||||
maxheight: 128
|
||||
gravity: false
|
||||
modifiers: false
|
||||
gravity: false
|
||||
ground: false
|
||||
elytra:
|
||||
horizontal:
|
||||
speed: 345
|
||||
modsprint: 1.0
|
||||
vertical:
|
||||
ascend:
|
||||
speed: 0
|
||||
maxheight: 128
|
||||
modifiers: false
|
||||
actions: vl>6 cancel vl>175 log:notifylvla:0:6:i cancel vl>325 log:notifylvlb:0:5:i cancel vl>680 log:notifylvlc:0:4:i cancel
|
||||
morepackets:
|
||||
active: true
|
||||
seconds: 6
|
||||
epsideal: 20
|
||||
epsmax: 22
|
||||
burst:
|
||||
packets: 20
|
||||
directviolation: 30
|
||||
epmviolation: 60
|
||||
setbackage: 40
|
||||
actions: vl>1 cancel vl>25 log:notifylvla:2:7:i cancel vl>40 log:notifylvlb:1:6:i cancel vl>70 log:notifylvlc:0:6:i cancel
|
||||
nofall:
|
||||
active: true
|
||||
dealdamage: true
|
||||
skipallowflight: true
|
||||
resetonviolation: false
|
||||
resetonteleport: false
|
||||
resetonvehicle: true
|
||||
anticriticals: true
|
||||
actions: log:nofall:0:5:i cancel
|
||||
passable:
|
||||
active: true
|
||||
actions: vl>3 cancel vl>25 log:notifylvla:1:7:i cancel vl>40 log:notifylvlb:0:6:i cancel vl>110 log:notifylvlc:0:6:i cancel
|
||||
untracked:
|
||||
teleport:
|
||||
active: true
|
||||
command:
|
||||
active: true
|
||||
tryteleport: true
|
||||
prefixes:
|
||||
- sethome
|
||||
- home set
|
||||
- setwarp
|
||||
- warp set
|
||||
- setback
|
||||
- set back
|
||||
- back set
|
||||
- spawn
|
||||
- hub
|
||||
- tpaccept
|
||||
- tphere
|
||||
- tpaccept
|
||||
- home
|
||||
- wild
|
||||
- randomtp
|
||||
- wildtp
|
||||
survivalfly:
|
||||
active: true
|
||||
extended:
|
||||
vertical-accounting: true
|
||||
stepheight: default
|
||||
hbufmax: 1.0
|
||||
setbackpolicy:
|
||||
falldamage: true
|
||||
voidtovoid: true
|
||||
actions: vl>45 cancel vl>150 log:notifylvla:1:7:i cancel vl>350 log:notifylvlb:0:6:i cancel vl>1360 log:notifylvlc:0:6:i cancel
|
||||
hover:
|
||||
active: true
|
||||
step: 5
|
||||
ticks: 85
|
||||
loginticks: 100
|
||||
falldamage: true
|
||||
sfviolation: 550
|
||||
velocity:
|
||||
activationcounter: 80
|
||||
activationticks: 140
|
||||
strictinvalidation: true
|
||||
splitmoves: default
|
||||
ignorestance: default
|
||||
tempkickillegal: true
|
||||
loadchunks:
|
||||
join: true
|
||||
move: true
|
||||
teleport: true
|
||||
worldchange: true
|
||||
sprintinggrace: 2.0
|
||||
assumesprint: true
|
||||
speedgrace: 4.0
|
||||
enforcelocation: default
|
||||
setback:
|
||||
method: default
|
||||
vehicle:
|
||||
preventdestroyown: true
|
||||
enforcelocation: default
|
||||
schedulesetbacks: default
|
||||
morepackets:
|
||||
active: true
|
||||
actions: cancel vl>12 log:morepackets:0:8:i cancel
|
||||
envelope:
|
||||
active: default
|
||||
actions: cancel vl>100 cancel log:vehicleenvelope:0:15:i
|
||||
message:
|
||||
illegalplayermove: Illegal move.
|
||||
illegalvehiclemove: Illegal vehicle move.
|
||||
net:
|
||||
attackfrequency:
|
||||
active: true
|
||||
limitforseconds:
|
||||
half: 9
|
||||
one: 14
|
||||
two: 39
|
||||
four: 55
|
||||
eight: 100
|
||||
actions: cancel vl>15 cancel log:notifylvlac:0:7:i vl>25 log:notifylvlbc:0:6:i cancel vl>40 log:notifylvlcc:0:6:i cancel
|
||||
flyingfrequency:
|
||||
active: true
|
||||
seconds: 5
|
||||
packetspersecond: 60
|
||||
actions: cancel
|
||||
reduceredundant:
|
||||
active: true
|
||||
seconds: 3
|
||||
actions: cancel
|
||||
keepalivefrequency:
|
||||
active: true
|
||||
actions: cancel vl>10 cancel log:keepalive:0:10:i
|
||||
packetfrequency:
|
||||
active: default
|
||||
limitpersecond: 200
|
||||
seconds: 4
|
||||
actions: cancel
|
||||
sounddistance:
|
||||
active: true
|
||||
maxdistance: 150
|
||||
superseded:
|
||||
flying:
|
||||
cancelwaiting: true
|
||||
strings:
|
||||
angle: '&c[player] &7could be using &6KillAura &7VL &6[violations] &7(Combat Hacks)'
|
||||
attackfrequency: '&c[player] &7could be using &6MultiAura &7VL &6[violations] &7(Combat Hacks)'
|
||||
ban: ban [player]
|
||||
ban-ip: ban-ip [ip]
|
||||
bautosign: '&c[player] &7could be using &6Auto Sign &7VL &6[violations]'
|
||||
bbfrequency: '&c[player] &7could be using &6Nuker &7VL &6[violations]'
|
||||
bdirection: '&c[player] &7failed &6ImpossibleInteract &7VL &6[violations]'
|
||||
bedleave: '&c[player] &7failed &6Bed Leave &7VL &6[violations]'
|
||||
bpspeed: '&c[player] &7could be using &6Fast Throw &7VL &6[violations]'
|
||||
breach: '&c[player] &7could be using &6Block Reach &7VL &6[violations]'
|
||||
bspeed: '&c[player] &7could be using &6Fast Interact &7VL &6[violations]'
|
||||
bvisible: '&c[player] &7could be using &6Block Cheats &7VL &6[violations] &7(Broke a block out of sight)'
|
||||
bwrong: '&c[player] &7could be using &6Wrong Block &7VL &6[violations] &7(Broke a block other than clicked)'
|
||||
captcha: '&c[player] &7could be using &6Spam Bots &7VL &6[violations]'
|
||||
chatnormal: '&c[player] &7could be using &6[check] &7VL &6[violations]'
|
||||
color: '&c[player] &7could be using &6[check] &7VL &6[violations]'
|
||||
commands: '&c[player] &7could be &6Spamming &7VL &6[violations]'
|
||||
combspeed: '&c[player] &7could be using &6[check] &7VL &6[violations]'
|
||||
critical: '&c[player] &7could be using &6Criticals &7VL &6[violations] &7(Combat Hacks)'
|
||||
drop: '&c[player] &7could be using &6Fast Drop &7VL &6[violations]'
|
||||
dropkick: kick [player] &cNCP &7»&r &cYou dropped too many items!
|
||||
fastbreak: '&c[player] &7could be using &6Fast Break &7VL &6[violations]'
|
||||
fastclick: '&c[player] &7could be using &6Fast Click &7VL &6[violations]'
|
||||
fastconsume: '&c[player] &7could be using &6Fast Eat &7VL &6[violations]'
|
||||
fastheal: '&c[player] &7could be using &6Regen &7VL &6[violations]'
|
||||
fastplace: '&c[player] &7could be using &6Fast Place &7VL &6[violations]'
|
||||
fdirection: '&c[player] &7could be using &6AimBot &7VL &6[violations]'
|
||||
flyshort: '&c[player] &7could be &6Speeding &7VL &6[violations]'
|
||||
flylong: '&c[player] &7could be &6Flying &7VL &6[violations]'
|
||||
flyfile: '[player] failed [check]: tried to move: [locationfrom] -> [locationto], d=[distance] ([tags]). &7VL [violations].'
|
||||
freach: '&c[player] &7could be using &6Reach &7VL &6[violations]&7 (Combat Hacks)'
|
||||
fselfhit: '&c[player] &7could be using &6Self Hit &7VL &6[violations]&7 (Combat Hacks)'
|
||||
fspeed: '&c[player] &7could be using a &6Macro &7VL &6[violations]&7 (13+ CPS)'
|
||||
gutenberg: '&c[player] &7could be using &6[check] &7VL &6[violations]'
|
||||
godmode: '&c[player] &7could be using &6God Mode &7VL &6[violations]'
|
||||
improbable: '&c[player] &7could be using &6KillAura &7VL &6[violations] &7(Suspicious Activity)'
|
||||
instantbow: '&c[player] &7could be using &6Instant Bow &7VL &6[violations]'
|
||||
instanteat: '&c[player] &7could be using &6Instant Eat &7VL &6[violations]'
|
||||
keepalive: '&c[player] &7could be using &6[check] &7VL &6[violations]'
|
||||
kick: kick [player]
|
||||
kickalive: kick [player] &cNCP &7»&r &cSent too many keep alive packets!
|
||||
kickattackfrequency: kick [player] &cNCP &7»&r &cToo many clicks!
|
||||
kickbedleave: kick [player] &cNCP &7»&r &cBed Leave Packets!
|
||||
kickbspeed: kick [player] &cNCP &7»&r &cInteracted too fast!
|
||||
kickcaptcha: kick [player] &cNCP &7»&r &cPlease enter the captcha
|
||||
kickchat1: ncp tempkick [player] 1 &cNCP &7»&r You're not allowed to spam!
|
||||
kickchat5: ncp tempkick [player] 5 &cNCP &7»&r You're not allowed to spam!
|
||||
kickchatfast: kick [player] &cNCP &7»&r &cYou're not allowed to spam!
|
||||
kickchatnormal: kick [player] &cNCP &7»&r &cYou sent too many messages!
|
||||
kickcommands: ncp tempkick [player] 1 &cNCP &7»&r You sent too many commands!
|
||||
kickfly: kick [player] &cNCP &7»&r &cYou were in the air too long!
|
||||
kickfrequency: kick [player] &cNCP &7»&r &cToo many clicks!
|
||||
kickgod: kick [player] &cNCP &7»&r &cGod Mode Detected!
|
||||
kickinvaliddata: kick [player] &cNCP &7»&r &cYou sent Invalid Data!
|
||||
kickpacketfrequency: kick [player] &cNCP &7»&r &cToo many packets.
|
||||
kickpackets: kick [player] &cNCP &7»&r &cToo many packets sent!
|
||||
kickselfhit: kick [player] &cNCP &7»&r &cYou hit yourself!
|
||||
kickwb: kick [player] &cNCP &7»&r &cHitting blocks out of sync!
|
||||
knockback: '&c[player] &7could be using &6[check] &7VL &6[violations]&'
|
||||
morepackets: '&c[player] &7could be using &6Timer &7VL &6[violations]&7 (Too many packets)'
|
||||
msgtempdenylogin: You are temporarily denied to join this server.
|
||||
munchhausen: '&c[player] &7could be using &6[check] &7VL &6[violations]&7'
|
||||
nofall: '&c[player] &7failed &6[check] &7VL &6[violations]'
|
||||
chatfast: '&c[player] &7could be using &6[check] &7VL &6[violations]'
|
||||
noswing: '&c[player] &7could be using &6[check] &7VL &6[violations]'
|
||||
passable: '&c[player] &7could be using &6Phase &7VL &6[violations]'
|
||||
relog: '&c[player] &7relogged too fast &7VL &6[violations]'
|
||||
tellchatnormal: ncp tell [player] Slow down in chat!
|
||||
tempkick1: ncp tempkick [player] Please wait 1 minute before logging in
|
||||
tempkick5: ncp tempkick [player] Please wait 5 minutes before logging in
|
||||
vehicleenvelope: '&c[player] &7could be using &6[check] &7VL &6[violations]'
|
||||
notifylvla: '&c[player] &7could be using &6[check] &7VL &a[violations]'
|
||||
notifylvlb: '&c[player] &7could be using &6[check] &7VL &6[violations]'
|
||||
notifylvlc: '&c[player] &7could be using &6[check] &7VL &c[violations]'
|
||||
notifylvlab: '&c[player] &7could be using &6[check] &7VL &a[violations] &7(Block Cheats)'
|
||||
notifylvlbb: '&c[player] &7could be using &6[check] &7VL &6[violations] &7(Block Cheats)'
|
||||
notifylvlcb: '&c[player] &7could be using &6[check] &7VL &c[violations] &7(Block Cheats)'
|
||||
notifylvlac: '&c[player] &7could be using &6[check] &7VL &a[violations] &7(Combat Hacks)'
|
||||
notifylvlbc: '&c[player] &7could be using &6[check] &7VL &6[violations] &7(Combat Hacks)'
|
||||
notifylvlcc: '&c[player] &7could be using &6[check] &7VL &c[violations] &7(Combat Hacks)'
|
||||
compatibility:
|
||||
managelisteners: false
|
||||
exemptions:
|
||||
wildcard:
|
||||
default:
|
||||
metadata:
|
||||
active: true
|
||||
keys:
|
||||
- nocheat.exempt
|
||||
npc:
|
||||
active: true
|
||||
bukkitnpc: true
|
||||
metadata:
|
||||
active: true
|
||||
keys:
|
||||
- NPC
|
||||
- NCPConfigTracking
|
||||
remove:
|
||||
join: true
|
||||
leave: true
|
||||
server:
|
||||
cbdedicated:
|
||||
enable: true
|
||||
cbreflect:
|
||||
enable: true
|
||||
blocks:
|
||||
allowinstantbreak:
|
||||
- LONG_GRASS
|
||||
overrideflags:
|
||||
snow: default
|
||||
piston_moving_piece: default+ign_passable+ground_height
|
||||
WATER_LILY: default+ign_passable+ground_height+height8_1
|
||||
'60': default+ign_passable+ground_height+height8_1
|
||||
'208': solid+ground+height100+ground_height
|
||||
STEP: solid+ground+xz100+height100+ground_height+ign_passable
|
||||
changetracker:
|
||||
active: true
|
||||
pistons: true
|
||||
maxageticks: 80
|
||||
perworld:
|
||||
maxentries: 1000
|
||||
+33
-44
@@ -1,51 +1,40 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpbuildbase</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>NCPBuildBase</name>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.8.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<description>Very basic dependencies that have to be built before commons, no use of Bukkit.
|
||||
</description>
|
||||
<artifactId>ncpbuildbase</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>.</targetPath>
|
||||
<filtering>true</filtering>
|
||||
<directory>../NCPBuildBase/src/main/resources</directory>
|
||||
<includes>
|
||||
<include>BuildParameters.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<name>NCPBuildBase</name>
|
||||
<description>Very basic dependencies that have to be built before commons, no use of Bukkit.</description>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.8.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</build>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>.</targetPath>
|
||||
<filtering>true</filtering>
|
||||
<directory>../NCPBuildBase/src/main/resources</directory>
|
||||
<includes>
|
||||
<include>BuildParameters.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
+27
-39
@@ -1,44 +1,32 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcommons</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>NCPCommons</name>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.8.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpbuildbase</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<description>Common data structures and other, no use of Bukkit.
|
||||
</description>
|
||||
<artifactId>ncpcommons</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<name>NCPCommons</name>
|
||||
<description>Common data structures and other, no use of Bukkit.</description>
|
||||
|
||||
</project>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpbuildbase</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.8.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
+11
-9
@@ -40,10 +40,10 @@ public abstract class AbstractLogNodeDispatcher implements LogNodeDispatcher { /
|
||||
protected int maxQueueSize = 5000;
|
||||
|
||||
/**
|
||||
* Task id, -1 means the asynchronous task is not running. Synchronize over
|
||||
* Task id, null means the asynchronous task is not running. Synchronize over
|
||||
* queueAsynchronous. Must be maintained.
|
||||
*/
|
||||
protected int taskAsynchronousID = -1;
|
||||
protected Object taskAsynchronousID = null;
|
||||
/**
|
||||
* Optional implementation for an asynchronous task, using the
|
||||
* taskAsynchronousID, synchronized over queueAsynchronous.
|
||||
@@ -57,7 +57,7 @@ public abstract class AbstractLogNodeDispatcher implements LogNodeDispatcher { /
|
||||
while (i < 3) {
|
||||
if (runLogsAsynchronous()) {
|
||||
i = 0;
|
||||
if (taskAsynchronousID == -1) {
|
||||
if (!isTaskScheduled(taskAsynchronousID)) {
|
||||
// Shutdown, hard return;
|
||||
return;
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public abstract class AbstractLogNodeDispatcher implements LogNodeDispatcher { /
|
||||
} catch (InterruptedException e) {
|
||||
synchronized (queueAsynchronous) {
|
||||
// Ensure re-scheduling can happen.
|
||||
taskAsynchronousID = -1;
|
||||
taskAsynchronousID = null;
|
||||
}
|
||||
// TODO: throw?
|
||||
return;
|
||||
@@ -79,7 +79,7 @@ public abstract class AbstractLogNodeDispatcher implements LogNodeDispatcher { /
|
||||
if (queueAsynchronous.isEmpty()) {
|
||||
if (i >= 3) {
|
||||
// Ensure re-scheduling can happen.
|
||||
taskAsynchronousID = -1;
|
||||
taskAsynchronousID = null;
|
||||
}
|
||||
} else {
|
||||
i = 0;
|
||||
@@ -134,10 +134,10 @@ public abstract class AbstractLogNodeDispatcher implements LogNodeDispatcher { /
|
||||
|
||||
// Cancel task.
|
||||
synchronized (queueAsynchronous) {
|
||||
if (taskAsynchronousID != -1) {
|
||||
if (isTaskScheduled(taskAsynchronousID)) {
|
||||
// TODO: Allow queues to set to "no more input" ?
|
||||
cancelTask(taskAsynchronousID);
|
||||
taskAsynchronousID = -1;
|
||||
taskAsynchronousID = null;
|
||||
} else {
|
||||
// No need to wait.
|
||||
ms = 0L;
|
||||
@@ -184,7 +184,7 @@ public abstract class AbstractLogNodeDispatcher implements LogNodeDispatcher { /
|
||||
if (queueAsynchronous.add(record) > maxQueueSize) {
|
||||
reduceQueue(queueAsynchronous);
|
||||
}
|
||||
if (taskAsynchronousID == -1) { // Works, due to add being synchronized (not sure it's really better than full sync).
|
||||
if (!isTaskScheduled(taskAsynchronousID)) { // Works, due to add being synchronized (not sure it's really better than full sync).
|
||||
scheduleAsynchronous();
|
||||
}
|
||||
break;
|
||||
@@ -242,6 +242,8 @@ public abstract class AbstractLogNodeDispatcher implements LogNodeDispatcher { /
|
||||
|
||||
protected abstract void scheduleAsynchronous();
|
||||
|
||||
protected abstract void cancelTask(int taskId);
|
||||
protected abstract void cancelTask(Object taskInfo);
|
||||
|
||||
protected abstract boolean isTaskScheduled(Object taskInfo);
|
||||
|
||||
}
|
||||
@@ -43,5 +43,15 @@ public class Misc {
|
||||
}
|
||||
list.add(0, item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Flooring method copied from the BukkitAPI (locToBlock)
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
public static int floor(double num) {
|
||||
final int floor = (int) num;
|
||||
return floor == num ? floor : floor - (int) (Double.doubleToRawLongBits(num) >>> 63);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,12 +32,19 @@ public class StringUtil {
|
||||
|
||||
/** Decimal format for "#.###" */
|
||||
public static final DecimalFormat fdec3 = new DecimalFormat();
|
||||
/** Decimal format for "#.#" */
|
||||
/** Decimal format for "#.######" */
|
||||
public static final DecimalFormat fdec1 = new DecimalFormat();
|
||||
public static final DecimalFormat fdec6 = new DecimalFormat();
|
||||
|
||||
static {
|
||||
DecimalFormatSymbols sym = fdec6.getDecimalFormatSymbols();
|
||||
// 6 digits
|
||||
sym.setDecimalSeparator('.');
|
||||
fdec6.setDecimalFormatSymbols(sym);
|
||||
fdec6.setMaximumFractionDigits(6);
|
||||
fdec6.setMinimumIntegerDigits(1);
|
||||
// 3 digits.
|
||||
DecimalFormatSymbols sym = fdec3.getDecimalFormatSymbols();
|
||||
sym = fdec6.getDecimalFormatSymbols();
|
||||
sym.setDecimalSeparator('.');
|
||||
fdec3.setDecimalFormatSymbols(sym);
|
||||
fdec3.setMaximumFractionDigits(3);
|
||||
@@ -401,7 +408,7 @@ public class StringUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* Format to maximally 3 digits after the comma, always show the sign,
|
||||
* Format to maximally 6 digits after the comma, always show the sign,
|
||||
* unless equal.
|
||||
*
|
||||
* @param current
|
||||
@@ -409,7 +416,7 @@ public class StringUtil {
|
||||
* @return
|
||||
*/
|
||||
public static String formatDiff(final double current, final double previous) {
|
||||
return current == previous ? "0" : ((current > previous ? "+" : "-") + fdec3.format(Math.abs(current - previous)));
|
||||
return current == previous ? "0" : ((current > previous ? "+" : "-") + fdec6.format(Math.abs(current - previous)));
|
||||
}
|
||||
|
||||
public static boolean startsWithAnyOf(final String input, final String... startsWith) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package fr.neatmonster.nocheatplus.utilities;
|
||||
|
||||
/**
|
||||
* Simple parameter/thing validation.
|
||||
* Simple parameter/thing for recurring validation.
|
||||
*
|
||||
* @author asofold
|
||||
*
|
||||
@@ -36,5 +36,26 @@ public class Validate {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validates that the given double array's length: is a multiple of 6, does contain at least 1 bounding box and is not null.
|
||||
*
|
||||
* <p>Currently, this is rather meant to validate double arrays containing multiple bounding boxes, each defined by six consecutive elements
|
||||
* [minX, minY, minZ, maxX, maxY, maxZ].<br>
|
||||
*
|
||||
* @param array The double array to validate.
|
||||
*
|
||||
* @throws IllegalArgumentException If the array length is not a multiple of 6, null or empty.
|
||||
*/
|
||||
public static void validateAABB(final double[] array) {
|
||||
if (array == null) {
|
||||
throw new NullPointerException("The array is null.");
|
||||
}
|
||||
if (array.length == 0) {
|
||||
throw new IllegalArgumentException("The array is empty.");
|
||||
}
|
||||
if (array.length % 6 != 0) {
|
||||
throw new IllegalArgumentException("Array length is not a multiple of 6. Actual length: " + array.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
-1
@@ -16,7 +16,6 @@ package fr.neatmonster.nocheatplus.utilities.ds.bktree;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.bktree.BKModTree.LookupEntry;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.bktree.SimpleTimedBKLevenshtein.STBKLResult;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.bktree.TimedBKLevenshtein.SimpleTimedLevenNode;
|
||||
|
||||
|
||||
+146
-92
@@ -17,99 +17,153 @@ package fr.neatmonster.nocheatplus.utilities.ds.count;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
|
||||
/**
|
||||
* This class is meant to accumulate actions similar to ActionFrequency. In contrast to ActionFrequency, this class will accumulate values grouped by number of events instead of real-time intervals.
|
||||
* @author mc_dev
|
||||
* This class is meant to accumulate actions similar to ActionFrequency.
|
||||
* In contrast to ActionFrequency, this class will accumulate values grouped by number of events instead of real-time intervals.
|
||||
* @author asofold
|
||||
*
|
||||
*/
|
||||
public class ActionAccumulator {
|
||||
/** Event count. */
|
||||
private final int[] counts;
|
||||
/** Value accumulation. */
|
||||
private final float[] buckets;
|
||||
/** Capacity of each bucket. */
|
||||
private final int bucketCapacity;
|
||||
|
||||
public ActionAccumulator(final int nBuckets, final int bucketCapacity){
|
||||
this.counts = new int[nBuckets];
|
||||
this.buckets = new float[nBuckets];
|
||||
this.bucketCapacity = bucketCapacity;
|
||||
}
|
||||
|
||||
public void add(float value){
|
||||
if (counts[0] >= bucketCapacity){
|
||||
shift();
|
||||
}
|
||||
counts[0] ++;
|
||||
buckets[0] += value;
|
||||
}
|
||||
|
||||
private void shift() {
|
||||
for (int i = buckets.length - 1; i > 0 ; i--){
|
||||
counts[i] = counts[i - 1];
|
||||
buckets[i] = buckets[i - 1];
|
||||
}
|
||||
counts[0] = 0;
|
||||
buckets[0] = 0;
|
||||
}
|
||||
/** Counter of added events for each bucket. */
|
||||
private final int[] valueCounter;
|
||||
/** Value accumulation (sum). */
|
||||
private final float[] buckets;
|
||||
/** How many events can a bucket hold. */
|
||||
private final int bucketCapacity;
|
||||
|
||||
/**
|
||||
* Create a new ActionAccumulator instance
|
||||
*
|
||||
* @param nBuckets Number of buckets to hold values with
|
||||
* @param bucketCapacity How many events can a bucket hold
|
||||
*/
|
||||
public ActionAccumulator(final int nBuckets, final int bucketCapacity) {
|
||||
this.valueCounter = new int[nBuckets];
|
||||
this.buckets = new float[nBuckets];
|
||||
this.bucketCapacity = bucketCapacity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add value to accumulation (starting to the first bucket, shifting into the other ones if present)
|
||||
* See shift()
|
||||
*/
|
||||
public void add(float value) {
|
||||
if (valueCounter[0] >= bucketCapacity) {
|
||||
// First bucket is full, shift data into the next one .
|
||||
shift();
|
||||
}
|
||||
// Each time a value is added, the event counter for this bucket increases.
|
||||
valueCounter[0]++ ;
|
||||
// Accumulate the value
|
||||
buckets[0] += value;
|
||||
}
|
||||
|
||||
/**
|
||||
* On reaching the maximum capacity of the first bucket,
|
||||
* shift data into the next one and empty the first (which will be ready to accumulate values again).
|
||||
*/
|
||||
private void shift() {
|
||||
// Start from the last bucket and decrease
|
||||
for (int bucketIndex = buckets.length - 1; bucketIndex > 0; bucketIndex--) {
|
||||
// Shift counted events to the next bucket
|
||||
valueCounter[bucketIndex] = valueCounter[bucketIndex - 1];
|
||||
// Shift accumulated values to the next bucket
|
||||
buckets[bucketIndex] = buckets[bucketIndex - 1];
|
||||
}
|
||||
// Reset event counter of the first bucket
|
||||
valueCounter[0] = 0;
|
||||
// Empty the bucket (accumulated values)
|
||||
buckets[0] = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total score.
|
||||
* @return
|
||||
*/
|
||||
public float score(){
|
||||
float score = 0;
|
||||
for (int i = 0; i < buckets.length; i++){
|
||||
score += buckets[i];
|
||||
}
|
||||
return score;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total count.
|
||||
* @return
|
||||
*/
|
||||
public int count(){
|
||||
int count = 0;
|
||||
for (int i = 0; i < counts.length; i++){
|
||||
count += counts[i];
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public void clear(){
|
||||
for (int i = 0; i < buckets.length; i++){
|
||||
counts[i] = 0;
|
||||
buckets[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public int bucketCount(final int bucket){
|
||||
return counts[bucket];
|
||||
}
|
||||
|
||||
public float bucketScore(final int bucket){
|
||||
return buckets[bucket];
|
||||
}
|
||||
|
||||
public int numberOfBuckets(){
|
||||
return buckets.length;
|
||||
}
|
||||
|
||||
public int bucketCapacity(){
|
||||
return bucketCapacity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple display of bucket contents, no class name.
|
||||
* @return
|
||||
*/
|
||||
public String toInformalString(){
|
||||
StringBuilder b = new StringBuilder(buckets.length * 10);
|
||||
b.append("|");
|
||||
for (int i = 0; i < buckets.length; i++){
|
||||
b.append(StringUtil.fdec3.format(buckets[i]) + "/" + counts[i] + "|");
|
||||
}
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Get the total accumulation value of this accumulator (values of all buckets)
|
||||
*/
|
||||
public float score() {
|
||||
float score = 0;
|
||||
for (int i = 0; i < buckets.length; i++) {
|
||||
score += buckets[i];
|
||||
}
|
||||
return score;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the total events of the whole accumulator (of all buckets)
|
||||
*/
|
||||
public int count() {
|
||||
int globalCounter = 0;
|
||||
for (int i = 0; i < valueCounter.length; i++) {
|
||||
globalCounter += valueCounter[i];
|
||||
}
|
||||
return globalCounter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset all
|
||||
*/
|
||||
public void clear() {
|
||||
for (int i = 0; i < buckets.length; i++) {
|
||||
valueCounter[i] = 0;
|
||||
buckets[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the events counted for this bucket
|
||||
* @param bucket
|
||||
* @return how many events have been added(counted) to the bucket
|
||||
*/
|
||||
public int bucketCount(final int bucket) {
|
||||
return valueCounter[bucket];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the accumulation value of this bucket (sum of all values added to this bucket)
|
||||
* @param bucket
|
||||
* @return accumulation value of this bucket
|
||||
*/
|
||||
public float bucketScore(final int bucket) {
|
||||
return buckets[bucket];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the mean of this bucket
|
||||
* @param bucket
|
||||
* @return the mean of this bucket
|
||||
*/
|
||||
public float mean(final int bucket) {
|
||||
return bucketScore(bucket) / bucketCount(bucket);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the mean of the whole accumulator
|
||||
*/
|
||||
public float mean() {
|
||||
return score() / count();
|
||||
}
|
||||
|
||||
/**
|
||||
* How many buckets does the ActionAccumulator instance have
|
||||
*/
|
||||
public int numberOfBuckets() {
|
||||
return buckets.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* How many events(count) can each bucket of the ActionAccumulator instance have
|
||||
*/
|
||||
public int bucketCapacity() {
|
||||
return bucketCapacity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple display of bucket contents, no class name.
|
||||
*/
|
||||
public String toInformalString() {
|
||||
StringBuilder b = new StringBuilder(buckets.length * 10);
|
||||
b.append("|");
|
||||
for (int i = 0; i < buckets.length; i++){
|
||||
b.append(StringUtil.fdec3.format(buckets[i]) + "/" + valueCounter[i] + "|");
|
||||
}
|
||||
return b.toString();
|
||||
}
|
||||
}
|
||||
-18
@@ -139,24 +139,6 @@ public class ActionFrequency {
|
||||
time = lastUpdate = now;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use instead: score(float).
|
||||
* @param factor
|
||||
* @return
|
||||
*/
|
||||
public final float getScore(final float factor) {
|
||||
return score(factor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use instead: score(float).
|
||||
* @param factor
|
||||
* @return
|
||||
*/
|
||||
public final float getScore(final int bucket) {
|
||||
return bucketScore(bucket);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a weighted sum score, weight for bucket i: w(i) = factor^i.
|
||||
* @param factor
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.utilities.ds.map;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.Misc;
|
||||
|
||||
public class BlockCoord {
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int z;
|
||||
|
||||
/**
|
||||
* Constructs a BlockCoord with integer coordinates.
|
||||
*
|
||||
* @param x The x-coordinate.
|
||||
* @param y The y-coordinate.
|
||||
* @param z The z-coordinate.
|
||||
*/
|
||||
public BlockCoord(int x, int y, int z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a BlockCoord from double coordinates by converting them
|
||||
* to block integer coordinates using the same method as Bukkit's Location#locToBlock().
|
||||
*
|
||||
* @param x The x-coordinate.
|
||||
* @param y The y-coordinate.
|
||||
* @param z The z-coordinate.
|
||||
*/
|
||||
public BlockCoord(double x, double y, double z) {
|
||||
this.x = Misc.floor(x);
|
||||
this.y = Misc.floor(y);
|
||||
this.z = Misc.floor(z);
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public int getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return CoordHash.hashCode3DPrimes(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
if (obj == null || getClass() != obj.getClass()) return false;
|
||||
BlockCoord bc = (BlockCoord) obj;
|
||||
return bc.getX() == x && bc.getY() == y && bc.getZ() == z;
|
||||
}
|
||||
}
|
||||
-1
@@ -14,7 +14,6 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.utilities.ds.prefixtree;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.prefixtree.CharPrefixTree.CharLookupEntry;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.prefixtree.CharPrefixTree.SimpleCharNode;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.prefixtree.SimpleCharPrefixTree.SimpleCharLookupEntry;
|
||||
|
||||
|
||||
-1
@@ -14,7 +14,6 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.utilities.ds.prefixtree;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.prefixtree.PrefixTree.LookupEntry;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.prefixtree.PrefixTree.SimpleNode;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.prefixtree.SimplePrefixTree.SimpleLookupEntry;
|
||||
|
||||
|
||||
-1
@@ -16,7 +16,6 @@ package fr.neatmonster.nocheatplus.utilities.ds.prefixtree;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.prefixtree.SimpleTimedCharPrefixTree.SimpleTimedCharLookupEntry;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.prefixtree.TimedCharPrefixTree.SimpleTimedCharNode;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.prefixtree.TimedCharPrefixTree.TimedCharLookupEntry;
|
||||
|
||||
public class SimpleTimedCharPrefixTree extends TimedCharPrefixTree<SimpleTimedCharNode, SimpleTimedCharLookupEntry> {
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.SplittableRandom;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -30,8 +30,8 @@ import fr.neatmonster.nocheatplus.utilities.build.BuildParameters;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.map.CoordHashMap;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.map.CoordMap;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.map.CoordMap.Entry;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.map.LinkedCoordHashMap.MoveOrder;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.map.LinkedCoordHashMap;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.map.LinkedCoordHashMap.MoveOrder;
|
||||
|
||||
public class TestCoordMap {
|
||||
|
||||
@@ -74,7 +74,7 @@ public class TestCoordMap {
|
||||
private final boolean extraTesting = BuildParameters.testLevel > 0;
|
||||
private final int suggestedSamples = extraTesting ? 40000 : 1250;
|
||||
|
||||
public int[][] getRandomCoords(int n, int max, Random random) {
|
||||
private static int[][] getRandomCoords(int n, int max, SplittableRandom random) {
|
||||
final int [][] coords = new int[n][3];
|
||||
for (int i = 0; i < n; i++){
|
||||
for (int j = 0; j < 3 ; j++){
|
||||
@@ -84,7 +84,7 @@ public class TestCoordMap {
|
||||
return coords;
|
||||
}
|
||||
|
||||
public int[][] getUniqueRandomCoords(int n, int max, Random random) {
|
||||
private static int[][] getUniqueRandomCoords(int n, int max, SplittableRandom random) {
|
||||
Set<Pos> present = new HashSet<Pos>();
|
||||
int failures = 0;
|
||||
final int [][] coords = new int[n][3];
|
||||
@@ -311,7 +311,7 @@ public class TestCoordMap {
|
||||
@Test
|
||||
public void testIntegrity() {
|
||||
|
||||
final Random random = new Random(System.nanoTime() - (System.currentTimeMillis() % 2 == 1 ? 37 : 137));
|
||||
final SplittableRandom random = new SplittableRandom();
|
||||
|
||||
final int n = suggestedSamples; // Number of coordinates.
|
||||
final int max = 800; // Coordinate maximum.
|
||||
@@ -333,7 +333,7 @@ public class TestCoordMap {
|
||||
@Test
|
||||
public void testLinkedCoordHashMap() {
|
||||
|
||||
final Random random = new Random(System.nanoTime() - (System.currentTimeMillis() % 2 == 1 ? 37 : 137));
|
||||
final SplittableRandom random = new SplittableRandom();
|
||||
|
||||
final int n = suggestedSamples; // Number of coordinates.
|
||||
final int max = 800; // Coordinate maximum.
|
||||
|
||||
+26
-40
@@ -1,47 +1,33 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatbukkit</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>NCPCompatBukkit</name>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcore</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<artifactId>ncpcompatbukkit</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
|
||||
<description>Compatibility for using the Bukkit API only.
|
||||
</description>
|
||||
<name>NCPCompatBukkit</name>
|
||||
<description>Compatibility for using the Bukkit API only.</description>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.21.4-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcore</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
-169
@@ -1,169 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.checks.inventory;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerItemConsumeEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.actions.ParameterName;
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.ViolationData;
|
||||
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeHealth;
|
||||
import fr.neatmonster.nocheatplus.components.config.value.OverrideType;
|
||||
import fr.neatmonster.nocheatplus.components.registry.feature.INotifyReload;
|
||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.stats.Counters;
|
||||
import fr.neatmonster.nocheatplus.utilities.InventoryUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.TickTask;
|
||||
|
||||
/**
|
||||
* Quick replacement for InstantEat, partly reusing InstantEat data.<br>
|
||||
* This check is added by fr.neatmonster.nocheatplus.compat.DefaultComponentFactory.
|
||||
* @author mc_dev
|
||||
*
|
||||
*/
|
||||
public class FastConsume extends Check implements Listener, INotifyReload {
|
||||
|
||||
public static void testAvailability(){
|
||||
if (!PlayerItemConsumeEvent.class.getSimpleName().equals("PlayerItemConsumeEvent")){
|
||||
throw new RuntimeException("This exception should not even get thrown.");
|
||||
}
|
||||
}
|
||||
|
||||
private final Counters counters = NCPAPIProvider.getNoCheatPlusAPI().getGenericInstance(Counters.class);
|
||||
private final int idCancelDead = counters.registerKey("cancel.dead");
|
||||
|
||||
public FastConsume() {
|
||||
super(CheckType.INVENTORY_FASTCONSUME);
|
||||
// Overrides the instant-eat check.
|
||||
disableInstantEat();
|
||||
}
|
||||
|
||||
private void disableInstantEat() {
|
||||
// TODO: Do this kind of thing via registries later on.
|
||||
//ConfigManager.setForAllConfigs(ConfPaths.INVENTORY_INSTANTEAT_CHECK, false);
|
||||
NCPAPIProvider.getNoCheatPlusAPI().getWorldDataManager().overrideCheckActivation(
|
||||
CheckType.INVENTORY_INSTANTEAT, AlmostBoolean.NO,
|
||||
OverrideType.PERMANENT, true);
|
||||
StaticLog.logInfo("Inventory checks: FastConsume is available, disabled InstantEat.");
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onItemConsume(final PlayerItemConsumeEvent event){
|
||||
final Player player = event.getPlayer();
|
||||
if (player.isDead() && BridgeHealth.getHealth(player) <= 0.0) {
|
||||
// Eat after death.
|
||||
event.setCancelled(true);
|
||||
counters.addPrimaryThread(idCancelDead, 1);
|
||||
return;
|
||||
}
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
if (!pData.isCheckActive(type, player)) {
|
||||
return;
|
||||
}
|
||||
final InventoryData data = pData.getGenericInstance(InventoryData.class);
|
||||
final long time = System.currentTimeMillis();
|
||||
if (check(player, event.getItem(), time, data, pData)){
|
||||
event.setCancelled(true);
|
||||
DataManager.getPlayerData(player).requestUpdateInventory();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean check(final Player player, final ItemStack stack,
|
||||
final long time, final InventoryData data, final IPlayerData pData){
|
||||
// Uses the instant-eat data for convenience.
|
||||
// Consistency checks...
|
||||
if (stack == null){ // || stack.getType() != data.instantEatFood){
|
||||
// TODO: Strict version should prevent other material (?).
|
||||
return false;
|
||||
}
|
||||
final long ref = data.instantEatInteract == 0 ? 0 : Math.max(data.instantEatInteract, data.lastClickTime);
|
||||
if (time < ref){
|
||||
// Time ran backwards.
|
||||
data.instantEatInteract = data.lastClickTime = time;
|
||||
return false;
|
||||
}
|
||||
// Check exceptions.
|
||||
final InventoryConfig cc = pData.getGenericInstance(InventoryConfig.class);
|
||||
final Material mat = stack == null ? null : stack.getType();
|
||||
if (mat != null){
|
||||
if (cc.fastConsumeWhitelist){
|
||||
if (!cc.fastConsumeItems.contains(mat)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (cc.fastConsumeItems.contains(mat)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Actually check.
|
||||
final long timeSpent = ref == 0 ? 0 : (time - ref); // Not interact = instant.
|
||||
final long expectedDuration = cc.fastConsumeDuration;
|
||||
boolean cancel = false;
|
||||
if (timeSpent < expectedDuration){
|
||||
// TODO: Might have to do a specialized check for lag spikes here instead.
|
||||
final float lag = TickTask.getLag(expectedDuration, true);
|
||||
if (timeSpent * lag < expectedDuration){
|
||||
final double difference = (expectedDuration - timeSpent * lag) / 100.0;
|
||||
data.instantEatVL += difference;
|
||||
final ViolationData vd = new ViolationData(this, player, data.instantEatVL, difference, cc.fastConsumeActions);
|
||||
vd.setParameter(ParameterName.FOOD, "" + mat);
|
||||
if (data.instantEatFood != mat){
|
||||
vd.setParameter(ParameterName.TAGS, "inconsistent(" + data.instantEatFood + ")");
|
||||
}
|
||||
else{
|
||||
vd.setParameter(ParameterName.TAGS, "");
|
||||
}
|
||||
if (executeActions(vd).willCancel()){
|
||||
cancel = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
data.instantEatVL *= 0.6;
|
||||
}
|
||||
// Reset interaction.
|
||||
if (cancel) {
|
||||
// Fake interaction to prevent violation loops with false positives.
|
||||
final ItemStack actualStack = InventoryUtil.getFirstConsumableItemInHand(player);
|
||||
data.instantEatFood = actualStack == null ? null : actualStack.getType();
|
||||
// TODO: Allows some abuse: 1. try instantly eat (cancelled) 2. consume item directly when needed.
|
||||
}
|
||||
else {
|
||||
if (pData.isDebugActive(type)) {
|
||||
debug(player, "PlayerItemConsumeEvent, reset fastconsume: " + data.instantEatFood);
|
||||
}
|
||||
data.instantEatFood = null;
|
||||
}
|
||||
data.instantEatInteract = time;
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReload() {
|
||||
disableInstantEat();
|
||||
}
|
||||
|
||||
}
|
||||
-64
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.checks.inventory;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerEditBookEvent;
|
||||
import org.bukkit.inventory.meta.BookMeta;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
|
||||
public class Gutenberg extends Check implements Listener {
|
||||
|
||||
public static void testAvailability(){
|
||||
if (!PlayerEditBookEvent.class.getSimpleName().equals("PlayerEditBookEvent")){
|
||||
throw new RuntimeException("This exception should not even get thrown.");
|
||||
}
|
||||
}
|
||||
|
||||
public Gutenberg() {
|
||||
super(CheckType.INVENTORY_GUTENBERG);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onEditBook(final PlayerEditBookEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
if (!isEnabled(player)) {
|
||||
return;
|
||||
}
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
final InventoryConfig cc = pData.getGenericInstance(InventoryConfig.class);
|
||||
final InventoryData data = pData.getGenericInstance(InventoryData.class);
|
||||
final BookMeta newMeta = event.getNewBookMeta();
|
||||
final int pages = newMeta.getPageCount();
|
||||
if (pages <= cc.gutenbergPageLimit) {
|
||||
// Legitimate.
|
||||
return;
|
||||
}
|
||||
// Violation.
|
||||
final int vl = pages - cc.gutenbergPageLimit;
|
||||
data.gutenbergVL += vl;
|
||||
if (executeActions(player, data.gutenbergVL, vl, cc.gutenbergActions).willCancel()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -26,7 +26,7 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityPortalEnterEvent;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMaterial;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.BridgeMaterial;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.ServerVersion;
|
||||
import fr.neatmonster.nocheatplus.logging.Streams;
|
||||
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
|
||||
+16
-12
@@ -20,7 +20,11 @@ import org.bukkit.World;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockFlags;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.MaterialUtil;
|
||||
|
||||
public class BlockCacheBukkit extends BlockCache {
|
||||
|
||||
@@ -38,6 +42,7 @@ public class BlockCacheBukkit extends BlockCache {
|
||||
this.world = world;
|
||||
if (world != null) {
|
||||
this.maxBlockY = world.getMaxHeight() - 1;
|
||||
this.minBlockY = BlockProperties.getMinWorldY();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -52,13 +57,16 @@ public class BlockCacheBukkit extends BlockCache {
|
||||
@Override
|
||||
public int fetchData(final int x, final int y, final int z) {
|
||||
// TODO: consider setting type id and data at once.
|
||||
return world.getBlockAt(x, y, z).getData();
|
||||
return Bridge1_13.hasIsSwimming() ? 0 : world.getBlockAt(x, y, z).getData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] fetchBounds(final int x, final int y, final int z){
|
||||
// minX, minY, minZ, maxX, maxY, maxZ
|
||||
|
||||
Material mat = getType(x, y, z);
|
||||
long flags = BlockFlags.getBlockFlags(mat);
|
||||
if (flags == BlockFlags.F_IGN_PASSABLE) {
|
||||
return null;
|
||||
}
|
||||
// TODO: Want to maintain a list with manual entries or at least half / full blocks ?
|
||||
// Always return full bounds, needs extra adaption to BlockProperties (!).
|
||||
return new double[]{0D, 0D, 0D, 1D, 1D, 1D};
|
||||
@@ -70,17 +78,14 @@ public class BlockCacheBukkit extends BlockCache {
|
||||
// TODO: Probably check other ids too before doing this ?
|
||||
for (final Entity other : entity.getNearbyEntities(2.0, 2.0, 2.0)){
|
||||
final EntityType type = other.getType();
|
||||
if (type != EntityType.BOAT){ // && !(other instanceof Minecart))
|
||||
continue;
|
||||
if (!MaterialUtil.isBoat(type) && type != EntityType.SHULKER){ // && !(other instanceof Minecart))
|
||||
continue;
|
||||
}
|
||||
final double locY = entity.getLocation(useLoc).getY();
|
||||
useLoc.setWorld(null);
|
||||
if (Math.abs(locY - minY) < 0.7){
|
||||
// TODO: A "better" estimate is possible, though some more tolerance would be good.
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
// TODO: A "better" estimate is possible, though some more tolerance would be good.
|
||||
return Math.abs(locY - minY) < 0.7;
|
||||
}
|
||||
}
|
||||
catch (Throwable t){
|
||||
// Ignore exceptions (Context: DisguiseCraft).
|
||||
@@ -96,5 +101,4 @@ public class BlockCacheBukkit extends BlockCache {
|
||||
super.cleanup();
|
||||
world = null;
|
||||
}
|
||||
|
||||
}
|
||||
+30
-21
@@ -18,8 +18,11 @@ import java.util.Map;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitShapeModel;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.MaterialUtil;
|
||||
|
||||
|
||||
/**
|
||||
@@ -29,22 +32,21 @@ import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitShapeModel;
|
||||
*
|
||||
*/
|
||||
public class BlockCacheBukkitModern extends BlockCacheBukkit {
|
||||
|
||||
|
||||
private Map<Material, BukkitShapeModel> shapeModels;
|
||||
|
||||
|
||||
public BlockCacheBukkitModern(Map<Material, BukkitShapeModel> shapeModels) {
|
||||
super(null);
|
||||
this.shapeModels = shapeModels;
|
||||
}
|
||||
|
||||
|
||||
public BlockCacheBukkitModern(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int fetchData(int x, int y, int z) {
|
||||
Material mat = getType(x, y, z);
|
||||
|
||||
final BukkitShapeModel shapeModel = shapeModels.get(mat);
|
||||
if (shapeModel != null) {
|
||||
final int data = shapeModel.getFakeData(this, world, x, y, z);
|
||||
@@ -54,30 +56,37 @@ public class BlockCacheBukkitModern extends BlockCacheBukkit {
|
||||
}
|
||||
return super.fetchData(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double[] fetchBounds(int x, int y, int z) {
|
||||
// minX, minY, minZ, maxX, maxY, maxZ
|
||||
|
||||
// TODO: Fetch what's possible to fetch/guess (...).
|
||||
|
||||
// TODO: Consider to store the last used block/stuff within BlockCacheBukkit already.
|
||||
//final Block block = world.getBlockAt(x, y, z);
|
||||
//final BlockState state = block.getState();
|
||||
//final MaterialData materialData = state.getData();
|
||||
//final BlockData blockData = state.getBlockData();
|
||||
Material mat = getType(x, y, z);
|
||||
|
||||
final BukkitShapeModel shapeModel = shapeModels.get(mat);
|
||||
if (shapeModel == null) {
|
||||
return super.fetchBounds(x, y, z);
|
||||
}
|
||||
else {
|
||||
return shapeModel.getShape(this, world, x, y, z);
|
||||
}
|
||||
|
||||
return shapeModel.getShape(this, world, x, y, z);
|
||||
}
|
||||
|
||||
// TODO: Might refine standsOnEntity as well.
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean standsOnEntity(final Entity entity, final double minX, final double minY, final double minZ, final double maxX, final double maxY, final double maxZ) {
|
||||
try {
|
||||
// TODO: Probably check vehicle ids too before doing this ?
|
||||
for (final Entity vehicle : entity.getNearbyEntities(0.1, 2.0, 0.1)) {
|
||||
final EntityType type = vehicle.getType();
|
||||
if (!MaterialUtil.isBoat(type) && type != EntityType.SHULKER) { // && !(vehicle instanceof Minecart))
|
||||
continue;
|
||||
}
|
||||
final double vehicleY = vehicle.getLocation(useLoc).getY() + vehicle.getHeight();
|
||||
final double entityY = entity.getLocation(useLoc).getY();
|
||||
useLoc.setWorld(null);
|
||||
// TODO: A "better" estimate is possible, though some more tolerance would be good.
|
||||
return vehicleY < entityY + 0.1 && Math.abs(vehicleY - entityY) < 0.7;
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
// Ignore exceptions (Context: DisguiseCraft).
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+207
-8
@@ -16,15 +16,26 @@ package fr.neatmonster.nocheatplus.compat.bukkit;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeInstance;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.attribute.AttributeModifier.Operation;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.compat.AttribUtil;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.ClientVersion;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.ServerVersion;
|
||||
import fr.neatmonster.nocheatplus.components.modifier.IAttributeAccess;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.MaterialUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.math.MathUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.moving.Magic;
|
||||
|
||||
public class BukkitAttributeAccess implements IAttributeAccess {
|
||||
|
||||
@@ -67,20 +78,208 @@ public class BukkitAttributeAccess implements IAttributeAccess {
|
||||
private double getMultiplier(final AttributeModifier mod) {
|
||||
return AttribUtil.getMultiplier(operationToInt(mod.getOperation()), mod.getAmount());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getSpeedAttributeMultiplier(final Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED);
|
||||
public float getMovementSpeed(final Player player) {
|
||||
// / by 2 to get the base value 0.1f
|
||||
return (player.getWalkSpeed() / 2f) * (float) getSpeedMultiplier(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSpeedMultiplier(final Player player) {
|
||||
final AttributeInstance attrInst = BridgeBukkitAPI.getSpeedAttributeInstance(player);
|
||||
final double val = attrInst.getValue() / attrInst.getBaseValue();
|
||||
final AttributeModifier mod = getModifier(attrInst, AttribUtil.ID_SPRINT_BOOST);
|
||||
return mod == null ? val : (val / getMultiplier(mod));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getSprintAttributeMultiplier(final Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED);
|
||||
public double getSprintMultiplier(final Player player) {
|
||||
final AttributeInstance attrInst = BridgeBukkitAPI.getSpeedAttributeInstance(player);
|
||||
final AttributeModifier mod = getModifier(attrInst, AttribUtil.ID_SPRINT_BOOST);
|
||||
return mod == null ? 1.0 : getMultiplier(mod);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getGravity(Player player) {
|
||||
double gravity;
|
||||
final PlayerMoveData thisMove = DataManager.getPlayerData(player).getGenericInstance(MovingData.class).playerMoves.getCurrentMove();
|
||||
if (!BridgeMisc.hasGravity(player)) {
|
||||
return 0.0;
|
||||
}
|
||||
if (ServerVersion.isLowerThan("1.20.5")) {
|
||||
// Doesn't exist. Calculate manually.
|
||||
gravity = thisMove.yDistance <= 0.0 && !Double.isInfinite(Bridge1_13.getSlowfallingAmplifier(player)) ? Magic.SLOW_FALL_GRAVITY : Magic.DEFAULT_GRAVITY;
|
||||
}
|
||||
else {
|
||||
final AttributeInstance attrInst = BridgeBukkitAPI.getGravityAttributeInstance(player);
|
||||
// Fail-safe.
|
||||
if (attrInst == null) {
|
||||
gravity = thisMove.yDistance <= 0.0 && !Double.isInfinite(Bridge1_13.getSlowfallingAmplifier(player)) ? Magic.SLOW_FALL_GRAVITY : Magic.DEFAULT_GRAVITY;
|
||||
}
|
||||
else gravity = MathUtil.clamp(attrInst.getValue(), -1.0, 1.0);
|
||||
if (thisMove.yDistance <= 0.0 && !Double.isInfinite(Bridge1_13.getSlowfallingAmplifier(player))) {
|
||||
gravity = Math.min(gravity, Magic.SLOW_FALL_GRAVITY);
|
||||
}
|
||||
}
|
||||
return gravity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSafeFallDistance(Player player) {
|
||||
if (ServerVersion.isLowerThan("1.20.5")) {
|
||||
// Doesn't exist. Calculate manually.
|
||||
return Magic.FALL_DAMAGE_DIST;
|
||||
}
|
||||
final AttributeInstance attrInst = BridgeBukkitAPI.getSafeFallAttributeInstance(player);
|
||||
// Fail-safe
|
||||
if (attrInst == null) return Magic.FALL_DAMAGE_DIST;
|
||||
return MathUtil.clamp(attrInst.getValue(), -1024.0, 1024.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getFallDamageMultiplier(Player player) {
|
||||
if (ServerVersion.isLowerThan("1.20.5")) {
|
||||
// Doesn't exist. Calculate manually.
|
||||
return 1.0;
|
||||
}
|
||||
final AttributeInstance attrInst = BridgeBukkitAPI.getFallMultAttributeInstance(player);
|
||||
// Fail-safe
|
||||
if (attrInst == null) return 1.0;
|
||||
return MathUtil.clamp(attrInst.getValue(), 1.0, 100.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getBreakingSpeedMultiplier(Player player) {
|
||||
if (ServerVersion.isLowerThan("1.20.5")) {
|
||||
// Doesn't exist. Calculate manually.
|
||||
return 1.0;
|
||||
}
|
||||
final AttributeInstance attrInst = BridgeBukkitAPI.getBreakSpeedAttributeInstance(player);
|
||||
// Fail-safe
|
||||
if (attrInst == null) return 1.0;
|
||||
return MathUtil.clamp(attrInst.getValue(), 1.0, 1024.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getJumpGainMultiplier(Player player) {
|
||||
if (ServerVersion.isLowerThan("1.20.5")) {
|
||||
// Doesn't exist. Calculate manually.
|
||||
return 1.0;
|
||||
}
|
||||
final AttributeInstance attrInst = BridgeBukkitAPI.getJumpPowerAttributeInstance(player);
|
||||
// Fail-safe
|
||||
if (attrInst == null) return 1.0;
|
||||
final double val = attrInst.getValue() / attrInst.getBaseValue();
|
||||
return MathUtil.clamp(val, 0.0, 76.19047619047619); // MathUtil.clamp(attrInst.getValue(), 0.0, 32.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerSneakingFactor(Player player) {
|
||||
// Not available. 1.21 and above only.
|
||||
return Magic.SNEAK_MULTIPLIER + BridgeEnchant.getSwiftSneakIncrement(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerMaxBlockReach(Player player) {
|
||||
if (ServerVersion.isLowerThan("1.20.5")) {
|
||||
// Doesn't exist. Calculate manually.
|
||||
return 4.5;
|
||||
}
|
||||
final AttributeInstance attrInst = BridgeBukkitAPI.getBlockInteractionRangeAttributeInstance(player);
|
||||
// Fail-safe
|
||||
if (attrInst == null) return 4.5;
|
||||
return MathUtil.clamp(attrInst.getValue(), 0.0, 64.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerMaxAttackReach(Player player) {
|
||||
if (ServerVersion.isLowerThan("1.20.5")) {
|
||||
// Doesn't exist. Calculate manually.
|
||||
return 3.0;
|
||||
}
|
||||
final AttributeInstance attrInst = BridgeBukkitAPI.getEntityInteractionRangeAttributeInstance(player);
|
||||
// Fail-safe
|
||||
if (attrInst == null) return 3.0;
|
||||
return MathUtil.clamp(attrInst.getValue(), 0.0, 64.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxStepUp(Player player) {
|
||||
if (ServerVersion.isLowerThan("1.20.5")) {
|
||||
// Does not exist, calculate manually.
|
||||
if (player.isInsideVehicle()) {
|
||||
if (player.getVehicle() != null && MaterialUtil.isBoat(player.getVehicle().getType())) {
|
||||
// Boats are unable to step.
|
||||
return 0.0;
|
||||
}
|
||||
// All other vehicles have a step value of 1.0
|
||||
return 1.0;
|
||||
}
|
||||
final MovingConfig cc = DataManager.getPlayerData(player).getGenericInstance(MovingConfig.class);
|
||||
return cc.sfStepHeight;
|
||||
}
|
||||
final AttributeInstance attrInst = BridgeBukkitAPI.getStepHeightAttributeInstance(player);
|
||||
if (attrInst == null) {
|
||||
// Fail-safe.
|
||||
if (player.isInsideVehicle()) {
|
||||
if (player.getVehicle() != null && MaterialUtil.isBoat(player.getVehicle().getType())) {
|
||||
return 0.0;
|
||||
}
|
||||
return 1.0;
|
||||
}
|
||||
final MovingConfig cc = DataManager.getPlayerData(player).getGenericInstance(MovingConfig.class);
|
||||
return cc.sfStepHeight;
|
||||
}
|
||||
return MathUtil.clamp(attrInst.getValue(), 0.0, 10.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWaterMovementEfficiency(Player player) {
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
if (pData.getClientVersion().isLowerThan(ClientVersion.V_1_8)) {
|
||||
// Doesn't exist.
|
||||
return 0f;
|
||||
}
|
||||
final float depthStrider = BridgeEnchant.getDepthStriderLevel(player);
|
||||
if (pData.getClientVersion().isLowerThan(ClientVersion.V_1_21)) {
|
||||
// Use the legacy method.
|
||||
return depthStrider;
|
||||
}
|
||||
if (ServerVersion.isLowerThan("1.21")) {
|
||||
// Simulate what ViaVersion does for newer (1.21 clients) on older (1.21-) servers.
|
||||
return depthStrider / 3.0f;
|
||||
}
|
||||
// Unsupported. Only since 1.21.
|
||||
return depthStrider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMovementEfficiency(Player player) {
|
||||
// Not available. 1.21 and above only.
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSubmergedMiningSpeedMultiplier(Player player) {
|
||||
// Not available. 1.21 and above only.
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMiningEfficiency(Player player) {
|
||||
// Not available. 1.21 and above only.
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEntityScale(Player player) {
|
||||
if (ServerVersion.isLowerThan("1.20.5")) {
|
||||
return 1.0;
|
||||
}
|
||||
final AttributeInstance attrInst = BridgeBukkitAPI.getScaleAttributeInstance(player);
|
||||
// Fail-safe.
|
||||
if (attrInst == null) return 1.0;
|
||||
return MathUtil.clamp(attrInst.getValue(), 0.0625, 16.0);
|
||||
}
|
||||
}
|
||||
+2
-3
@@ -25,7 +25,6 @@ import fr.neatmonster.nocheatplus.config.WorldConfigProvider;
|
||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockFlags;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
public class MCAccessBukkit extends MCAccessBukkitBase implements BlockPropertiesSetup {
|
||||
|
||||
@@ -42,10 +41,10 @@ public class MCAccessBukkit extends MCAccessBukkitBase implements BlockPropertie
|
||||
}
|
||||
else if (guessItchyBlock(mat)) {
|
||||
// Uncertain bounding-box, allow passing through.
|
||||
long flags = BlockProperties.F_IGN_PASSABLE;
|
||||
long flags = BlockFlags.F_IGN_PASSABLE;
|
||||
if ((BlockFlags.hasAnyFlag(flags, BlockFlags.SOLID_GROUND))) {
|
||||
// Block can be ground, so allow standing on any height.
|
||||
flags |= BlockProperties.F_GROUND | BlockProperties.F_GROUND_HEIGHT;
|
||||
flags |= BlockFlags.F_GROUND | BlockFlags.F_GROUND_HEIGHT;
|
||||
}
|
||||
/*
|
||||
* TODO: Might have to set all blocks to ground here, rather
|
||||
|
||||
+40
-30
@@ -32,10 +32,10 @@ import org.bukkit.entity.Slime;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeHealth;
|
||||
import fr.neatmonster.nocheatplus.compat.MCAccess;
|
||||
import fr.neatmonster.nocheatplus.utilities.PotionUtil;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.ServerVersion;
|
||||
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.entity.PotionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockFlags;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
@@ -75,17 +75,17 @@ public class MCAccessBukkitBase implements MCAccess {
|
||||
return false;
|
||||
}
|
||||
// Fully solid/ground blocks.
|
||||
final long flags = BlockProperties.getBlockFlags(mat);
|
||||
final long flags = BlockFlags.getBlockFlags(mat);
|
||||
/*
|
||||
* Skip fully passable blocks (partially passable blocks may be itchy,
|
||||
* though slabs will be easy to handle).
|
||||
*/
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockProperties.F_IGN_PASSABLE)) {
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockFlags.F_IGN_PASSABLE)) {
|
||||
// TODO: Blocks with min_height may actually be ok, if xz100 and some height are set.
|
||||
if (BlockFlags.hasNoFlags(flags,
|
||||
BlockProperties.F_GROUND_HEIGHT
|
||||
| BlockProperties.F_GROUND
|
||||
| BlockProperties.F_SOLID)) {
|
||||
BlockFlags.F_GROUND_HEIGHT
|
||||
| BlockFlags.F_GROUND
|
||||
| BlockFlags.F_SOLID)) {
|
||||
// Explicitly passable.
|
||||
return false;
|
||||
}
|
||||
@@ -94,11 +94,10 @@ public class MCAccessBukkitBase implements MCAccess {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
long testFlags1 = (BlockProperties.F_SOLID | BlockProperties.F_XZ100);
|
||||
long testFlags2 = (BlockProperties.F_HEIGHT100
|
||||
| BlockProperties.F_HEIGHT16_15);
|
||||
if (BlockFlags.hasAllFlags(flags, testFlags1)
|
||||
&& BlockFlags.hasAnyFlag(flags, testFlags2)) {
|
||||
|
||||
long testFlags1 = (BlockFlags.F_SOLID | BlockFlags.F_XZ100);
|
||||
long testFlags2 = (BlockFlags.F_HEIGHT100);
|
||||
if (BlockFlags.hasAllFlags(flags, testFlags1) && BlockFlags.hasAnyFlag(flags, testFlags2)) {
|
||||
// Solid blocks with explicitly set bounds.
|
||||
return false;
|
||||
}
|
||||
@@ -114,9 +113,9 @@ public class MCAccessBukkitBase implements MCAccess {
|
||||
|
||||
@Override
|
||||
public String getMCVersion() {
|
||||
// Bukkit API.
|
||||
// Bukkit API. Versions lower than MC 1.13 have their own module.
|
||||
// TODO: maybe output something else.
|
||||
return "1.6.1-1.14.4|?"; // uh oh
|
||||
return "1.13-1.20"; // uh oh
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -175,12 +174,16 @@ public class MCAccessBukkitBase implements MCAccess {
|
||||
// TODO: For height too. [Automatize most by spawning + checking?]
|
||||
// Values taken from 1.7.10.
|
||||
final EntityType type = entity.getType();
|
||||
Double width = BridgeEntityType.LEGACY_ENTITY_WIDTH.get(type);
|
||||
if (width != null) {
|
||||
return width;
|
||||
}
|
||||
switch(type){
|
||||
// TODO: case COMPLEX_PART:
|
||||
case ENDER_SIGNAL: // this.a(0.25F, 0.25F);
|
||||
case FIREWORK: // this.a(0.25F, 0.25F);
|
||||
case FISHING_HOOK: // this.a(0.25F, 0.25F);
|
||||
case DROPPED_ITEM: // this.a(0.25F, 0.25F);
|
||||
//case ENDER_SIGNAL: // this.a(0.25F, 0.25F);
|
||||
//case FIREWORK: // this.a(0.25F, 0.25F);
|
||||
//case FISHING_HOOK: // this.a(0.25F, 0.25F);
|
||||
//case DROPPED_ITEM: // this.a(0.25F, 0.25F);
|
||||
case SNOWBALL: // (projectile) this.a(0.25F, 0.25F);
|
||||
return 0.25;
|
||||
case CHICKEN: // this.a(0.3F, 0.7F);
|
||||
@@ -190,7 +193,7 @@ public class MCAccessBukkitBase implements MCAccess {
|
||||
case WITHER_SKULL: // this.a(0.3125F, 0.3125F);
|
||||
return 0.3125f;
|
||||
case GHAST: // this.a(4.0F, 4.0F);
|
||||
case SNOWMAN: // this.a(0.4F, 1.8F);
|
||||
//case SNOWMAN: // this.a(0.4F, 1.8F);
|
||||
return 0.4f;
|
||||
case ARROW: // this.a(0.5F, 0.5F);
|
||||
case BAT: // this.a(0.5F, 0.9F);
|
||||
@@ -200,7 +203,6 @@ public class MCAccessBukkitBase implements MCAccess {
|
||||
return 0.5f;
|
||||
case PLAYER: // FAST RETURN
|
||||
case ZOMBIE:
|
||||
case PIG_ZOMBIE:
|
||||
case SKELETON:
|
||||
case CREEPER:
|
||||
case ENDERMAN:
|
||||
@@ -213,24 +215,24 @@ public class MCAccessBukkitBase implements MCAccess {
|
||||
case CAVE_SPIDER: // this.a(0.7F, 0.5F);
|
||||
return 0.7f;
|
||||
case COW: // this.a(0.9F, 1.3F);
|
||||
case MUSHROOM_COW: // this.a(0.9F, 1.3F);
|
||||
//case MUSHROOM_COW: // this.a(0.9F, 1.3F);
|
||||
case PIG: // this.a(0.9F, 0.9F);
|
||||
case SHEEP: // this.a(0.9F, 1.3F);
|
||||
case WITHER: // this.a(0.9F, 4.0F);
|
||||
return 0.9f;
|
||||
case SQUID: // this.a(0.95F, 0.95F);
|
||||
return 0.95f;
|
||||
case PRIMED_TNT: // this.a(0.98F, 0.98F);
|
||||
return 0.98f;
|
||||
//case PRIMED_TNT: // this.a(0.98F, 0.98F);
|
||||
// return 0.98f;
|
||||
case FIREBALL: // (EntityFireball) this.a(1.0F, 1.0F);
|
||||
return 1.0f;
|
||||
case IRON_GOLEM: // this.a(1.4F, 2.9F);
|
||||
case SPIDER: // this.a(1.4F, 0.9F);
|
||||
return 1.4f;
|
||||
case BOAT: // this.a(1.5F, 0.6F);
|
||||
return 1.5f;
|
||||
case ENDER_CRYSTAL: // this.a(2.0F, 2.0F);
|
||||
return 2.0f;
|
||||
// case BOAT: // this.a(1.5F, 0.6F);
|
||||
// return 1.5f;
|
||||
//case ENDER_CRYSTAL: // this.a(2.0F, 2.0F);
|
||||
// return 2.0f;
|
||||
case GIANT: // this.height *= 6.0F; this.a(this.width * 6.0F, this.length * 6.0F);
|
||||
return 3.6f; // (Better than nothing.)
|
||||
case ENDER_DRAGON: // this.a(16.0F, 8.0F);
|
||||
@@ -245,6 +247,9 @@ public class MCAccessBukkitBase implements MCAccess {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (MaterialUtil.isBoat(entity.getType())) {
|
||||
return ServerVersion.isHigherThan("1.8") ? 1.3964844f : 1.4f;
|
||||
}
|
||||
// Check by instance for minecarts (too many).
|
||||
if (entity instanceof Minecart) {
|
||||
return 0.98f; // this.a(0.98F, 0.7F);
|
||||
@@ -252,8 +257,8 @@ public class MCAccessBukkitBase implements MCAccess {
|
||||
// Latest Bukkit API.
|
||||
try {
|
||||
switch (type) {
|
||||
case LEASH_HITCH: // hanging: this.a(0.5F, 0.5F);
|
||||
return 0.5f;
|
||||
//case LEASH_HITCH: // hanging: this.a(0.5F, 0.5F);
|
||||
// return 0.5f;
|
||||
case HORSE: // this.a(1.4F, 1.6F);
|
||||
return 1.4f;
|
||||
// 1.8
|
||||
@@ -310,7 +315,7 @@ public class MCAccessBukkitBase implements MCAccess {
|
||||
|
||||
@Override
|
||||
public double getJumpAmplifier(final Player player) {
|
||||
return PotionUtil.getPotionEffectAmplifier(player, PotionEffectType.JUMP);
|
||||
return PotionUtil.getPotionEffectAmplifier(player, BridgePotionEffect.JUMP_BOOST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -377,6 +382,11 @@ public class MCAccessBukkitBase implements MCAccess {
|
||||
return AlmostBoolean.NO; // Assumption.
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean resetActiveItem(Player player) {
|
||||
return false; // Assumption.
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void correctDirection(Player player) {
|
||||
// // TODO: Consider using reflection (detect CraftPlayer, access EntityPlayer + check if possible (!), use flags for if valid or invalid.)
|
||||
|
||||
+391
-156
@@ -18,111 +18,172 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMaterial;
|
||||
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.init.BlockInit;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.*;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitAnvil;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitBamboo;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitBell;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitCake;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitCauldron;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitChorusPlant;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitCocoa;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitDirectionalCentered;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitDoor;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitDripLeaf;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitDripStone;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitEndPortalFrame;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitFence;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitFetchableBound;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitFetchableBounds;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitGate;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitGrindStone;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitHopper;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitLadder;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitLantern;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitLevelled;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitPiston;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitPistonHead;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitPowderSnow;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitRail;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitSeaPickle;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitShapeModel;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitShulkerBox;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitSlab;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitSnow;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitStairs;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitStatic;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitTrapDoor;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitTurtleEgg;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitWall;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitWallHead;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitWaterPlant;
|
||||
import fr.neatmonster.nocheatplus.compat.cbreflect.reflect.ReflectBase;
|
||||
import fr.neatmonster.nocheatplus.compat.cbreflect.reflect.ReflectDamageSource;
|
||||
import fr.neatmonster.nocheatplus.compat.cbreflect.reflect.ReflectDamageSources;
|
||||
import fr.neatmonster.nocheatplus.compat.cbreflect.reflect.ReflectLivingEntity;
|
||||
import fr.neatmonster.nocheatplus.config.WorldConfigProvider;
|
||||
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockFlags;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.MaterialUtil;
|
||||
|
||||
public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
|
||||
protected ReflectBase reflectBase = null;
|
||||
protected ReflectDamageSource reflectDamageSource = null;
|
||||
protected ReflectDamageSources reflectDamageSources = null;
|
||||
protected ReflectLivingEntity reflectLivingEntity = null;
|
||||
protected final Map<Material, BukkitShapeModel> shapeModels = new HashMap<Material, BukkitShapeModel>();
|
||||
|
||||
// Blocks that can be fetched automatically from the Bukkit API
|
||||
private static final BukkitShapeModel MODEL_AUTO_FETCH = new BukkitFetchableBounds();
|
||||
private static final BukkitShapeModel MODEL_AUTO_FETCH_LEGACY = new BukkitFetchableBound();
|
||||
|
||||
// Blocks that are formed from multiple bounding boxes
|
||||
private static final BukkitShapeModel MODEL_BREWING_STAND = new BukkitStatic(
|
||||
// Bottom rod
|
||||
0.0625, 0.0, 0.0625, 0.9375, 0.125, 0.9375,
|
||||
// Rod
|
||||
0.4375, 0.125, 0.4375, 0.5625, 0.875, 0.5625
|
||||
);
|
||||
private static final BukkitShapeModel MODEL_CANDLE_CAKE = new BukkitStatic(
|
||||
// Cake
|
||||
0.0625, 0.0, 0.0625, 0.9375, 0.5, 0.9375,
|
||||
// Candle
|
||||
0.4375, 0.5, 0.4375, 0.5625, 0.875, 0.5625
|
||||
);
|
||||
private static final BukkitShapeModel MODEL_LECTERN = new BukkitStatic(
|
||||
// Post
|
||||
0.0, 0.0, 0.0, 1.0, 0.125, 1.0,
|
||||
// Lectern
|
||||
0.25, 0.125, 0.25, 0.75, 0.875, 0.75
|
||||
);
|
||||
private static final BukkitShapeModel MODEL_HOPPER = new BukkitHopper();
|
||||
private static final BukkitShapeModel MODEL_CAULDRON = new BukkitCauldron(0.1875, 0.125, 0.8125, 0.0625);
|
||||
private static final BukkitShapeModel MODEL_COMPOSTER = new BukkitCauldron(0.0, 0.125, 1.0, 0.125);
|
||||
private static final BukkitShapeModel MODEL_PISTON_HEAD = new BukkitPistonHead();
|
||||
private static final BukkitShapeModel MODEL_BELL = new BukkitBell();
|
||||
private static final BukkitShapeModel MODEL_ANVIL = new BukkitAnvil();
|
||||
private static final BukkitShapeModel MODEL_GRIND_STONE = new BukkitGrindStone();
|
||||
|
||||
// Blocks that change shape based on interaction or redstone.
|
||||
private static final BukkitShapeModel MODEL_DOOR = new BukkitDoor();
|
||||
private static final BukkitShapeModel MODEL_TRAP_DOOR = new BukkitTrapDoor();
|
||||
private static final BukkitShapeModel MODEL_GATE = new BukkitGate(
|
||||
0.375, 1.5);
|
||||
private static final BukkitShapeModel MODEL_GATE = new BukkitGate(0.375, 1.5);
|
||||
private static final BukkitShapeModel MODEL_SHULKER_BOX = new BukkitShulkerBox();
|
||||
private static final BukkitShapeModel MODEL_CHORUS_PLANT = new BukkitChorusPlant();
|
||||
private static final BukkitShapeModel MODEL_DRIP_LEAF = new BukkitDripLeaf();
|
||||
|
||||
// Blocks with different heights based on whatever.
|
||||
private static final BukkitShapeModel MODEL_END_PORTAL_FRAME = new BukkitEndPortalFrame();
|
||||
private static final BukkitShapeModel MODEL_SEA_PICKLE = new BukkitSeaPickle();
|
||||
private static final BukkitShapeModel MODEL_COCOA = new BukkitCocoa();
|
||||
private static final BukkitShapeModel MODEL_TURTLE_EGG = new BukkitTurtleEgg();
|
||||
private static final BukkitShapeModel MODEL_POWDER_SNOW = new BukkitPowderSnow();
|
||||
|
||||
// Blocks that have a different shape, based on how they have been placed.
|
||||
private static final BukkitShapeModel MODEL_CAKE = new BukkitCake();
|
||||
private static final BukkitShapeModel MODEL_SLAB = new BukkitSlab();
|
||||
private static final BukkitShapeModel MODEL_STAIRS= new BukkitStairs();
|
||||
private static final BukkitShapeModel MODEL_END_ROD = new BukkitDirectionalCentered(
|
||||
0.375, 1.0, false);
|
||||
private static final BukkitShapeModel MODEL_STAIRS = new BukkitStairs();
|
||||
private static final BukkitShapeModel MODEL_SNOW = new BukkitSnow();
|
||||
private static final BukkitShapeModel MODEL_PISTON = new BukkitPiston();
|
||||
private static final BukkitShapeModel MODEL_LEVELLED = new BukkitLevelled();
|
||||
private static final BukkitShapeModel MODEL_LADDER = new BukkitLadder();
|
||||
private static final BukkitShapeModel MODEL_RAIL = new BukkitRail();
|
||||
private static final BukkitShapeModel MODEL_END_ROD = new BukkitDirectionalCentered(0.375, 1.0, false);
|
||||
|
||||
// Blocks that have a different shape with neighbor blocks (bukkit takes care though).
|
||||
private static final BukkitShapeModel MODEL_THIN_FENCE = new BukkitFence(
|
||||
0.4375, 1.0);
|
||||
private static final BukkitShapeModel MODEL_THICK_FENCE = new BukkitFence(
|
||||
0.375, 1.5);
|
||||
private static final BukkitShapeModel MODEL_THICK_FENCE2 = new BukkitWall(
|
||||
0.25, 1.5);
|
||||
// .75 .25 0 max: .25 .75 .5
|
||||
private static final BukkitShapeModel MODEL_THIN_FENCE = new BukkitFence(0.4375, 1.0);
|
||||
private static final BukkitShapeModel MODEL_THICK_FENCE = new BukkitFence(0.375, 1.5);
|
||||
private static final BukkitShapeModel MODEL_THICK_FENCE2 = new BukkitWall(0.25, 1.5, 0.3125); // .75 .25 0 max: .25 .75 .5
|
||||
private static final BukkitShapeModel MODEL_WALL_HEAD = new BukkitWallHead();
|
||||
|
||||
|
||||
// Static blocks (various height and inset values).
|
||||
private static final BukkitShapeModel MODEL_BELL = new BukkitBell();
|
||||
private static final BukkitShapeModel MODEL_LECTERN = new BukkitStatic(0.25, 0.875);
|
||||
private static final BukkitShapeModel MODEL_CAMPFIRE = new BukkitStatic(0.0, 0.4375);
|
||||
private static final BukkitShapeModel MODEL_BAMBOO = new BukkitBamboo();
|
||||
private static final BukkitShapeModel MODEL_ANVIL = new BukkitAnvil();
|
||||
private static final BukkitShapeModel MODEL_LILY_PAD = new BukkitStatic(
|
||||
0.09375);
|
||||
private static final BukkitShapeModel MODEL_FLOWER_POT = new BukkitStatic(
|
||||
0.33, 0.375); // TODO: XZ really?
|
||||
private static final BukkitShapeModel MODEL_POINTED_DRIPSTONE = new BukkitDripStone();
|
||||
private static final BukkitShapeModel MODEL_WATER_PLANTS = new BukkitWaterPlant();
|
||||
private static final BukkitShapeModel MODEL_LILY_PAD = new BukkitStatic(0.0625, 0.09375);
|
||||
private static final BukkitShapeModel MODEL_FLOWER_POT = new BukkitStatic(0.3125, 0.375);
|
||||
private static final BukkitShapeModel MODEL_LANTERN = new BukkitLantern();
|
||||
private static final BukkitShapeModel MODEL_CONDUIT = new BukkitStatic(
|
||||
0.33, 0.6875);
|
||||
private static final BukkitShapeModel MODEL_GROUND_HEAD= new BukkitStatic(
|
||||
0.25, 0.5); // TODO: XZ-really? 275 ?
|
||||
private static final BukkitShapeModel MODEL_SINGLE_CHEST = new BukkitStatic(
|
||||
0.062, .875); // TODO: 0.0625?
|
||||
private static final BukkitShapeModel MODEL_CONDUIT = new BukkitStatic(0.3125, 0.3125, 0.3125, 0.6875, 0.6875, 0.6875);
|
||||
private static final BukkitShapeModel MODEL_GROUND_HEAD = new BukkitStatic(0.25, 0.5);
|
||||
private static final BukkitShapeModel MODEL_SINGLE_CHEST = new BukkitStatic(0.0625, 0.875);
|
||||
private static final BukkitShapeModel MODEL_HONEY_BLOCK = new BukkitStatic(0.0625, 0.9375);
|
||||
private static final BukkitShapeModel MODEL_SCULK_SHRIEKER = new BukkitStatic(0.0, 0.5);
|
||||
|
||||
// Static blocks with full height sorted by inset.
|
||||
private static final BukkitShapeModel MODEL_INSET16_1_HEIGHT100 = new BukkitStatic(
|
||||
0.0625, 1.0);
|
||||
|
||||
private static final BukkitShapeModel MODEL_INSET16_1_HEIGHT100 = new BukkitStatic(0.0625, 1.0);
|
||||
|
||||
// Static blocks with full xz-bounds sorted by height.
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT16_1 = new BukkitStatic(
|
||||
0.0625);
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT8_1 = new BukkitStatic(
|
||||
0.125);
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT8_3 = new BukkitStatic(
|
||||
0.375);
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT16_9 = new BukkitStatic(
|
||||
0.5625);
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT4_3 = new BukkitStatic(
|
||||
0.75);
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT8_7 = new BukkitStatic(
|
||||
0.875);
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT16_15 = new BukkitStatic(
|
||||
0.9375);
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
* LADDER,
|
||||
* CONDUIT,
|
||||
* CHORUS_FLOWER, CHORUS_PLANT, COCOA,
|
||||
* TURTLE_EGG, SEA_PICKLE,
|
||||
* VINE,
|
||||
* CAKE,
|
||||
*/
|
||||
// TODO: anvils, dead coral fans
|
||||
// TODO: Liquid (all leveled).
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT16_1 = new BukkitStatic(0.0625);
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT8_1 = new BukkitStatic(0.125);
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT8_3 = new BukkitStatic(0.375);
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT16_9 = new BukkitStatic(0.5625);
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT4_3 = new BukkitStatic(0.75);
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT16_15 = new BukkitStatic(0.9375);
|
||||
private static final BukkitShapeModel MODEL_XZ100_HEIGHT8_7 = new BukkitStatic(0.875);
|
||||
|
||||
public MCAccessBukkitModern() {
|
||||
super();
|
||||
// TODO: Generic setup via Bukkit interface existence/relations, +- fetching methods.
|
||||
BlockInit.assertMaterialExists("OAK_LOG");
|
||||
BlockInit.assertMaterialExists("CAVE_AIR");
|
||||
try {
|
||||
this.reflectBase = new ReflectBase();
|
||||
this.reflectDamageSource = new ReflectDamageSource(this.reflectBase);
|
||||
this.reflectLivingEntity = new ReflectLivingEntity(this.reflectBase, null, this.reflectDamageSource);
|
||||
// Can be null
|
||||
this.reflectDamageSources = new ReflectDamageSources(this.reflectBase, this.reflectDamageSource);
|
||||
}
|
||||
catch (ClassNotFoundException ex) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMCVersion() {
|
||||
return "1.13-1.14.4|?";
|
||||
return "1.13-1.21";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -137,48 +198,95 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
|
||||
@Override
|
||||
public void setupBlockProperties(final WorldConfigProvider<?> worldConfigProvider) {
|
||||
/*
|
||||
* TODO: Incomplete blocks bounds still use workarounds(not affect movement):
|
||||
* All fences, glass pane, iron bar, chorus plant, hopper
|
||||
*
|
||||
* Legacy blocks still use workarounds(not affect movement):
|
||||
* All fences, glass pane, iron bar, chorus plant, hopper, cauldron
|
||||
*
|
||||
* Scaffolding(affect fall dmg)
|
||||
*
|
||||
*/
|
||||
|
||||
// TODO: Also consider removing flags (passable_x4 etc).
|
||||
|
||||
// Variables for repeated flags (Temporary flags, these should be fixed later so that they are not added here)
|
||||
final long blockFix = BlockFlags.SOLID_GROUND;
|
||||
// Adjust flags for individual blocks.
|
||||
BlockProperties.setBlockFlags(Material.CAULDRON,
|
||||
BlockFlags.SOLID_GROUND | BlockProperties.F_GROUND_HEIGHT
|
||||
| BlockProperties.F_MIN_HEIGHT4_1);
|
||||
BlockProperties.setBlockFlags(Material.COCOA, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.TURTLE_EGG, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.CHORUS_PLANT, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.CREEPER_WALL_HEAD, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.ZOMBIE_WALL_HEAD, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.PLAYER_WALL_HEAD, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.DRAGON_WALL_HEAD, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.WITHER_SKELETON_WALL_SKULL, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.SKELETON_WALL_SKULL, blockFix);
|
||||
// Variables for repeated flags (Temporary flags, these should be fixed later so that they are not added here)
|
||||
final long blockFix = BlockFlags.SOLID_GROUND;
|
||||
// Adjust flags for individual blocks.
|
||||
BlockFlags.setBlockFlags(Material.COCOA, blockFix);
|
||||
BlockFlags.setBlockFlags(Material.TURTLE_EGG, blockFix);
|
||||
BlockFlags.setBlockFlags(Material.CHORUS_PLANT, blockFix);
|
||||
BlockFlags.setBlockFlags(Material.CREEPER_WALL_HEAD, blockFix);
|
||||
BlockFlags.setBlockFlags(Material.ZOMBIE_WALL_HEAD, blockFix);
|
||||
BlockFlags.setBlockFlags(Material.PLAYER_WALL_HEAD, blockFix);
|
||||
BlockFlags.setBlockFlags(Material.DRAGON_WALL_HEAD, blockFix);
|
||||
BlockFlags.setBlockFlags(Material.WITHER_SKELETON_WALL_SKULL, blockFix);
|
||||
BlockFlags.setBlockFlags(Material.SKELETON_WALL_SKULL, blockFix);
|
||||
|
||||
// Directly keep blocks as is.
|
||||
for (final Material mat : new Material[] {
|
||||
Material.CAULDRON,
|
||||
BridgeMaterial.COBWEB,
|
||||
Material.HOPPER,
|
||||
BridgeMaterial.MOVING_PISTON,
|
||||
Material.SNOW,
|
||||
Material.CAKE,
|
||||
Material.BEACON,
|
||||
Material.LADDER,
|
||||
Material.VINE,
|
||||
Material.CHORUS_FLOWER
|
||||
}) {
|
||||
BridgeMaterial.COBWEB,
|
||||
BridgeMaterial.MOVING_PISTON,
|
||||
Material.SNOW,
|
||||
Material.BEACON,
|
||||
Material.VINE,
|
||||
Material.CHORUS_FLOWER}) {
|
||||
processedBlocks.add(mat);
|
||||
}
|
||||
for (final Material mat : BridgeMaterial.getAllBlocks(
|
||||
"light", "glow_lichen", "big_dripleaf_stem",
|
||||
// TODO: Not fully tested
|
||||
"scaffolding")) {
|
||||
processedBlocks.add(mat);
|
||||
}
|
||||
|
||||
// Candle
|
||||
for (Material mat : MaterialUtil.ALL_CANDLES) {
|
||||
addModel(mat, MODEL_AUTO_FETCH);
|
||||
}
|
||||
|
||||
// Amethyst
|
||||
for (Material mat : MaterialUtil.AMETHYST) {
|
||||
addModel(mat, MODEL_AUTO_FETCH);
|
||||
}
|
||||
|
||||
// new flower, and others
|
||||
for (Material mat : BridgeMaterial.getAllBlocks(
|
||||
"azalea", "flowering_azalea",
|
||||
"sculk_sensor", "frogspawn",
|
||||
"sniffer_egg", "decorated_pot", "pitcher_crop", "calibrated_sculk_sensor", "bubble_column",
|
||||
"closed_eyeblossom", "open_eyeblossom", "pale_hanging_moss", "resin_clump")) {
|
||||
addModel(mat, MODEL_AUTO_FETCH);
|
||||
}
|
||||
|
||||
// *WALL* hanging signs have a collision box. Simple hanging signs don't, so they are treated as an ordinary sign.
|
||||
for (Material mat : MaterialUtil.WALL_HANGING_SIGNS) {
|
||||
// Only the post has an actual collision box, the rest is all hit box.
|
||||
addModel(mat, MODEL_AUTO_FETCH);
|
||||
}
|
||||
|
||||
for (Material mat : BridgeMaterial.getAllBlocks(
|
||||
"stonecutter", "chain")) {
|
||||
addModel(mat, MODEL_AUTO_FETCH_LEGACY);
|
||||
}
|
||||
|
||||
// Camp fire
|
||||
for (Material mat : BridgeMaterial.getAllBlocks(
|
||||
"campfire", "soul_campfire")) {
|
||||
addModel(mat, MODEL_CAMPFIRE);
|
||||
}
|
||||
|
||||
// Cauldron
|
||||
for (Material mat : MaterialUtil.CAULDRON) {
|
||||
BlockFlags.setBlockFlags(mat, BlockFlags.SOLID_GROUND);
|
||||
addModel(mat, MODEL_CAULDRON);
|
||||
}
|
||||
|
||||
//Anvil
|
||||
for (Material mat : new Material[] {
|
||||
Material.ANVIL,
|
||||
Material.CHIPPED_ANVIL,
|
||||
Material.DAMAGED_ANVIL
|
||||
}) {
|
||||
addModel(mat, MODEL_ANVIL);
|
||||
Material.ANVIL,
|
||||
Material.CHIPPED_ANVIL,
|
||||
Material.DAMAGED_ANVIL}) {
|
||||
addModel(mat, MODEL_ANVIL);
|
||||
}
|
||||
|
||||
// Lily pad
|
||||
@@ -187,56 +295,68 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
// End portal frame.
|
||||
addModel(BridgeMaterial.END_PORTAL_FRAME, MODEL_END_PORTAL_FRAME);
|
||||
|
||||
// End rod.
|
||||
addModel(Material.END_ROD, MODEL_END_ROD);
|
||||
// Cake
|
||||
addModel(BridgeMaterial.CAKE, MODEL_CAKE);
|
||||
|
||||
// 1/16 inset at full height.
|
||||
for (Material mat : new Material[] {
|
||||
Material.CACTUS,
|
||||
Material.DRAGON_EGG
|
||||
}) {
|
||||
addModel(mat, MODEL_INSET16_1_HEIGHT100);
|
||||
// End Rod / Lightning Rod.
|
||||
for (Material mat : MaterialUtil.RODS) {
|
||||
addModel(mat, MODEL_END_ROD);
|
||||
}
|
||||
|
||||
// 1/8 height.
|
||||
// Hoppers - min height changed in 1.13+
|
||||
addModel(Material.HOPPER, MODEL_HOPPER);
|
||||
|
||||
// Ladder
|
||||
addModel(Material.LADDER, MODEL_LADDER);
|
||||
|
||||
// BrewingStand
|
||||
addModel(Material.BREWING_STAND, MODEL_BREWING_STAND);
|
||||
|
||||
// 1/16 inset at full height blocks.
|
||||
addModel(Material.DRAGON_EGG, MODEL_INSET16_1_HEIGHT100);
|
||||
addModel(Material.CACTUS, MODEL_HONEY_BLOCK);
|
||||
|
||||
// 1/8 height blocks.
|
||||
for (Material mat : new Material[] {
|
||||
BridgeMaterial.REPEATER,
|
||||
Material.COMPARATOR
|
||||
}) {
|
||||
BridgeMaterial.REPEATER,
|
||||
Material.COMPARATOR }) {
|
||||
addModel(mat, MODEL_XZ100_HEIGHT8_1);
|
||||
}
|
||||
|
||||
// 3/8 height.
|
||||
// 3/8 height blocks.
|
||||
for (Material mat : new Material[] {
|
||||
Material.DAYLIGHT_DETECTOR
|
||||
}) {
|
||||
Material.DAYLIGHT_DETECTOR}) {
|
||||
addModel(mat, MODEL_XZ100_HEIGHT8_3);
|
||||
}
|
||||
|
||||
// 3/4 height.
|
||||
// 3/4 height blocks.
|
||||
for (Material mat : new Material[] {
|
||||
BridgeMaterial.ENCHANTING_TABLE
|
||||
}) {
|
||||
BridgeMaterial.ENCHANTING_TABLE}) {
|
||||
addModel(mat, MODEL_XZ100_HEIGHT4_3);
|
||||
}
|
||||
|
||||
// All candle cakes
|
||||
for (Material mat : MaterialUtil.ALL_CANDLE_CAKE) {
|
||||
addModel(mat, MODEL_CANDLE_CAKE);
|
||||
}
|
||||
|
||||
// 7/8 height.
|
||||
for (Material mat : new Material[] {
|
||||
Material.BREWING_STAND // TODO: base is 1/8, center 0.875 - needs multi-cuboid.
|
||||
}) {
|
||||
Material.SOUL_SAND}) {
|
||||
addModel(mat, MODEL_XZ100_HEIGHT8_7);
|
||||
}
|
||||
|
||||
// 16/15 height, full xz bounds.
|
||||
for (Material mat : new Material[] {
|
||||
Material.GRASS_PATH, BridgeMaterial.FARMLAND
|
||||
}) {
|
||||
BridgeMaterial.GRASS_PATH,
|
||||
BridgeMaterial.FARMLAND}) {
|
||||
addModel(mat, MODEL_XZ100_HEIGHT16_15);
|
||||
}
|
||||
|
||||
// Thin fence: Glass panes, iron bars.
|
||||
for (final Material mat : MaterialUtil.addBlocks(
|
||||
MaterialUtil.GLASS_PANES, BridgeMaterial.IRON_BARS)) {
|
||||
MaterialUtil.GLASS_PANES,
|
||||
BridgeMaterial.IRON_BARS)) {
|
||||
addModel(mat, MODEL_THIN_FENCE);
|
||||
}
|
||||
|
||||
@@ -253,9 +373,7 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
// Chests.
|
||||
// TOOD: Might add a facing/directional extension for double chests.
|
||||
for (Material mat : BridgeMaterial.getAllBlocks(
|
||||
"chest", "trapped_chest",
|
||||
"ender_chest"
|
||||
)) {
|
||||
"chest", "trapped_chest", "ender_chest")) {
|
||||
addModel(mat, MODEL_SINGLE_CHEST);
|
||||
}
|
||||
|
||||
@@ -271,30 +389,26 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
|
||||
// Turtle Eggs.
|
||||
for (Material mat : new Material[] {
|
||||
Material.TURTLE_EGG
|
||||
}) {
|
||||
addModel(mat, MODEL_TURTLE_EGG);
|
||||
Material.TURTLE_EGG}) {
|
||||
addModel(mat, MODEL_TURTLE_EGG);
|
||||
}
|
||||
|
||||
// Conduit
|
||||
for (Material mat : new Material[] {
|
||||
Material.CONDUIT
|
||||
}) {
|
||||
addModel(mat, MODEL_CONDUIT);
|
||||
Material.CONDUIT}) {
|
||||
addModel(mat, MODEL_CONDUIT);
|
||||
}
|
||||
|
||||
// Cocoa
|
||||
for (Material mat : new Material[] {
|
||||
Material.COCOA
|
||||
}) {
|
||||
addModel(mat, MODEL_COCOA);
|
||||
Material.COCOA}) {
|
||||
addModel(mat, MODEL_COCOA);
|
||||
}
|
||||
|
||||
// Sea Pickles
|
||||
for (Material mat : new Material[] {
|
||||
Material.SEA_PICKLE
|
||||
}) {
|
||||
addModel(mat, MODEL_SEA_PICKLE);
|
||||
Material.SEA_PICKLE}) {
|
||||
addModel(mat, MODEL_SEA_PICKLE);
|
||||
}
|
||||
|
||||
// Carpets.
|
||||
@@ -306,8 +420,10 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
for (final Material mat : MaterialUtil.HEADS_GROUND) {
|
||||
addModel(mat, MODEL_GROUND_HEAD);
|
||||
}
|
||||
|
||||
// Heads on walls.
|
||||
for (final Material mat : MaterialUtil.HEADS_WALL) {
|
||||
addModel(mat, MODEL_WALL_HEAD);
|
||||
addModel(mat, MODEL_WALL_HEAD);
|
||||
}
|
||||
|
||||
// Doors.
|
||||
@@ -322,51 +438,170 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
|
||||
// Chorus Plant.
|
||||
for (Material mat : new Material[] {
|
||||
Material.CHORUS_PLANT
|
||||
}) {
|
||||
addModel(mat, MODEL_CHORUS_PLANT);
|
||||
Material.CHORUS_PLANT}) {
|
||||
addModel(mat, MODEL_CHORUS_PLANT);
|
||||
}
|
||||
|
||||
//Lantern
|
||||
Material mt = BridgeMaterial.getBlock("lantern");
|
||||
if (mt != null) addModel(mt, MODEL_LANTERN);
|
||||
// Lantern.
|
||||
for (Material mat : BridgeMaterial.getAllBlocks(
|
||||
"lantern", "soul_lantern")) {
|
||||
addModel(mat, MODEL_LANTERN);
|
||||
}
|
||||
|
||||
// Piston.
|
||||
for (Material mat : BridgeMaterial.getAllBlocks(
|
||||
"piston", "sticky_piston", "piston_base", "piston_sticky_base")) {
|
||||
addModel(mat, MODEL_PISTON);
|
||||
}
|
||||
|
||||
// Piston Head.
|
||||
addModel(BridgeMaterial.PISTON_HEAD, MODEL_PISTON_HEAD);
|
||||
|
||||
// Snow.
|
||||
addModel(Material.SNOW, MODEL_SNOW);
|
||||
|
||||
// Levelled blocks.
|
||||
for (Material mat : MaterialUtil.WATER) {
|
||||
addModel(mat, MODEL_LEVELLED);
|
||||
}
|
||||
for (Material mat : MaterialUtil.LAVA) {
|
||||
addModel(mat, MODEL_LEVELLED);
|
||||
}
|
||||
|
||||
// Lectern
|
||||
mt = BridgeMaterial.getBlock("lectern");
|
||||
// All water plants
|
||||
for (Material mat : MaterialUtil.WATER_PLANTS) {
|
||||
addModel(mat, MODEL_WATER_PLANTS);
|
||||
}
|
||||
|
||||
// Rails.
|
||||
for (final Material mat : MaterialUtil.RAILS) {
|
||||
addModel(mat, MODEL_RAIL);
|
||||
}
|
||||
|
||||
// Walls.
|
||||
for (Material mat : MaterialUtil.ALL_WALLS) {
|
||||
BlockFlags.setBlockFlags(mat, BlockFlags.SOLID_GROUND | BlockFlags.F_VARIABLE);
|
||||
addModel(mat, MODEL_THICK_FENCE2);
|
||||
}
|
||||
|
||||
// Lectern.
|
||||
Material mt = BridgeMaterial.getBlock("lectern");
|
||||
if (mt != null) addModel(mt, MODEL_LECTERN);
|
||||
|
||||
// Bamboo
|
||||
|
||||
// PowderSnow.
|
||||
mt = BridgeMaterial.getBlock("powder_snow");
|
||||
if (mt != null) addModel(mt, MODEL_POWDER_SNOW);
|
||||
|
||||
// Bamboo.
|
||||
mt = BridgeMaterial.getBlock("bamboo");
|
||||
if (mt != null) addModel(mt, MODEL_BAMBOO);
|
||||
|
||||
// Bell
|
||||
|
||||
// Dripstone.
|
||||
mt = BridgeMaterial.getBlock("pointed_dripstone");
|
||||
if (mt != null) addModel(mt, MODEL_POINTED_DRIPSTONE);
|
||||
|
||||
// Bell.
|
||||
mt = BridgeMaterial.getBlock("bell");
|
||||
if (mt != null) addModel(mt, MODEL_BELL);
|
||||
|
||||
|
||||
// Composter.
|
||||
mt = BridgeMaterial.getBlock("composter");
|
||||
if (mt != null) addModel(mt, MODEL_COMPOSTER);
|
||||
|
||||
// Honey Block.
|
||||
mt = BridgeMaterial.getBlock("honey_block");
|
||||
if (mt != null) addModel(mt, MODEL_HONEY_BLOCK);
|
||||
|
||||
// Big DripLeaf.
|
||||
mt = BridgeMaterial.getBlock("big_dripleaf");
|
||||
if (mt != null) addModel(mt, MODEL_DRIP_LEAF);
|
||||
|
||||
// Grindstone.
|
||||
mt = BridgeMaterial.getBlock("grindstone");
|
||||
if (mt != null) addModel(mt, MODEL_GRIND_STONE);
|
||||
|
||||
// Sculk Shrieker
|
||||
mt = BridgeMaterial.getBlock("sculk_shrieker");
|
||||
if (mt != null) addModel(mt, MODEL_SCULK_SHRIEKER);
|
||||
|
||||
// Mud
|
||||
mt = BridgeMaterial.getBlock("mud");
|
||||
if (mt != null) addModel(mt, MODEL_XZ100_HEIGHT8_7);
|
||||
|
||||
// Heavy core
|
||||
mt = BridgeMaterial.getBlock("heavy_core");
|
||||
if (mt != null) addModel(mt, MODEL_GROUND_HEAD);
|
||||
|
||||
// Sort to processed by flags.
|
||||
for (final Material mat : Material.values()) {
|
||||
final long flags = BlockProperties.getBlockFlags(mat);
|
||||
final long flags = BlockFlags.getBlockFlags(mat);
|
||||
// Stairs.
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockProperties.F_STAIRS)) {
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockFlags.F_STAIRS)) {
|
||||
addModel(mat, MODEL_STAIRS);
|
||||
}
|
||||
// Fences.
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockProperties.F_THICK_FENCE)) {
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockProperties.F_PASSABLE_X4)) {
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockFlags.F_THICK_FENCE)) {
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockFlags.F_PASSABLE_X4)) {
|
||||
// TODO: Perhaps another model flag.
|
||||
addModel(mat, MODEL_GATE);
|
||||
}
|
||||
else {
|
||||
addModel(mat, MODEL_THICK_FENCE);
|
||||
}
|
||||
}
|
||||
// Walls
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockProperties.F_THICK_FENCE2)) {
|
||||
addModel(mat, MODEL_THICK_FENCE2);
|
||||
else addModel(mat, MODEL_THICK_FENCE);
|
||||
}
|
||||
}
|
||||
|
||||
super.setupBlockProperties(worldConfigProvider);
|
||||
}
|
||||
|
||||
private Object getHandle(Player player) {
|
||||
// TODO: CraftPlayer check (isAssignableFrom)?
|
||||
if (this.reflectLivingEntity == null || this.reflectLivingEntity.obcGetHandle == null) {
|
||||
return null;
|
||||
}
|
||||
return ReflectionUtil.invokeMethodNoArgs(this.reflectLivingEntity.obcGetHandle, player);
|
||||
}
|
||||
|
||||
private boolean canDealFallDamage() {
|
||||
return this.reflectLivingEntity != null && this.reflectLivingEntity.nmsDamageEntity != null
|
||||
&& (this.reflectDamageSource.nmsFALL != null || this.reflectDamageSources != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlmostBoolean dealFallDamageFiresAnEvent() {
|
||||
return canDealFallDamage() ? AlmostBoolean.YES : AlmostBoolean.NO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dealFallDamage(Player player, double damage) {
|
||||
if (canDealFallDamage()) {
|
||||
Object handle = getHandle(player);
|
||||
if (handle != null) {
|
||||
// Direct accessing DamageSource
|
||||
Object damageSource = this.reflectDamageSource.nmsFALL;
|
||||
if (damageSource == null) {
|
||||
// Fail, second attempt
|
||||
damageSource = this.reflectDamageSources.getDamageSource(handle);
|
||||
if (damageSource == null) {
|
||||
// Fail, deal generic damage
|
||||
BridgeHealth.damage(player, damage);
|
||||
// Disable class to prevent continuous damage
|
||||
reflectDamageSources = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
ReflectionUtil.invokeMethod(this.reflectLivingEntity.nmsDamageEntity, handle, damageSource, (float) damage);
|
||||
}
|
||||
}
|
||||
else BridgeHealth.damage(player, damage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean resetActiveItem(Player player) {
|
||||
if (this.reflectLivingEntity != null && this.reflectLivingEntity.nmsclearActiveItem != null) {
|
||||
Object handle = getHandle(player);
|
||||
if (handle != null) {
|
||||
ReflectionUtil.invokeMethodNoArgs(this.reflectLivingEntity.nmsclearActiveItem, handle);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+249
@@ -0,0 +1,249 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit;
|
||||
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.attribute.AttributeInstance;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.attribute.AttributeModifier.Operation;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.compat.AttribUtil;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.ClientVersion;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.ServerVersion;
|
||||
import fr.neatmonster.nocheatplus.components.modifier.IAttributeAccess;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.MaterialUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.math.MathUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.moving.Magic;
|
||||
|
||||
public class NSBukkitAttributeAccess implements IAttributeAccess {
|
||||
|
||||
public NSBukkitAttributeAccess() {
|
||||
if (ReflectionUtil.getClass("org.bukkit.attribute.AttributeInstance") == null) {
|
||||
throw new RuntimeException("Service not available.");
|
||||
}
|
||||
}
|
||||
|
||||
private int operationToInt(final Operation operation) {
|
||||
switch (operation) {
|
||||
case ADD_NUMBER:
|
||||
return 0;
|
||||
case ADD_SCALAR:
|
||||
return 1;
|
||||
case MULTIPLY_SCALAR_1:
|
||||
return 2;
|
||||
default:
|
||||
throw new RuntimeException("Unknown operation: " + operation);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The first modifier with the given id that can be found, or null if none
|
||||
* is found.
|
||||
*
|
||||
* @param attrInst
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
private AttributeModifier getModifier(final AttributeInstance attrInst, final NamespacedKey id) {
|
||||
for (final AttributeModifier mod : attrInst.getModifiers()) {
|
||||
if (id.equals(mod.getKey())) {
|
||||
return mod;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private double getMultiplier(final AttributeModifier mod) {
|
||||
return AttribUtil.getMultiplier(operationToInt(mod.getOperation()), mod.getAmount());
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSpeedMultiplier(final Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.MOVEMENT_SPEED);
|
||||
final double val = attrInst.getValue() / attrInst.getBaseValue();
|
||||
final AttributeModifier mod = getModifier(attrInst, AttribUtil.NSID_SPRINT_BOOST);
|
||||
return mod == null ? val : (val / getMultiplier(mod));
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSprintMultiplier(final Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.MOVEMENT_SPEED);
|
||||
final AttributeModifier mod = getModifier(attrInst, AttribUtil.NSID_SPRINT_BOOST);
|
||||
return mod == null ? 1.0 : getMultiplier(mod);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMovementSpeed(final Player player) {
|
||||
// / by 2 to get the base value 0.1f
|
||||
return (player.getWalkSpeed() / 2f) * (float) getSpeedMultiplier(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getGravity(final Player player) {
|
||||
double gravity;
|
||||
if (!BridgeMisc.hasGravity(player)) {
|
||||
return 0.0;
|
||||
}
|
||||
final PlayerMoveData thisMove = DataManager.getPlayerData(player).getGenericInstance(MovingData.class).playerMoves.getCurrentMove();
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.GRAVITY);
|
||||
// Fail-safe.
|
||||
if (attrInst == null) {
|
||||
gravity = thisMove.yDistance <= 0.0 && !Double.isInfinite(Bridge1_13.getSlowfallingAmplifier(player)) ? Magic.SLOW_FALL_GRAVITY : Magic.DEFAULT_GRAVITY;
|
||||
}
|
||||
else gravity = MathUtil.clamp(attrInst.getValue(), -1.0, 1.0);
|
||||
if (thisMove.yDistance <= 0.0 && !Double.isInfinite(Bridge1_13.getSlowfallingAmplifier(player))) {
|
||||
gravity = Math.min(gravity, Magic.SLOW_FALL_GRAVITY);
|
||||
}
|
||||
return gravity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSafeFallDistance(final Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.SAFE_FALL_DISTANCE);
|
||||
// Fail-safe
|
||||
if (attrInst == null) return Magic.FALL_DAMAGE_DIST;
|
||||
return MathUtil.clamp(attrInst.getValue(), -1024.0, 1024.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getFallDamageMultiplier(final Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.FALL_DAMAGE_MULTIPLIER);
|
||||
// Fail-safe
|
||||
if (attrInst == null) return 1.0;
|
||||
return MathUtil.clamp(attrInst.getValue(), 1.0, 100.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getBreakingSpeedMultiplier(final Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.BLOCK_BREAK_SPEED);
|
||||
// Fail-safe
|
||||
if (attrInst == null) return 1.0;
|
||||
return MathUtil.clamp(attrInst.getValue(), 1.0, 1024.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getJumpGainMultiplier(final Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.JUMP_STRENGTH);
|
||||
// Fail-safe
|
||||
if (attrInst == null) return 1.0;
|
||||
// Convert it to a multiplier, because we use our own handling for jumping motion.
|
||||
final double toMultiplier = attrInst.getValue() / attrInst.getBaseValue();
|
||||
return MathUtil.clamp(toMultiplier, 0.0, 76.19047619047619); // MathUtil.clamp(attrInst.getValue(), 0.0, 32.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerSneakingFactor(final Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.SNEAKING_SPEED);
|
||||
// Fail-safe.
|
||||
if (attrInst == null) return Magic.SNEAK_MULTIPLIER + BridgeEnchant.getSwiftSneakIncrement(player);
|
||||
return MathUtil.clamp(attrInst.getValue(), 0.0, 1.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerMaxBlockReach(final Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.INTERACTION_RANGE);
|
||||
// Fail-safe
|
||||
if (attrInst == null) return 4.5;
|
||||
return MathUtil.clamp(attrInst.getValue(), 0.0, 64.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerMaxAttackReach(final Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.ATTACK_RANGE);
|
||||
// Fail-safe
|
||||
if (attrInst == null) return 3.0;
|
||||
return MathUtil.clamp(attrInst.getValue(), 0.0, 64.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxStepUp(final Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.STEP_HEIGHT);
|
||||
if (attrInst == null) {
|
||||
// Fail-safe.
|
||||
if (player.isInsideVehicle()) {
|
||||
if (player.getVehicle() != null && MaterialUtil.isBoat(player.getVehicle().getType())) {
|
||||
return 0.0;
|
||||
}
|
||||
return 1.0;
|
||||
}
|
||||
final MovingConfig cc = DataManager.getPlayerData(player).getGenericInstance(MovingConfig.class);
|
||||
return cc.sfStepHeight;
|
||||
}
|
||||
return MathUtil.clamp(attrInst.getValue(), 0.0, 10.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMovementEfficiency(Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.MOVEMENT_EFFICIENCY);
|
||||
// Fail-safe.
|
||||
if (attrInst == null) return 0.0f;
|
||||
return (float) MathUtil.clamp(attrInst.getValue(), 0.0, 1.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWaterMovementEfficiency(Player player) {
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
if (pData.getClientVersion().isLowerThan(ClientVersion.V_1_8)) {
|
||||
// Doesn't exist.
|
||||
return 0f;
|
||||
}
|
||||
final float depthStrider = BridgeEnchant.getDepthStriderLevel(player);
|
||||
if (pData.getClientVersion().isLowerThan(ClientVersion.V_1_21)) {
|
||||
// Use the legacy method.
|
||||
return depthStrider;
|
||||
}
|
||||
if (ServerVersion.isLowerThan("1.21")) {
|
||||
// Simulate what ViaVersion does for newer (1.21 clients) on older (1.21-) servers.
|
||||
return depthStrider / 3.0f;
|
||||
}
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.WATER_MOVEMENT_EFFICIENCY);
|
||||
if (attrInst == null) return 0.0f;
|
||||
return (float) MathUtil.clamp(attrInst.getValue(), 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSubmergedMiningSpeedMultiplier(Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.SUBMERGED_MINING_SPEED);
|
||||
// Fail-safe.
|
||||
if (attrInst == null) return 1.0;
|
||||
return MathUtil.clamp(attrInst.getValue(), 0.0, 20.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMiningEfficiency(Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.MINING_EFFICIENCY);
|
||||
// Fail-safe.
|
||||
if (attrInst == null) return 0.0;
|
||||
return MathUtil.clamp(attrInst.getValue(), 0.0, 1024.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEntityScale(Player player) {
|
||||
final AttributeInstance attrInst = player.getAttribute(BridgeAttribute.SCALE);
|
||||
// Fail-safe.
|
||||
if (attrInst == null) return 1.0;
|
||||
return MathUtil.clamp(attrInst.getValue(), 0.0625, 16.0);
|
||||
|
||||
}
|
||||
}
|
||||
+24
-38
@@ -35,8 +35,7 @@ public abstract class AbstractBukkitCentered implements BukkitShapeModel {
|
||||
private final double length;
|
||||
protected final boolean invertFace;
|
||||
|
||||
public AbstractBukkitCentered(double inset, double length,
|
||||
boolean invertFace) {
|
||||
public AbstractBukkitCentered(double inset, double length, boolean invertFace) {
|
||||
// TODO: Might add a signature to specify minY and maxY (attach NWSE only).
|
||||
this.minDist = inset;
|
||||
this.maxDist = 1.0 - inset;
|
||||
@@ -47,47 +46,34 @@ public abstract class AbstractBukkitCentered implements BukkitShapeModel {
|
||||
protected abstract BlockFace getFacing(BlockData blockData);
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
|
||||
final BlockFace facing = invertFace
|
||||
? getFacing(blockData).getOppositeFace()
|
||||
: getFacing(blockData);
|
||||
// TODO: Evaluate if (some) faces need to be inverted.
|
||||
// End rod facing: the direction it points to.
|
||||
switch (facing) {
|
||||
case EAST:
|
||||
return new double[] {0.0, minDist, minDist,
|
||||
length, maxDist, maxDist};
|
||||
case WEST:
|
||||
return new double[] {1.0 - length, minDist, minDist,
|
||||
1.0, maxDist, maxDist};
|
||||
case SOUTH:
|
||||
return new double[] {minDist, minDist, 0.0,
|
||||
maxDist, maxDist, length};
|
||||
case NORTH:
|
||||
return new double[] {minDist, minDist, 1.0 - length,
|
||||
maxDist, maxDist, 1.0};
|
||||
case DOWN:
|
||||
return new double[] {minDist, 1.0 - length, minDist,
|
||||
maxDist, 1.0, maxDist};
|
||||
case UP:
|
||||
return new double[] {minDist, 0.0, minDist,
|
||||
maxDist, length, maxDist};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
final BlockFace facing = invertFace ? getFacing(blockData).getOppositeFace() : getFacing(blockData);
|
||||
// TODO: Evaluate if (some) faces need to be inverted.
|
||||
// End rod facing: the direction it points to.
|
||||
switch (facing) {
|
||||
case EAST:
|
||||
return new double[] {0.0, minDist, minDist, length, maxDist, maxDist};
|
||||
case WEST:
|
||||
return new double[] {1.0 - length, minDist, minDist, 1.0, maxDist, maxDist};
|
||||
case SOUTH:
|
||||
return new double[] {minDist, minDist, 0.0, maxDist, maxDist, length};
|
||||
case NORTH:
|
||||
return new double[] {minDist, minDist, 1.0 - length, maxDist, maxDist, 1.0};
|
||||
case DOWN:
|
||||
return new double[] {minDist, 1.0 - length, minDist, maxDist, 1.0, maxDist};
|
||||
case UP:
|
||||
return new double[] {minDist, 0.0, minDist, maxDist, length, maxDist};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+26
-18
@@ -25,31 +25,39 @@ import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
public class BukkitAnvil implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof Directional) {
|
||||
BlockFace face = ((Directional) blockData).getFacing();
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
return new double[] {0.1815, 0.0, 0.0, 1.0 - 0.1815, 1.0, 1.0};
|
||||
case WEST:
|
||||
case EAST:
|
||||
return new double[] {0.0, 0.0, 0.1815, 1.0, 1.0, 1.0 - 0.1815};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
BlockFace face = ((Directional) blockData).getFacing();
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
return new double[] {
|
||||
// Bottom
|
||||
0.125, 0.0, 0.125, 0.875, 0.25, 0.875,
|
||||
// Top
|
||||
0.1875, 0.625, 0.0, 0.8125, 1.0, 1.0
|
||||
// Body... maybe not need
|
||||
};
|
||||
case WEST:
|
||||
case EAST:
|
||||
return new double[] {
|
||||
// Bottom
|
||||
0.125, 0.0, 0.125, 0.875, 0.25, 0.875,
|
||||
// Top
|
||||
0.0, 0.625, 0.1875, 1.0, 1.0, 0.8125
|
||||
// Body... maybe not need
|
||||
};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+38
-23
@@ -14,38 +14,53 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.location.LocUtil;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.Bamboo;
|
||||
|
||||
public class BukkitBamboo implements BukkitShapeModel {
|
||||
private DecimalFormat df = new DecimalFormat("#.000");
|
||||
private final double xz = 0.375;
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
if (blockCache.getPlayerData() != null && blockCache.getPlayerData().isBedrockPlayer()) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof Bamboo) {
|
||||
Bamboo b = (Bamboo) blockData;
|
||||
double thickness = 0.125;
|
||||
if (b.getAge() > 0) thickness += 0.0625;
|
||||
long a = LocUtil.randomSeedBedrock(x, 0, z);
|
||||
long a1 = a * 2863311531L;
|
||||
long rdx = (a1 >> 32) & 0xFFFFFFFFL;
|
||||
//long rax = a1 & 0xFFFFFFFFL;
|
||||
rdx >>=3;rdx *=3;
|
||||
rdx = (rdx << 2) & 0xFFFFFFFFL;
|
||||
double xOffset = a - rdx + 1;
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
|
||||
double minX = Math.abs(block.getBoundingBox().getMinX()) - Math.abs((int) block.getBoundingBox().getMinX());
|
||||
double minZ = Math.abs(block.getBoundingBox().getMinZ()) - Math.abs((int) block.getBoundingBox().getMinZ());
|
||||
|
||||
minX = Double.parseDouble(df.format(minX));
|
||||
minZ = Double.parseDouble(df.format(minZ));
|
||||
|
||||
//return new double[] {1.0 - minX + 0.09, 0.0, minZ + 0.09, 1.0 - minX + xz - 0.09, 1.0, minZ + xz - 0.09}; (1)
|
||||
//return new double[] {minX + 0.09, 0.0, 1.0 - minZ + 0.09, minX + xz - 0.09, 1.0, 1.0 - minZ + xz - 0.09}; (2)
|
||||
// (1) + (2) =>
|
||||
return new double[] {1.0 - minX + 0.09, 0.0, 1.0 - minZ + 0.09, 1.0 - minX + xz - 0.09, 1.0, 1.0 - minZ + xz - 0.09};
|
||||
a >>=8;
|
||||
long a2 = a;
|
||||
a *= 2863311531L;
|
||||
rdx = (a >> 32) & 0xFFFFFFFFL;
|
||||
rdx >>=3;rdx *=3;
|
||||
rdx = (rdx << 2) & 0xFFFFFFFFL;
|
||||
double zOffset = a2 - rdx +1;
|
||||
xOffset *= 0.0625;
|
||||
zOffset *= 0.0625;
|
||||
return new double[] {xOffset, 0, zOffset, xOffset + thickness, 1.0, zOffset + thickness};
|
||||
}
|
||||
}
|
||||
long i = LocUtil.randomSeedJava(x, 0, z);
|
||||
final double xOffset = (((i & 15L) / 15.0F) - 0.5D) * 0.5D;
|
||||
final double zOffset = (((i >> 8 & 15L) / 15.0F) - 0.5D) * 0.5D;
|
||||
return new double[] {0.40625 + xOffset, 0.0, 0.40625 + zOffset, 0.59375 + xOffset, 1.0, 0.59375 + zOffset};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+89
-52
@@ -19,71 +19,108 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.Bell;
|
||||
import org.bukkit.block.data.type.Bell.Attachment;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitBell implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof Bell) {
|
||||
Bell b = (Bell) blockData;
|
||||
BlockFace face = b.getFacing();
|
||||
switch (b.getAttachment()) {
|
||||
case CEILING: return new double[] {0.25, 1-0.75, 0.25, 0.75, 1.0, 0.75};
|
||||
case DOUBLE_WALL:
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
return new double[] {0.25, 0.375, 0.0, 0.75, 0.9375, 1.0};
|
||||
case WEST:
|
||||
case EAST:
|
||||
return new double[] {0.0, 0.375, 0.25, 1.0, 0.9375, 0.75};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case FLOOR:
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
return new double[] {0.0, 0.0, 0.25, 1.0, 1.0, 0.75};
|
||||
case WEST:
|
||||
case EAST:
|
||||
return new double[] {0.25, 0.0, 0.0, 0.75, 1.0, 1.0};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SINGLE_WALL:
|
||||
switch (face) {
|
||||
case NORTH: return new double[] {0.25, 0.375, 0.0, 0.75, 0.9375, 1 - 0.1875};
|
||||
case SOUTH: return new double[] {0.25, 0.375, 0.1875, 0.75, 0.9375, 1.0};
|
||||
case WEST: return new double[] {0.0, 0.375, 0.25, 1.0 - 0.1875, 0.9375, 0.75};
|
||||
case EAST: return new double[] {0.1875, 0.375, 0.25, 1.0, 0.9375, 0.75};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
Bell b = (Bell) blockData;
|
||||
BlockFace face = b.getFacing();
|
||||
switch (b.getAttachment()) {
|
||||
case CEILING:
|
||||
return new double[] {0.25, 1 - 0.75, 0.25, 0.75, 1.0, 0.75};
|
||||
case DOUBLE_WALL:
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
return new double[] {
|
||||
// Bottom bell
|
||||
0.25, 0.25, 0.25, 0.75, 0.375, 0.75,
|
||||
// Body
|
||||
0.3125, 0.375, 0.3125, 0.6875, 0.8125, 0.6875,
|
||||
// Stick holding the bell
|
||||
0.4375, 0.8125, 0.0, 0.5625, 0.9375, 1.0
|
||||
//0.0, 0.8125, 0.4375, 1.0, 0.9375, 0.5625
|
||||
};
|
||||
case WEST:
|
||||
case EAST:
|
||||
return new double[] {
|
||||
// Bottom bell
|
||||
0.25, 0.25, 0.25, 0.75, 0.375, 0.75,
|
||||
// Body
|
||||
0.3125, 0.375, 0.3125, 0.6875, 0.8125, 0.6875,
|
||||
// Stick holding the bell
|
||||
0.0, 0.8125, 0.4375, 1.0, 0.9375, 0.5625
|
||||
};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case FLOOR:
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
return new double[] {0.0, 0.0, 0.25, 1.0, 1.0, 0.75};
|
||||
case WEST:
|
||||
case EAST:
|
||||
return new double[] {0.25, 0.0, 0.0, 0.75, 1.0, 1.0};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SINGLE_WALL:
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
return new double[] {
|
||||
// Bottom bell
|
||||
0.25, 0.25, 0.25, 0.75, 0.375, 0.75,
|
||||
// Body
|
||||
0.3125, 0.375, 0.3125, 0.6875, 0.8125, 0.6875,
|
||||
// Stick holding the bell
|
||||
0.4375, 0.8125, 0.0, 0.5625, 0.9375, 0.8125
|
||||
};
|
||||
case SOUTH:
|
||||
return new double[] {
|
||||
// Bottom bell
|
||||
0.25, 0.25, 0.25, 0.75, 0.375, 0.75,
|
||||
// Body
|
||||
0.3125, 0.375, 0.3125, 0.6875, 0.8125, 0.6875,
|
||||
// Stick holding the bell
|
||||
0.4375, 0.8125, 0.1875, 0.5625, 0.9375, 1.0
|
||||
};
|
||||
case WEST:
|
||||
return new double[] {
|
||||
// Bottom bell
|
||||
0.25, 0.25, 0.25, 0.75, 0.375, 0.75,
|
||||
// Body
|
||||
0.3125, 0.375, 0.3125, 0.6875, 0.8125, 0.6875,
|
||||
// Stick holding the bell
|
||||
0.0, 0.8125, 0.4375, 0.8125, 0.9375, 0.5625
|
||||
};
|
||||
case EAST:
|
||||
return new double[] {
|
||||
// Bottom bell
|
||||
0.25, 0.25, 0.25, 0.75, 0.375, 0.75,
|
||||
// Body
|
||||
0.3125, 0.375, 0.3125, 0.6875, 0.8125, 0.6875,
|
||||
// Stick holding the bell
|
||||
0.1875, 0.8125, 0.4375, 1.0, 0.9375, 0.5625
|
||||
};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof Bell) {
|
||||
Bell b = (Bell) blockData;
|
||||
if (b.getAttachment() == Attachment.SINGLE_WALL) return 0x4;
|
||||
}
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.Cake;
|
||||
import org.bukkit.util.BoundingBox;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitCake implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
if (Bridge1_13.hasBoundingBox()) {
|
||||
BoundingBox bd = block.getBoundingBox();
|
||||
return new double[] {bd.getMinX()-x, bd.getMinY()-y, bd.getMinZ()-z, bd.getMaxX()-x, bd.getMaxY()-y, bd.getMaxZ()-z};
|
||||
}
|
||||
|
||||
final BlockData blockData = block.getState().getBlockData();
|
||||
if (blockData instanceof Cake) {
|
||||
final Cake cake = (Cake) blockData;
|
||||
return new double[] {0.0625 + cake.getBites() * 0.125, 0.0, 0.0625, 0.9375, 0.5, 0.9375};
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitCauldron implements BukkitShapeModel {
|
||||
private final double[] bounds;
|
||||
|
||||
public BukkitCauldron(double minY, double sideWidth, double sideHeight, double coreHeight) {
|
||||
bounds = new double[] {
|
||||
// Core
|
||||
sideWidth, minY, sideWidth, 1 - sideWidth, minY + coreHeight, 1 - sideWidth,
|
||||
// 4 side
|
||||
0.0, minY, 0.0, 1.0, minY + sideHeight, sideWidth,
|
||||
0.0, minY, 1.0 - sideWidth, 1.0, minY + sideHeight, 1.0,
|
||||
0.0, minY, 0.0, sideWidth, minY + sideHeight, 1.0,
|
||||
1.0 - sideWidth, minY, 0.0, 1.0, minY + sideHeight, 1.0
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] getShape(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
return bounds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+30
-28
@@ -19,53 +19,55 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.MultipleFacing;
|
||||
import org.bukkit.util.BoundingBox;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitChorusPlant implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
if (Bridge1_13.hasBoundingBox()) {
|
||||
BoundingBox bd = block.getBoundingBox();
|
||||
return new double[] {bd.getMinX()-x, 0.1875, bd.getMinZ()-z, bd.getMaxX()-x, bd.getMaxY()-y, bd.getMaxZ()-z};
|
||||
}
|
||||
|
||||
final BlockData blockData = block.getBlockData();
|
||||
double[] res = new double[] {0.187, 0.188, 0.187, 1.0 - 0.187, 0.8125, 1.0 - 0.187};
|
||||
if (blockData instanceof MultipleFacing) {
|
||||
final MultipleFacing chorusplant = (MultipleFacing) blockData;
|
||||
for (final BlockFace face : chorusplant.getFaces()) {
|
||||
switch (face) {
|
||||
//case DOWN:
|
||||
// res[1]=0.0;
|
||||
// break;
|
||||
case UP:
|
||||
res[4]=1.0;
|
||||
break;
|
||||
case SOUTH:
|
||||
res[5]=1.0;
|
||||
break;
|
||||
case NORTH:
|
||||
res[2]=0.0;
|
||||
break;
|
||||
case WEST:
|
||||
res[0]=0.0;
|
||||
break;
|
||||
case EAST:
|
||||
res[3]=1.0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
//case DOWN:
|
||||
// res[1]=0.0;
|
||||
// break;
|
||||
case UP:
|
||||
res[4]=1.0;
|
||||
break;
|
||||
case SOUTH:
|
||||
res[5]=1.0;
|
||||
break;
|
||||
case NORTH:
|
||||
res[2]=0.0;
|
||||
break;
|
||||
case WEST:
|
||||
res[0]=0.0;
|
||||
break;
|
||||
case EAST:
|
||||
res[3]=1.0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+41
-37
@@ -21,72 +21,76 @@ import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Directional;
|
||||
import org.bukkit.block.data.type.Cocoa;
|
||||
import org.bukkit.util.BoundingBox;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitCocoa implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
if (Bridge1_13.hasBoundingBox()) {
|
||||
BoundingBox bd = block.getBoundingBox();
|
||||
return new double[] {bd.getMinX()-x, bd.getMinY()-y, bd.getMinZ()-z, bd.getMaxX()-x, bd.getMaxY()-y, bd.getMaxZ()-z};
|
||||
}
|
||||
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
|
||||
if (blockData instanceof Cocoa && blockData instanceof Directional) {
|
||||
BlockFace face = ((Directional) blockData).getFacing();
|
||||
final Cocoa cocoa = (Cocoa) blockData;
|
||||
switch (cocoa.getAge()) {
|
||||
case 0: // .625 .4375 .0625 max: .375 .75 .3125
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
return new double[] {0.375, 0.4375, 0.0, 0.625, 0.75, 0.315};
|
||||
case SOUTH:
|
||||
return new double[] {0.375, 0.4375, 0.685, 0.625, 0.75, 1.0};
|
||||
case WEST:
|
||||
return new double[] {0.0, 0.4375, 0.375, 0.315, 0.75, 0.625};
|
||||
case EAST:
|
||||
return new double[] {0.685, 0.4375, 0.375, 1.0, 0.75, 0.625};
|
||||
default:
|
||||
break;
|
||||
case NORTH:
|
||||
return new double[] {0.375, 0.4375, 0.0, 0.625, 0.75, 0.315};
|
||||
case SOUTH:
|
||||
return new double[] {0.375, 0.4375, 0.685, 0.625, 0.75, 1.0};
|
||||
case WEST:
|
||||
return new double[] {0.0, 0.4375, 0.375, 0.315, 0.75, 0.625};
|
||||
case EAST:
|
||||
return new double[] {0.685, 0.4375, 0.375, 1.0, 0.75, 0.625};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1: // .6875 .3125 .0625 max: .3125 .75 .4375
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
return new double[] {0.3125, 0.3125, 0.0, 0.6875, 0.75, 0.4375};
|
||||
case SOUTH:
|
||||
return new double[] {0.3125, 0.3125, 0.5625, 0.6875, 0.75, 1.0};
|
||||
case WEST:
|
||||
return new double[] {0.0, 0.3125, 0.3125, 0.4375, 0.75, 0.6875};
|
||||
case EAST:
|
||||
return new double[] {0.5625, 0.3125, 0.3125, 1.0, 0.75, 0.6875};
|
||||
default:
|
||||
break;
|
||||
case NORTH:
|
||||
return new double[] {0.3125, 0.3125, 0.0, 0.6875, 0.75, 0.4375};
|
||||
case SOUTH:
|
||||
return new double[] {0.3125, 0.3125, 0.5625, 0.6875, 0.75, 1.0};
|
||||
case WEST:
|
||||
return new double[] {0.0, 0.3125, 0.3125, 0.4375, 0.75, 0.6875};
|
||||
case EAST:
|
||||
return new double[] {0.5625, 0.3125, 0.3125, 1.0, 0.75, 0.6875};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2: // .75 .1875 .0625 max: .25 .75 .5625
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
return new double[] {0.25, 0.1875, 0.0, 0.75, 0.75, 0.5625};
|
||||
case SOUTH:
|
||||
return new double[] {0.25, 0.1875, 0.4375, 0.75, 0.75, 1.0};
|
||||
case WEST:
|
||||
return new double[] {0.0, 0.1875, 0.25, 0.5625, 0.75, 0.75};
|
||||
case EAST:
|
||||
return new double[] {0.4375, 0.1875, 0.25, 1.0, 0.75, 0.75};
|
||||
default:
|
||||
break;
|
||||
case NORTH:
|
||||
return new double[] {0.25, 0.1875, 0.0, 0.75, 0.75, 0.5625};
|
||||
case SOUTH:
|
||||
return new double[] {0.25, 0.1875, 0.4375, 0.75, 0.75, 1.0};
|
||||
case WEST:
|
||||
return new double[] {0.0, 0.1875, 0.25, 0.5625, 0.75, 0.75};
|
||||
case EAST:
|
||||
return new double[] {0.4375, 0.1875, 0.25, 1.0, 0.75, 0.75};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//break; ?
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+2
-5
@@ -30,9 +30,6 @@ public class BukkitDirectionalCentered extends AbstractBukkitCentered {
|
||||
if (blockData instanceof Directional) {
|
||||
return ((Directional) blockData).getFacing();
|
||||
}
|
||||
else {
|
||||
return BlockFace.SELF;
|
||||
}
|
||||
return BlockFace.SELF;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+22
-48
@@ -34,9 +34,7 @@ public class BukkitDoor implements BukkitShapeModel {
|
||||
* @return The block face of the block the door is standing on, indicating
|
||||
* where the door is.
|
||||
*/
|
||||
private static final BlockFace getWhereTheDoorIsFace(
|
||||
final BlockFace facing, final Hinge hinge,
|
||||
final boolean isOpen) {
|
||||
private static final BlockFace getWhereTheDoorIsFace(final BlockFace facing, final Hinge hinge, final boolean isOpen) {
|
||||
// For idiots:
|
||||
/*
|
||||
* Facing: Door is closing the opposite side of the block, so the
|
||||
@@ -45,9 +43,6 @@ public class BukkitDoor implements BukkitShapeModel {
|
||||
/*
|
||||
* Hinge: Looking into the facing direction, hinge is left or right.
|
||||
*/
|
||||
// Bukkit.getServer().broadcastMessage("hinge=" + hinge
|
||||
// + " / facing=" + facing
|
||||
// + " / open=" + isOpen);
|
||||
// Let's play north and south:
|
||||
switch (facing) {
|
||||
case NORTH:
|
||||
@@ -55,49 +50,33 @@ public class BukkitDoor implements BukkitShapeModel {
|
||||
if (hinge == Hinge.LEFT) {
|
||||
return BlockFace.WEST;
|
||||
}
|
||||
else {
|
||||
return BlockFace.EAST;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return BlockFace.SOUTH;
|
||||
return BlockFace.EAST;
|
||||
}
|
||||
return BlockFace.SOUTH;
|
||||
case SOUTH:
|
||||
if (isOpen) {
|
||||
if (hinge == Hinge.LEFT) {
|
||||
return BlockFace.EAST;
|
||||
}
|
||||
else {
|
||||
return BlockFace.WEST;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return BlockFace.NORTH;
|
||||
return BlockFace.WEST;
|
||||
}
|
||||
return BlockFace.NORTH;
|
||||
case EAST:
|
||||
if (isOpen) {
|
||||
if (hinge == Hinge.LEFT) {
|
||||
return BlockFace.NORTH;
|
||||
}
|
||||
else {
|
||||
return BlockFace.SOUTH;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return BlockFace.WEST;
|
||||
return BlockFace.SOUTH;
|
||||
}
|
||||
return BlockFace.WEST;
|
||||
case WEST:
|
||||
if (isOpen) {
|
||||
if (hinge == Hinge.LEFT) {
|
||||
return BlockFace.SOUTH;
|
||||
}
|
||||
else {
|
||||
return BlockFace.NORTH;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return BlockFace.EAST;
|
||||
return BlockFace.NORTH;
|
||||
}
|
||||
return BlockFace.EAST;
|
||||
default:
|
||||
// Invalid
|
||||
return BlockFace.SELF;
|
||||
@@ -108,8 +87,7 @@ public class BukkitDoor implements BukkitShapeModel {
|
||||
private static final double doorWidthOpen = 0.1875;
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
@@ -117,28 +95,24 @@ public class BukkitDoor implements BukkitShapeModel {
|
||||
final Door door = (Door) blockData;
|
||||
final boolean isOpen = door.isOpen();
|
||||
final double doorWidth = doorWidthOpen; // isOpen ? doorWidthOpen : doorWidthClosed;
|
||||
switch(getWhereTheDoorIsFace(door.getFacing(),
|
||||
door.getHinge(), isOpen)) {
|
||||
case NORTH:
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, doorWidth};
|
||||
case SOUTH:
|
||||
return new double[] {0.0, 0.0, 1.0 - doorWidth, 1.0, 1.0, 1.0};
|
||||
case EAST:
|
||||
return new double[] {1.0 - doorWidth, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
case WEST:
|
||||
return new double[] {0.0, 0.0, 0.0, doorWidth, 1.0, 1.0};
|
||||
default:
|
||||
break;
|
||||
switch (getWhereTheDoorIsFace(door.getFacing(), door.getHinge(), isOpen)) {
|
||||
case NORTH:
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, doorWidth};
|
||||
case SOUTH:
|
||||
return new double[] {0.0, 0.0, 1.0 - doorWidth, 1.0, 1.0, 1.0};
|
||||
case EAST:
|
||||
return new double[] {1.0 - doorWidth, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
case WEST:
|
||||
return new double[] {0.0, 0.0, 0.0, doorWidth, 1.0, 1.0};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.BigDripleaf;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitDripLeaf implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getState().getBlockData();
|
||||
double[] res = {0.0, 0.6875, 0.0, 1.0, 0.9375, 1.0};
|
||||
if (blockData instanceof BigDripleaf) {
|
||||
final BigDripleaf dripLeaf = (BigDripleaf) blockData;
|
||||
switch(dripLeaf.getTilt()) {
|
||||
case PARTIAL:
|
||||
res[4] -= 0.125;
|
||||
return res;
|
||||
case UNSTABLE:
|
||||
// WORKAROUND: Zero this bounding box if the tilt is unstable [NCP should take care of ground judgement then]
|
||||
return new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
|
||||
case NONE:
|
||||
return res;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.location.LocUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import fr.neatmonster.nocheatplus.utilities.math.MathUtil;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.PointedDripstone;
|
||||
|
||||
public class BukkitDripStone implements BukkitShapeModel {
|
||||
private static final double[] TIP_MERGE = {0.3125, 0.0, 0.3125, 0.6875, 1.0, 0.6875};
|
||||
private static final double[] TIP_DOWN = {0.3125, 0.3125, 0.3125, 0.6875, 1.0, 0.6875};
|
||||
private static final double[] TIP_UP = {0.3125, 0.0, 0.3125, 0.6875, 0.6875, 0.6875};
|
||||
private static final double[] FRUSTUM = {0.25, 0.0, 0.25, 0.75, 1.0, 0.75};
|
||||
private static final double[] MIDDLE = {0.1875, 0.0, 0.1875, 0.8125, 1.0, 0.8125};
|
||||
private static final double[] BASE = {0.125, 0.0, 0.125, 0.875, 1.0, 0.875};
|
||||
|
||||
@Override
|
||||
public double[] getShape(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof PointedDripstone) {
|
||||
boolean bedrock = blockCache.getPlayerData() != null && blockCache.getPlayerData().isBedrockPlayer();
|
||||
final long randomseed = bedrock ? LocUtil.randomSeedBedrock(x, 0, z) : LocUtil.randomSeedJava(x, 0, z);
|
||||
double xOffset = MathUtil.clamp(calcOffset(randomseed, false, bedrock), -0.125, 0.125);
|
||||
double zOffset = MathUtil.clamp(calcOffset(randomseed, true, bedrock), -0.125, 0.125);
|
||||
PointedDripstone pds = (PointedDripstone) blockData;
|
||||
switch (pds.getThickness()) {
|
||||
case TIP_MERGE:
|
||||
return offset(TIP_MERGE, xOffset, 0, zOffset);
|
||||
case TIP:
|
||||
if (pds.getVerticalDirection() == BlockFace.DOWN) {
|
||||
return offset(TIP_DOWN, xOffset, 0, zOffset);
|
||||
} else {
|
||||
return offset(TIP_UP, xOffset, 0, zOffset);
|
||||
}
|
||||
case FRUSTUM:
|
||||
return offset(FRUSTUM, xOffset, 0, zOffset);
|
||||
case MIDDLE:
|
||||
return offset(MIDDLE, xOffset, 0, zOffset);
|
||||
default:
|
||||
return offset(BASE, xOffset, 0, zOffset);
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
private float calcOffset(long x, boolean shift, boolean bedrock) {
|
||||
if (shift) x >>=8;
|
||||
x &= 0xFL;
|
||||
float b = x;
|
||||
if (bedrock) {
|
||||
b *= 0.0333333f;
|
||||
b -= 0.25f;
|
||||
} else {
|
||||
b /= 15f;
|
||||
b -= 0.5f;
|
||||
b *= 0.5f;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
private double[] offset(double[] input, double x, double y, double z) {
|
||||
return new double[] {input[0] + x, input[1] + y, input[2] + z, input[3] + x, input[4] + y, input[5] + z};
|
||||
}
|
||||
}
|
||||
+11
-21
@@ -25,33 +25,23 @@ import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
public class BukkitEndPortalFrame implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
if (blockData instanceof EndPortalFrame) {
|
||||
return ((EndPortalFrame) blockData).hasEye()
|
||||
? new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0}
|
||||
: new double[] {0.0, 0.0, 0.0, 1.0, 0.8125, 1.0};
|
||||
}
|
||||
else {
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
return getShape(((EndPortalFrame) blockData).hasEye());
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
private double[] getShape(boolean hasEye) {
|
||||
return hasEye ? new double[] {0.0, 0.0, 0.0, 1.0, 0.8125, 1.0, 0.25, 0.8125, 0.25, 0.75, 1.0, 0.75}
|
||||
: new double[] {0.0, 0.0, 0.0, 1.0, 0.8125, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
if (blockData instanceof EndPortalFrame) {
|
||||
return ((EndPortalFrame) blockData).hasEye() ? 0x4 : 0;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+3
-10
@@ -40,13 +40,10 @@ public class BukkitFence implements BukkitShapeModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
// 13749998807909
|
||||
// 86250001192093
|
||||
// 0.1375, 0.8625
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
@@ -77,15 +74,11 @@ public class BukkitFence implements BukkitShapeModel {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.util.BoundingBox;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitFetchableBound implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
BoundingBox box = block.getBoundingBox();
|
||||
return new double[] {box.getMinX()-x, box.getMinY()-y, box.getMinZ()-z, box.getMaxX()-x, box.getMaxY()-y, box.getMaxZ()-z};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.util.BoundingBox;
|
||||
import org.bukkit.util.VoxelShape;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.collision.AxisAlignedBBUtils;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitFetchableBounds implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final VoxelShape blockshape = block.getCollisionShape();
|
||||
double[] res = {};
|
||||
for (BoundingBox box : blockshape.getBoundingBoxes()) {
|
||||
res = add(res, AxisAlignedBBUtils.toArray(box));
|
||||
}
|
||||
if (res.length == 0) return null;
|
||||
return res;
|
||||
}
|
||||
|
||||
private double[] add(final double[] array1, final double[] array2) {
|
||||
final double[] newArray = new double[array1.length + array2.length];
|
||||
System.arraycopy(array1, 0, newArray, 0, array1.length);
|
||||
System.arraycopy(array2, 0, newArray, array1.length, array2.length);
|
||||
return newArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+4
-9
@@ -40,8 +40,7 @@ public class BukkitGate implements BukkitShapeModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
@@ -63,17 +62,13 @@ public class BukkitGate implements BukkitShapeModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
if (blockData instanceof Openable) {
|
||||
return ((Openable) blockData).isOpen() ? 0x4 : 0;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.Grindstone;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitGrindStone implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getState().getBlockData();
|
||||
if (blockData instanceof Grindstone) {
|
||||
final Grindstone grindstone = (Grindstone) blockData;
|
||||
final BlockFace facing = grindstone.getFacing();
|
||||
switch (grindstone.getAttachedFace()) {
|
||||
case CEILING:
|
||||
switch (facing) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
return new double[] {0.125, 0.5625, 0.375, 0.25, 1.0, 0.625,
|
||||
0.75, 0.5625, 0.375, 0.875, 1.0, 0.625,
|
||||
0.125, 0.1875, 0.3125, 0.25, 0.5625, 0.6875,
|
||||
0.75, 0.1875, 0.3125, 0.875, 0.5625, 0.6875,
|
||||
0.25, 0.0, 0.125, 0.75, 0.75, 0.875};
|
||||
case EAST:
|
||||
case WEST:
|
||||
return new double[] {0.375, 0.5625, 0.125, 0.625, 1.0, 0.25,
|
||||
0.375, 0.5625, 0.75, 0.625, 1.0, 0.875,
|
||||
0.3125, 0.1875, 0.125, 0.6875, 0.5625, 0.25,
|
||||
0.3125, 0.1875, 0.75, 0.6875, 0.5625, 0.875,
|
||||
0.125, 0.0, 0.25, 0.875, 0.75, 0.75};
|
||||
|
||||
default:
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
case FLOOR:
|
||||
switch (facing) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
return new double[] {0.125, 0.0, 0.375, 0.25, 0.4375, 0.625,
|
||||
0.75, 0.0, 0.375, 0.875, 0.4375, 0.625,
|
||||
0.125, 0.4375, 0.3125, 0.25, 0.8125, 0.6875,
|
||||
0.75, 0.4375, 0.3125, 0.875, 0.8125, 0.6875,
|
||||
0.25, 0.25, 0.125, 0.75, 1.0, 0.875};
|
||||
case EAST:
|
||||
case WEST:
|
||||
return new double[] {0.375, 0.0, 0.125, 0.625, 0.4375, 0.25,
|
||||
0.375, 0.0, 0.75, 0.625, 0.4375, 0.875,
|
||||
0.3125, 0.4375, 0.125, 0.6875, 0.8125, 0.25,
|
||||
0.3125, 0.4375, 0.75, 0.6875, 0.8125, 0.875,
|
||||
0.125, 0.25, 0.25, 0.875, 1.0, 0.75};
|
||||
|
||||
default:
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
case WALL:
|
||||
switch (facing) {
|
||||
case NORTH:
|
||||
return new double[] {0.125, 0.375, 0.4375, 0.25, 0.625, 1.0,
|
||||
0.75, 0.375, 0.4375, 0.875, 0.625, 1.0,
|
||||
0.125, 0.3125, 0.1875, 0.25, 0.6875, 0.5625,
|
||||
0.75, 0.3125, 0.1875, 0.875, 0.6875, 0.5625,
|
||||
0.25, 0.125, 0.0, 0.75, 0.875, 0.75};
|
||||
case SOUTH:
|
||||
return new double[] {0.125, 0.375, 0.0, 0.25, 0.625, 0.4375,
|
||||
0.75, 0.375, 0.0, 0.875, 0.625, 0.4375,
|
||||
0.125, 0.3125, 0.4375, 0.25, 0.6875, 0.8125,
|
||||
0.75, 0.3125, 0.4375, 0.875, 0.6875, 0.8125,
|
||||
0.25, 0.125, 0.25, 0.75, 0.875, 1.0};
|
||||
case EAST:
|
||||
return new double[] {0.0, 0.375, 0.125, 0.5625, 0.625, 0.25,
|
||||
0.0, 0.375, 0.75, 0.5625, 0.625, 0.875,
|
||||
0.4375, 0.3125, 0.125, 0.8125, 0.6875, 0.25,
|
||||
0.4375, 0.3125, 0.75, 0.8125, 0.6875, 0.875,
|
||||
0.25, 0.125, 0.25, 1.0, 0.875, 0.75};
|
||||
case WEST:
|
||||
return new double[] {0.4375, 0.375, 0.125, 1.0, 0.625, 0.25,
|
||||
0.4375, 0.375, 0.75, 1.0, 0.625, 0.875,
|
||||
0.1875, 0.3125, 0.125, 0.5625, 0.6875, 0.25,
|
||||
0.1875, 0.3125, 0.75, 0.5625, 0.6875, 0.875,
|
||||
0.0, 0.125, 0.25, 0.75, 0.875, 0.75};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Directional;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitHopper implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof Directional) {
|
||||
Directional b = (Directional) blockData;
|
||||
BlockFace face = b.getFacing();
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
return new double[] {
|
||||
// Standing inside
|
||||
0.0, 0.625, 0.0, 1.0, 0.6875, 1.0,
|
||||
// Middle
|
||||
0.25, 0.25, 0.25, 0.75, 0.625, 0.75,
|
||||
// Bottom
|
||||
0.375, 0.25, 0.0, 0.625, 0.5, 0.25,
|
||||
// Top
|
||||
0.0, 0.6875, 0.0, 1.0, 1.0, 1.0
|
||||
// 4 sides of hopper (top)
|
||||
//0.0, 0.6875, 0.0, 1.0, 1.0, 0.125,
|
||||
//0.0, 0.6875, 0.875, 1.0, 1.0, 1.0,
|
||||
//0.0, 0.6875, 0.0, 0.125, 1.0, 1.0,
|
||||
//0.875, 0.6875, 0.0, 1.0, 1.0, 1.0,
|
||||
};
|
||||
case SOUTH:
|
||||
return new double[] {
|
||||
// Standing inside
|
||||
0.0, 0.625, 0.0, 1.0, 0.6875, 1.0,
|
||||
// Middle
|
||||
0.25, 0.25, 0.25, 0.75, 0.625, 0.75,
|
||||
// Bottom
|
||||
0.375, 0.25, 0.75, 0.625, 0.5, 1.0,
|
||||
// Top
|
||||
0.0, 0.6875, 0.0, 1.0, 1.0, 1.0
|
||||
// 4 sides of hopper (top)
|
||||
//0.0, 0.6875, 0.0, 1.0, 1.0, 0.125,
|
||||
//0.0, 0.6875, 0.875, 1.0, 1.0, 1.0,
|
||||
//0.0, 0.6875, 0.0, 0.125, 1.0, 1.0,
|
||||
//0.875, 0.6875, 0.0, 1.0, 1.0, 1.0,
|
||||
};
|
||||
case WEST:
|
||||
return new double[] {
|
||||
// Standing inside
|
||||
0.0, 0.625, 0.0, 1.0, 0.6875, 1.0,
|
||||
// Middle
|
||||
0.25, 0.25, 0.25, 0.75, 0.625, 0.75,
|
||||
// Bottom
|
||||
0.0, 0.25, 0.375, 0.25, 0.5, 0.625,
|
||||
// Top
|
||||
0.0, 0.6875, 0.0, 1.0, 1.0, 1.0
|
||||
// 4 sides of hopper (top)
|
||||
//0.0, 0.6875, 0.0, 1.0, 1.0, 0.125,
|
||||
//0.0, 0.6875, 0.875, 1.0, 1.0, 1.0,
|
||||
//0.0, 0.6875, 0.0, 0.125, 1.0, 1.0,
|
||||
//0.875, 0.6875, 0.0, 1.0, 1.0, 1.0,
|
||||
};
|
||||
case EAST:
|
||||
return new double[] {
|
||||
// Standing inside
|
||||
0.0, 0.625, 0.0, 1.0, 0.6875, 1.0,
|
||||
// Middle
|
||||
0.25, 0.25, 0.25, 0.75, 0.625, 0.75,
|
||||
// Bottom
|
||||
0.75, 0.25, 0.375, 1.0, 0.5, 0.625,
|
||||
// Top
|
||||
0.0, 0.6875, 0.0, 1.0, 1.0, 1.0
|
||||
// 4 sides of hopper (top)
|
||||
//0.0, 0.6875, 0.0, 1.0, 1.0, 0.125,
|
||||
//0.0, 0.6875, 0.875, 1.0, 1.0, 1.0,
|
||||
//0.0, 0.6875, 0.0, 0.125, 1.0, 1.0,
|
||||
//0.875, 0.6875, 0.0, 1.0, 1.0, 1.0,
|
||||
};
|
||||
case DOWN:
|
||||
return new double[] {
|
||||
// Standing inside
|
||||
0.0, 0.625, 0.0, 1.0, 0.6875, 1.0,
|
||||
// Middle
|
||||
0.25, 0.25, 0.25, 0.75, 0.625, 0.75,
|
||||
// Bottom
|
||||
0.375, 0.0, 0.375, 0.625, 0.25, 0.625,
|
||||
// Top
|
||||
0.0, 0.6875, 0.0, 1.0, 1.0, 1.0
|
||||
// 4 sides of hopper (top)
|
||||
//0.0, 0.6875, 0.0, 1.0, 1.0, 0.125,
|
||||
//0.0, 0.6875, 0.875, 1.0, 1.0, 1.0,
|
||||
//0.0, 0.6875, 0.0, 0.125, 1.0, 1.0,
|
||||
//0.875, 0.6875, 0.0, 1.0, 1.0, 1.0,
|
||||
};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Directional;
|
||||
import org.bukkit.util.BoundingBox;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitLadder implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
BoundingBox box = block.getBoundingBox();
|
||||
return new double[] {box.getMinX()-x, box.getMinY()-y, box.getMinZ()-z, box.getMaxX()-x, box.getMaxY()-y, box.getMaxZ()-z};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
if (blockData instanceof Directional) {
|
||||
final Directional ladder = (Directional) blockData;
|
||||
switch(ladder.getFacing()) {
|
||||
case EAST:
|
||||
return 5;
|
||||
case NORTH:
|
||||
return 6;
|
||||
case SOUTH:
|
||||
return 3;
|
||||
case WEST:
|
||||
return 4;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+8
-9
@@ -23,24 +23,23 @@ import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitLantern implements BukkitShapeModel {
|
||||
|
||||
private double xz = 0.33;
|
||||
private double xz = 0.3125;
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof Lantern) {
|
||||
Lantern lantern = (Lantern) blockData;
|
||||
if (lantern.isHanging()) return new double[] {xz, 0.0625, xz, 1-xz, 1, 1-xz};
|
||||
if (lantern.isHanging())
|
||||
return new double[] {xz, 0.0625, xz, 1-xz, 0.5, 1-xz, 0.375, 0.5, 0.375, 0.625, 0.625, 0.625};
|
||||
}
|
||||
return new double[] {xz, 0.0, xz, 1.0 - xz, 0.5625, 1.0 - xz};
|
||||
return new double[] {xz, 0.0, xz, 1.0-xz, 0.4375, 1.0-xz, 0.375, 0.4375, 0.375, 0.625, 0.5625, 0.625};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Levelled;
|
||||
import org.bukkit.block.data.Waterlogged;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockFlags;
|
||||
|
||||
public class BukkitLevelled implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
final Block blockAbove = world.getBlockAt(x, y + 1, z);
|
||||
final BlockData blockDataAbove = blockAbove.getBlockData();
|
||||
if ((BlockFlags.getBlockFlags(world.getBlockAt(x, y, z).getType()) & BlockFlags.F_WATER) != 0
|
||||
&& (blockDataAbove instanceof Waterlogged && ((Waterlogged)blockDataAbove).isWaterlogged())) {
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 8 / 9f, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
if (blockData instanceof Levelled) {
|
||||
return ((Levelled)blockData).getLevel();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.Piston;
|
||||
import org.bukkit.util.BoundingBox;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitPiston implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
if (Bridge1_13.hasBoundingBox()) {
|
||||
BoundingBox bd = block.getBoundingBox();
|
||||
return new double[] {bd.getMinX()-x, bd.getMinY()-y, bd.getMinZ()-z, bd.getMaxX()-x, bd.getMaxY()-y, bd.getMaxZ()-z};
|
||||
}
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
double[] res = new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
if (blockData instanceof Piston) {
|
||||
final Piston piston = (Piston) blockData;
|
||||
if (!piston.isExtended()) {
|
||||
return res;
|
||||
}
|
||||
final BlockFace face = piston.getFacing();
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
res[2] = 0.25;
|
||||
break;
|
||||
case SOUTH:
|
||||
res[5] = 0.75;
|
||||
break;
|
||||
case WEST:
|
||||
res[0] = 0.25;
|
||||
break;
|
||||
case EAST:
|
||||
res[3] = 0.75;
|
||||
break;
|
||||
case UP:
|
||||
res[4] = 0.75;
|
||||
break;
|
||||
case DOWN:
|
||||
res[1] = 0.25;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Directional;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitPistonHead implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof Directional) {
|
||||
Directional b = (Directional) blockData;
|
||||
BlockFace face = b.getFacing();
|
||||
switch (face) {
|
||||
case UP:
|
||||
return new double[] {
|
||||
// Shaft
|
||||
0.375, 0.0, 0.375, 0.625, 1.0, 0.625,
|
||||
// Plank
|
||||
0.0, 0.75, 0.0, 1.0, 1.0, 1.0
|
||||
};
|
||||
case DOWN:
|
||||
return new double[] {
|
||||
// Shaft
|
||||
0.375, 0.0, 0.375, 0.625, 1.0, 0.625,
|
||||
// Plank
|
||||
0.0, 0.0, 0.0, 1.0, 0.25, 1.0
|
||||
};
|
||||
case NORTH:
|
||||
return new double[] {
|
||||
// Shaft
|
||||
0.375, 0.375, 0.0, 0.625, 0.625, 1.0,
|
||||
// Plank
|
||||
0.0, 0.0, 0.0, 1.0, 1.0, 0.25
|
||||
};
|
||||
case SOUTH:
|
||||
return new double[] {
|
||||
// Shaft
|
||||
0.375, 0.375, 0.0, 0.625, 0.625, 1.0,
|
||||
// Plank
|
||||
0.0, 0.0, 0.75, 1.0, 1.0, 1.0
|
||||
};
|
||||
case WEST:
|
||||
return new double[] {
|
||||
// Shaft
|
||||
0.0, 0.375, 0.375, 1.0, 0.625, 0.625,
|
||||
// Plank
|
||||
0.0, 0.0, 0.0, 0.25, 1.0, 1.0
|
||||
};
|
||||
case EAST:
|
||||
return new double[] {
|
||||
// Shaft
|
||||
0.0, 0.375, 0.375, 1.0, 0.625, 0.625,
|
||||
// Plank
|
||||
0.75, 0.0, 0.0, 1.0, 1.0, 1.0
|
||||
};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitPowderSnow implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
IPlayerData pData = blockCache.getPlayerData();
|
||||
if (pData != null) {
|
||||
MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
// TODO: Make NoFall no dealing damage on this block
|
||||
if (data.lastY > (y + 1 - 1e-5) && data.hasLeatherBoots && !pData.isShiftKeyPressed()) {
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
// Give up, too hard to properly implement, workaround instead
|
||||
//if (data.noFallFallDistance > 2.5) {
|
||||
// return new double[] {0.0, 0.0, 0.0, 1.0, 0.9, 1.0};
|
||||
//}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Rail;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitRail implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
if (blockData instanceof Rail) {
|
||||
return ((Rail)blockData).getShape().name().startsWith("ASCENDING") ? 2 : 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+9
-6
@@ -19,15 +19,20 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.SeaPickle;
|
||||
import org.bukkit.util.BoundingBox;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitSeaPickle implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
if (Bridge1_13.hasBoundingBox()) {
|
||||
BoundingBox bd = block.getBoundingBox();
|
||||
return new double[] {bd.getMinX()-x, bd.getMinY()-y, bd.getMinZ()-z, bd.getMaxX()-x, bd.getMaxY()-y, bd.getMaxZ()-z};
|
||||
}
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
|
||||
@@ -50,9 +55,7 @@ public class BukkitSeaPickle implements BukkitShapeModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+3
-6
@@ -24,8 +24,7 @@ import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
public class BukkitShulkerBox implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
@@ -40,9 +39,7 @@ public class BukkitShulkerBox implements BukkitShapeModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+3
-6
@@ -25,8 +25,7 @@ import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
public class BukkitSlab implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
@@ -48,9 +47,7 @@ public class BukkitSlab implements BukkitShapeModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.Snow;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitSnow implements BukkitShapeModel {
|
||||
|
||||
private static final double[][] SNOW_LAYERS = {
|
||||
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
|
||||
{0.0, 0.0, 0.0, 1.0, 0.125, 1.0},
|
||||
{0.0, 0.0, 0.0, 1.0, 0.250, 1.0},
|
||||
{0.0, 0.0, 0.0, 1.0, 0.375, 1.0},
|
||||
{0.0, 0.0, 0.0, 1.0, 0.5, 1.0},
|
||||
{0.0, 0.0, 0.0, 1.0, 0.625, 1.0},
|
||||
{0.0, 0.0, 0.0, 1.0, 0.75, 1.0},
|
||||
{0.0, 0.0, 0.0, 1.0, 0.875, 1.0},
|
||||
{0.0, 0.0, 0.0, 1.0, 1.0, 1.0}
|
||||
};
|
||||
|
||||
@Override
|
||||
public double[] getShape(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
// TODO: Backward Handling
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
if (blockData instanceof Snow) {
|
||||
return SNOW_LAYERS[((Snow)blockData).getLayers() - 1];
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
if (blockData instanceof Snow) {
|
||||
return ((Snow)blockData).getLayers() - 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+171
-43
@@ -14,65 +14,193 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.Bisected;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.Bisected.Half;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.Stairs;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.collision.Axis;
|
||||
import fr.neatmonster.nocheatplus.utilities.collision.AxisAlignedBBUtils;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitStairs implements BukkitShapeModel {
|
||||
|
||||
// Taken from NMS - StairBlock.java
|
||||
private final double[] topslabs = new double[] {0.0, 0.5, 0.0, 1.0, 1.0, 1.0};
|
||||
private final double[] bottomslabs = new double[] {0.0, 0.0, 0.0, 1.0, 0.5, 1.0};
|
||||
|
||||
private final double[] octet_nnn = new double[] {0.0, 0.0, 0.0, 0.5, 0.5, 0.5};
|
||||
private final double[] octet_nnp = new double[] {0.0, 0.0, 0.5, 0.5, 0.5, 1.0};
|
||||
private final double[] octet_pnn = new double[] {0.5, 0.0, 0.0, 1.0, 0.5, 0.5};
|
||||
private final double[] octet_pnp = new double[] {0.5, 0.0, 0.5, 1.0, 0.5, 1.0};
|
||||
|
||||
private final double[] octet_npn = new double[] {0.0, 0.5, 0.0, 0.5, 1.0, 0.5};
|
||||
private final double[] octet_npp = new double[] {0.0, 0.5, 0.5, 0.5, 1.0, 1.0};
|
||||
private final double[] octet_ppn = new double[] {0.5, 0.5, 0.0, 1.0, 1.0, 0.5};
|
||||
private final double[] octet_ppp = new double[] {0.5, 0.5, 0.5, 1.0, 1.0, 1.0};
|
||||
|
||||
private final double[][] top_stairs = makeshape(topslabs, octet_nnn, octet_pnn, octet_nnp, octet_pnp);
|
||||
private final double[][] bottom_stairs = makeshape(bottomslabs, octet_npn, octet_ppn, octet_npp, octet_ppp);
|
||||
private final int[] shape_by_state = new int[]{12, 5, 3, 10, 14, 13, 7, 11, 13, 7, 11, 14, 8, 4, 1, 2, 4, 1, 2, 8};
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
// TODO: With fake data, this could simply return full bounds.
|
||||
|
||||
// final Block block = world.getBlockAt(x, y, z);
|
||||
// final BlockState state = block.getState();
|
||||
// final BlockData blockData = state.getBlockData();
|
||||
//
|
||||
// if (blockData instanceof Stairs) {
|
||||
// final Stairs stairs = (Stairs) blockData;
|
||||
// final Half half = stairs.getHalf();
|
||||
// //final Shape shape = stairs.getShape();
|
||||
// // TODO: Refine later, with sub shapes.
|
||||
// switch (half) {
|
||||
// case BOTTOM:
|
||||
// return new double[] {0.0, 0.0, 0.0, 1.0, 0.5, 1.0};
|
||||
// case TOP:
|
||||
// return new double[] {0.0, 0.5, 0.0, 1.0, 1.0, 1.0};
|
||||
// default:
|
||||
// break;
|
||||
//
|
||||
// }
|
||||
// }
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getState().getBlockData();
|
||||
if (blockData instanceof Stairs) {
|
||||
final Stairs stairs = (Stairs) blockData;
|
||||
final Half half = stairs.getHalf();
|
||||
switch (half) {
|
||||
case BOTTOM:
|
||||
return bottom_stairs[shape_by_state[getShapeStateIndex(stairs)]];
|
||||
case TOP:
|
||||
return top_stairs[shape_by_state[getShapeStateIndex(stairs)]];
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
//final Block block = world.getBlockAt(x, y, z);
|
||||
//final BlockState state = block.getState();
|
||||
//final BlockData blockData = state.getBlockData();
|
||||
|
||||
if (blockData instanceof Bisected) {
|
||||
final Bisected stairs = (Bisected) blockData;
|
||||
final Half half = stairs.getHalf();
|
||||
//final Shape shape = stairs.getShape();
|
||||
// TODO: Refine later, with sub shapes.
|
||||
switch (half) {
|
||||
case TOP:
|
||||
return 0x4;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
//if (blockData instanceof Bisected) {
|
||||
// final Bisected stairs = (Bisected) blockData;
|
||||
// final Half half = stairs.getHalf();
|
||||
// switch (half) {
|
||||
// case TOP:
|
||||
// return 0x4;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private double[][] makeshape(double[] slab, double[] octet_nn, double[] octet_pn, double[] octet_np, double[] octet_pp) {
|
||||
return IntStream
|
||||
.range(0, 16)
|
||||
.mapToObj((flags) -> makeStairShape(flags, slab, octet_nn, octet_pn, octet_np, octet_pp))
|
||||
.toArray(double[][]::new);
|
||||
}
|
||||
|
||||
private double[] makeStairShape(int flags, double[] slab, double[] octet_nn, double[] octet_pn, double[] octet_np, double[] octet_pp) {
|
||||
double[] res = slab;
|
||||
if ((flags & 1) != 0) {
|
||||
res = merge(res, octet_nn);
|
||||
}
|
||||
if ((flags & 2) != 0) {
|
||||
res = merge(res, octet_pn);
|
||||
}
|
||||
if ((flags & 4) != 0) {
|
||||
res = merge(res, octet_np);
|
||||
}
|
||||
if ((flags & 8) != 0) {
|
||||
res = merge(res, octet_pp);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int getShapeStateIndex(Stairs stair) {
|
||||
return stair.getShape().ordinal() * 4 + directionToValue(stair.getFacing());
|
||||
}
|
||||
|
||||
private int directionToValue(BlockFace face) {
|
||||
switch (face) {
|
||||
default:
|
||||
case UP:
|
||||
case DOWN:
|
||||
return -1;
|
||||
case NORTH:
|
||||
return 2;
|
||||
case SOUTH:
|
||||
return 0;
|
||||
case WEST:
|
||||
return 1;
|
||||
case EAST:
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Poorly designed, Will recode better version later
|
||||
private double[] merge(double[] bounds, double[] octet) {
|
||||
double[] res = bounds;
|
||||
final double minX = octet[0];
|
||||
final double minY = octet[1];
|
||||
final double minZ = octet[2];
|
||||
final double maxX = octet[3];
|
||||
final double maxY = octet[4];
|
||||
final double maxZ = octet[5];
|
||||
for (int i = 2; i <= AxisAlignedBBUtils.getNumberOfAABBs(bounds); i++) {
|
||||
|
||||
final double tminX = bounds[i*6-6];
|
||||
final double tminY = bounds[i*6-5];
|
||||
final double tminZ = bounds[i*6-4];
|
||||
final double tmaxX = bounds[i*6-3];
|
||||
final double tmaxY = bounds[i*6-2];
|
||||
final double tmaxZ = bounds[i*6-1];
|
||||
if (sameshape(minX, minY, minZ, maxX, maxY, maxZ, tminX, tminY, tminZ, tmaxX, tmaxY, tmaxZ)) {
|
||||
final List<Axis> a = getRelative(minX, minY, minZ, maxX, maxY, maxZ, tminX, tminY, tminZ, tmaxX, tmaxY, tmaxZ);
|
||||
if (a.size() == 1) {
|
||||
Axis axis = a.get(0);
|
||||
switch (axis) {
|
||||
case X_AXIS:
|
||||
res[i*6-6] = Math.min(tminX, minX);
|
||||
res[i*6-3] = Math.max(tmaxX, maxX);
|
||||
return res;
|
||||
//case Y_AXIS:
|
||||
// break;
|
||||
case Z_AXIS:
|
||||
res[i*6-4] = Math.min(tminZ, minZ);
|
||||
res[i*6-1] = Math.max(tmaxZ, maxZ);
|
||||
return res;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return add(res, octet);
|
||||
}
|
||||
|
||||
private double[] add(final double[] array1, final double[] array2) {
|
||||
final double[] newArray = new double[array1.length + array2.length];
|
||||
System.arraycopy(array1, 0, newArray, 0, array1.length);
|
||||
System.arraycopy(array2, 0, newArray, array1.length, array2.length);
|
||||
return newArray;
|
||||
}
|
||||
|
||||
private List<Axis> getRelative(double minX, double minY, double minZ, double maxX, double maxY, double maxZ,
|
||||
double tminX, double tminY, double tminZ, double tmaxX, double tmaxY, double tmaxZ) {
|
||||
final List<Axis> list = new ArrayList<Axis>();
|
||||
if (minX == tmaxX || maxX == tminX) {
|
||||
list.add(Axis.X_AXIS);
|
||||
}
|
||||
if (minY == tmaxY || maxY == tminY) {
|
||||
list.add(Axis.Y_AXIS);
|
||||
}
|
||||
if (minZ == tmaxZ || maxZ == tminZ) {
|
||||
list.add(Axis.Z_AXIS);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private boolean sameshape(double minX, double minY, double minZ, double maxX, double maxY, double maxZ, double tminX,
|
||||
double tminY, double tminZ, double tmaxX, double tmaxY, double tmaxZ) {
|
||||
final double dx = maxX - minX;
|
||||
final double dy = maxY - minY;
|
||||
final double dz = maxZ - minZ;
|
||||
final double tdx = tmaxX - tminX;
|
||||
final double tdy = tmaxY - tminY;
|
||||
final double tdz = tmaxZ - tminZ;
|
||||
return dx == tdx && dy == tdy && dz == tdz;
|
||||
}
|
||||
}
|
||||
+14
-21
@@ -20,12 +20,7 @@ import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitStatic implements BukkitShapeModel {
|
||||
|
||||
private final double minX;
|
||||
private final double minY;
|
||||
private final double minZ;
|
||||
private final double maxX;
|
||||
private final double maxY;
|
||||
private final double maxZ;
|
||||
private final double[] bounds;
|
||||
|
||||
/**
|
||||
* Initialize with the given height and with full xz-bounds.
|
||||
@@ -46,27 +41,25 @@ public class BukkitStatic implements BukkitShapeModel {
|
||||
this(xzInset, 0.0, xzInset, 1.0 - xzInset, height, 1.0 - xzInset);
|
||||
}
|
||||
|
||||
public BukkitStatic(double minX, double minY, double minZ,
|
||||
double maxX, double maxY, double maxZ) {
|
||||
this.minX = minX;
|
||||
this.minY = minY;
|
||||
this.minZ = minZ;
|
||||
this.maxX = maxX;
|
||||
this.maxY = maxY;
|
||||
this.maxZ = maxZ;
|
||||
/**
|
||||
* Initialize with the given bounds
|
||||
*
|
||||
*/
|
||||
public BukkitStatic(double ...bounds) {
|
||||
if (bounds.length % 6 != 0) {
|
||||
throw new IllegalArgumentException("The length must be a multiple of 6");
|
||||
}
|
||||
this.bounds = bounds;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
return new double[] {minX, minY, minZ, maxX, maxY, maxZ};
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return bounds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+23
-19
@@ -19,7 +19,6 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.Bisected.Half;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Openable;
|
||||
import org.bukkit.block.data.type.TrapDoor;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
@@ -30,15 +29,14 @@ public class BukkitTrapDoor implements BukkitShapeModel {
|
||||
private static final double openWidth = 0.1875;
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
if (blockData instanceof TrapDoor) {
|
||||
final TrapDoor trapDoor = (TrapDoor) blockData;
|
||||
if (trapDoor.isOpen()) {
|
||||
switch(trapDoor.getFacing()) {
|
||||
switch (trapDoor.getFacing()) {
|
||||
case NORTH:
|
||||
return new double[] {0.0, 0.0, 1.0 - openWidth, 1.0, 1.0, 1.0};
|
||||
case SOUTH:
|
||||
@@ -51,28 +49,34 @@ public class BukkitTrapDoor implements BukkitShapeModel {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return trapDoor.getHalf() == Half.BOTTOM
|
||||
? new double[] {0.0, 0.0, 0.0, 1.0, closedHeight, 1.0}
|
||||
: new double[] {0.0, 1.0 - closedHeight, 0.0, 1.0, 1.0, 1.0};
|
||||
|
||||
}
|
||||
return trapDoor.getHalf() == Half.BOTTOM ? new double[] {0.0, 0.0, 0.0, 1.0, closedHeight, 1.0}
|
||||
: new double[] {0.0, 1.0 - closedHeight, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
if (blockData instanceof Openable) {
|
||||
return ((Openable) blockData).isOpen() ? 0x4 : 0;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
if (blockData instanceof TrapDoor) {
|
||||
final TrapDoor trapDoor = (TrapDoor) blockData;
|
||||
if (trapDoor.isOpen()) {
|
||||
switch(trapDoor.getFacing()) {
|
||||
case EAST:
|
||||
return 3;
|
||||
case NORTH:
|
||||
return 4;
|
||||
case SOUTH:
|
||||
return 5;
|
||||
case WEST:
|
||||
return 6;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+10
-7
@@ -19,18 +19,23 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.TurtleEgg;
|
||||
import org.bukkit.util.BoundingBox;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitTurtleEgg implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
if (Bridge1_13.hasBoundingBox()) {
|
||||
BoundingBox bd = block.getBoundingBox();
|
||||
return new double[] {bd.getMinX()-x, bd.getMinY()-y, bd.getMinZ()-z, bd.getMaxX()-x, bd.getMaxY()-y, bd.getMaxZ()-z};
|
||||
}
|
||||
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
|
||||
if (blockData instanceof TurtleEgg) {
|
||||
final TurtleEgg egg = (TurtleEgg) blockData;
|
||||
switch (egg.getEggs()) {
|
||||
@@ -48,9 +53,7 @@ public class BukkitTurtleEgg implements BukkitShapeModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+83
-29
@@ -22,6 +22,7 @@ import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.MultipleFacing;
|
||||
import org.bukkit.block.data.type.Wall;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
@@ -30,71 +31,124 @@ public class BukkitWall implements BukkitShapeModel {
|
||||
private final double minXZ;
|
||||
private final double maxXZ;
|
||||
private final double height;
|
||||
private final double sideInset;
|
||||
private final double[] east;
|
||||
private final double[] north;
|
||||
private final double[] west;
|
||||
private final double[] south;
|
||||
private final double[] eastwest;
|
||||
private final double[] southnorth;
|
||||
|
||||
public BukkitWall(double inset, double height) {
|
||||
this(inset, 1.0 - inset, height);
|
||||
this(inset, 1.0 - inset, height, 0.0);
|
||||
}
|
||||
|
||||
public BukkitWall(double minXZ, double maxXZ, double height) {
|
||||
public BukkitWall(double inset, double height, double sideInset) {
|
||||
this(inset, 1.0 - inset, height, sideInset);
|
||||
}
|
||||
|
||||
public BukkitWall(double minXZ, double maxXZ, double height, double sideInset) {
|
||||
this.minXZ = minXZ;
|
||||
this.maxXZ = maxXZ;
|
||||
this.height = height;
|
||||
this.sideInset = sideInset;
|
||||
east = new double[] {maxXZ, 0.0, sideInset, 1.0, height, 1.0 - sideInset};
|
||||
north = new double[] {sideInset, 0.0, 0.0, 1.0 - sideInset, height, minXZ};
|
||||
west = new double[] {0.0, 0.0, sideInset, minXZ, height, 1.0 - sideInset};
|
||||
south = new double[] {sideInset, 0.0, maxXZ, 1.0 - sideInset, height, 1.0};
|
||||
eastwest = new double[] {0.0, 0.0, sideInset, 1.0, height, 1.0 - sideInset};
|
||||
southnorth = new double[] {sideInset, 0.0, 0.0, 1.0 - sideInset, height, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
// Relevant: https://bugs.mojang.com/browse/MC-9565
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
|
||||
if (blockData instanceof MultipleFacing) {
|
||||
// Note isPassableWorkaround for these (no voxel shapes / multi cuboid yet).
|
||||
final MultipleFacing fence = (MultipleFacing) blockData;
|
||||
// TODO: If height > 1.0, check if it needs to be capped, provided relevant.
|
||||
MultipleFacing fence = (MultipleFacing) blockData;
|
||||
double[] res = new double[] {minXZ, 0.0, minXZ, maxXZ, height, maxXZ};
|
||||
Set<BlockFace> faces = fence.getFaces();
|
||||
if (!faces.contains(BlockFace.UP) && faces.size() == 2) {
|
||||
if (faces.contains(BlockFace.SOUTH)) {
|
||||
return new double[] {sideInset, 0.0, 0.0, 1.0 - sideInset, height, 1.0};
|
||||
}
|
||||
if (faces.contains(BlockFace.WEST)) {
|
||||
return new double[] {0.0, 0.0, sideInset, 1.0, height, 1.0 - sideInset};
|
||||
}
|
||||
}
|
||||
for (final BlockFace face : fence.getFaces()) {
|
||||
switch (face) {
|
||||
case EAST:
|
||||
res[3] = 1.0;
|
||||
res = add(res, east);
|
||||
break;
|
||||
case NORTH:
|
||||
res[2] = 0.0;
|
||||
res = add(res, north);
|
||||
break;
|
||||
case WEST:
|
||||
res[0] = 0.0;
|
||||
res = add(res, west);
|
||||
break;
|
||||
case SOUTH:
|
||||
res[5] = 1.0;
|
||||
res = add(res, south);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
final Set<BlockFace> a = fence.getFaces();
|
||||
if (!a.contains(BlockFace.UP) && a.size() == 2) {
|
||||
if (a.contains(BlockFace.SOUTH)) {
|
||||
res[0] = 0.33;
|
||||
res[3] = 1 - 0.33;
|
||||
}
|
||||
if (a.contains(BlockFace.WEST)) {
|
||||
res[2] = 0.33;
|
||||
res[5] = 1 - 0.33;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
else if (blockData instanceof Wall) {
|
||||
final Wall wall = (Wall) blockData;
|
||||
if (wall.isUp()) {
|
||||
double[] res = new double[] {minXZ, 0.0, minXZ, maxXZ, height, maxXZ};
|
||||
if (!wall.getHeight(BlockFace.WEST).equals(Wall.Height.NONE)) {
|
||||
res = add(res, west);
|
||||
}
|
||||
if (!wall.getHeight(BlockFace.EAST).equals(Wall.Height.NONE)) {
|
||||
res = add(res, east);
|
||||
}
|
||||
if (!wall.getHeight(BlockFace.NORTH).equals(Wall.Height.NONE)) {
|
||||
res = add(res, north);
|
||||
}
|
||||
if (!wall.getHeight(BlockFace.SOUTH).equals(Wall.Height.NONE)) {
|
||||
res = add(res, south);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
else {
|
||||
double[] res = null;
|
||||
if (!wall.getHeight(BlockFace.WEST).equals(Wall.Height.NONE)
|
||||
&& !wall.getHeight(BlockFace.EAST).equals(Wall.Height.NONE)) {
|
||||
if (res == null) {
|
||||
res = eastwest;
|
||||
}
|
||||
}
|
||||
if (!wall.getHeight(BlockFace.NORTH).equals(Wall.Height.NONE)
|
||||
&& !wall.getHeight(BlockFace.SOUTH).equals(Wall.Height.NONE)) {
|
||||
if (res == null) {
|
||||
res = southnorth;
|
||||
}
|
||||
else res = add(res, southnorth);
|
||||
}
|
||||
if (res != null) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
private double[] add(final double[] array1, final double[] array2) {
|
||||
final double[] newArray = new double[array1.length + array2.length];
|
||||
System.arraycopy(array1, 0, newArray, 0, array1.length);
|
||||
System.arraycopy(array2, 0, newArray, array1.length, array2.length);
|
||||
return newArray;
|
||||
}
|
||||
}
|
||||
+13
-16
@@ -25,33 +25,30 @@ import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
public class BukkitWallHead implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public double[] getShape(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockData blockData = block.getBlockData();
|
||||
if (blockData instanceof Directional) {
|
||||
BlockFace face = ((Directional) blockData).getFacing();
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
return new double[] {0.25, 0.25, 0.5, 0.75, 0.75, 1.0};
|
||||
case SOUTH:
|
||||
return new double[] {0.25, 0.25, 0.0, 0.75, 0.75, 0.5};
|
||||
case WEST:
|
||||
return new double[] {0.5, 0.25, 0.25, 1.0, 0.75, 0.75};
|
||||
case EAST:
|
||||
return new double[] {0.0, 0.25, 0.25, 0.5, 0.75, 0.75};
|
||||
default:
|
||||
break;
|
||||
case NORTH:
|
||||
return new double[] {0.25, 0.25, 0.5, 0.75, 0.75, 1.0};
|
||||
case SOUTH:
|
||||
return new double[] {0.25, 0.25, 0.0, 0.75, 0.75, 0.5};
|
||||
case WEST:
|
||||
return new double[] {0.5, 0.25, 0.25, 1.0, 0.75, 0.75};
|
||||
case EAST:
|
||||
return new double[] {0.0, 0.25, 0.25, 0.5, 0.75, 0.75};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Waterlogged;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitWaterPlant implements BukkitShapeModel {
|
||||
|
||||
@Override
|
||||
public double[] getShape(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
final Block blockAbove = world.getBlockAt(x, y + 1, z);
|
||||
final BlockData blockDataAbove = blockAbove.getBlockData();
|
||||
if (blockDataAbove instanceof Waterlogged && ((Waterlogged)blockDataAbove).isWaterlogged()) {
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 8 / 9f, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(BlockCache blockCache, World world, int x, int y, int z) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+4
@@ -17,6 +17,7 @@ package fr.neatmonster.nocheatplus.compat.cbreflect;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.LegacyBlocks;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.BlockCacheBukkit;
|
||||
import fr.neatmonster.nocheatplus.compat.cbreflect.reflect.ReflectHelper;
|
||||
import fr.neatmonster.nocheatplus.compat.cbreflect.reflect.ReflectHelper.ReflectFailureException;
|
||||
@@ -44,6 +45,9 @@ public class BlockCacheCBReflect extends BlockCacheBukkit {
|
||||
|
||||
@Override
|
||||
public double[] fetchBounds(int x, int y, int z) {
|
||||
final org.bukkit.Material mat = getType(x, y, z);
|
||||
final double[] shape = LegacyBlocks.getShape(this, mat, x, y, z, true);
|
||||
if (shape != null) return shape;
|
||||
try {
|
||||
return helper.nmsWorld_fetchBlockShape(this.nmsWorld, this.getType(x, y, z), x, y, z);
|
||||
}
|
||||
|
||||
+5
-6
@@ -22,7 +22,7 @@ import org.bukkit.entity.Player;
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.BlockCacheBukkit;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.MCAccessBukkitModern;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.MCAccessBukkit;
|
||||
import fr.neatmonster.nocheatplus.compat.cbreflect.reflect.ReflectHelper;
|
||||
import fr.neatmonster.nocheatplus.compat.cbreflect.reflect.ReflectHelper.ReflectFailureException;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.GenericVersion;
|
||||
@@ -31,7 +31,7 @@ import fr.neatmonster.nocheatplus.logging.Streams;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.LocUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class MCAccessCBReflect extends MCAccessBukkitModern {
|
||||
public class MCAccessCBReflect extends MCAccessBukkit {
|
||||
|
||||
protected final ReflectHelper helper;
|
||||
|
||||
@@ -49,11 +49,11 @@ public class MCAccessCBReflect extends MCAccessBukkitModern {
|
||||
NCPAPIProvider.getNoCheatPlusAPI().getLogManager().warning(Streams.INIT, "The Minecraft version could not be detected, Compat-CB-Reflect might or might not work.");
|
||||
this.knownSupportedVersion = false;
|
||||
}
|
||||
else if (GenericVersion.compareVersions(mcVersion, "1.4.5") < 0) {
|
||||
else if (GenericVersion.compareVersions(mcVersion, "1.5") < 0) {
|
||||
NCPAPIProvider.getNoCheatPlusAPI().getLogManager().warning(Streams.INIT, "The Minecraft version seems to be older than what Compat-CB-Reflect can support.");
|
||||
this.knownSupportedVersion = false;
|
||||
}
|
||||
else if (GenericVersion.compareVersions(mcVersion, "1.14.4") > 0) {
|
||||
else if (GenericVersion.compareVersions(mcVersion, "1.12.2") > 0) {
|
||||
this.knownSupportedVersion = false;
|
||||
NCPAPIProvider.getNoCheatPlusAPI().getLogManager().warning(Streams.INIT, "The Minecraft version seems to be more recent than the one Compat-CB-Reflect has been built with - this might work, but there could be incompatibilities.");
|
||||
} else {
|
||||
@@ -70,8 +70,7 @@ public class MCAccessCBReflect extends MCAccessBukkitModern {
|
||||
|
||||
@Override
|
||||
public String getMCVersion() {
|
||||
// Potentially all :p.
|
||||
return "1.7-1.14.4|?";
|
||||
return "1.5-1.12.2";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+91
-16
@@ -146,17 +146,7 @@ public class ReflectAttributeAccess implements IAttributeAccess {
|
||||
throw new RuntimeException("Not available.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSpeedAttributeMultiplier(Player player) {
|
||||
return getSpeedAttributeMultiplier(player, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSprintAttributeMultiplier(Player player) {
|
||||
return nmsAttributeInstance_getSprintAttributeModifierMultiplier(getMovementSpeedAttributeInstance(player));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the speed attribute (MOVEMENT_SPEED) for a player.
|
||||
* @param handle EntityPlayer
|
||||
@@ -165,9 +155,9 @@ public class ReflectAttributeAccess implements IAttributeAccess {
|
||||
private Object getMovementSpeedAttributeInstance(Player player) {
|
||||
return ReflectionUtil.invokeMethod(this.reflectPlayer.nmsGetAttributeInstance, getHandle(player), this.reflectGenericAttributes.nmsMOVEMENT_SPEED);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param player
|
||||
* @param removeSprint If to calculate away the sprint boost modifier.
|
||||
* @return
|
||||
@@ -188,7 +178,7 @@ public class ReflectAttributeAccess implements IAttributeAccess {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* (Not an existing method.)
|
||||
* @param attributeInstance
|
||||
@@ -202,10 +192,95 @@ public class ReflectAttributeAccess implements IAttributeAccess {
|
||||
return AttribUtil.getMultiplier((Integer) ReflectionUtil.invokeMethodNoArgs(this.reflectAttributeModifier.nmsGetOperation, mod), (Double) ReflectionUtil.invokeMethodNoArgs(this.reflectAttributeModifier.nmsGetValue, mod));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Object getHandle(Player player) {
|
||||
Object handle = ReflectionUtil.invokeMethodNoArgs(this.reflectPlayer.obcGetHandle, player);
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getSpeedMultiplier(Player player) {
|
||||
return getSpeedAttributeMultiplier(player, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMovementSpeed(final Player player) {
|
||||
// / by 2 to get the base value 0.1f
|
||||
return (player.getWalkSpeed() / 2f) * (float) getSpeedMultiplier(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSprintMultiplier(Player player) {
|
||||
return nmsAttributeInstance_getSprintAttributeModifierMultiplier(getMovementSpeedAttributeInstance(player));
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getGravity(Player player) {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSafeFallDistance(Player player) {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getFallDamageMultiplier(Player player) {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getBreakingSpeedMultiplier(Player player) {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getJumpGainMultiplier(Player player) {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerSneakingFactor(Player player) {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerMaxBlockReach(Player player) {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerMaxAttackReach(Player player) {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxStepUp(Player player) {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMovementEfficiency(Player player) {
|
||||
return Float.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWaterMovementEfficiency(Player player) {
|
||||
return Float.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSubmergedMiningSpeedMultiplier(Player player) {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMiningEfficiency(Player player) {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEntityScale(Player player) {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class ReflectBase {
|
||||
clazz = ServerVersion.getNMSMinecraftServer().getClass();
|
||||
name = clazz.getPackage().getName();
|
||||
if (name.equals("net.minecraft.server") || name.indexOf("net.") == 0 && name.indexOf(".minecraft.") != -1 && name.indexOf(".server.") != -1) {
|
||||
nmsPackageName = name;
|
||||
nmsPackageName = name.contains("v1_") ? name : "net.minecraft.world.entity";
|
||||
} else {
|
||||
nmsPackageName = null;
|
||||
}
|
||||
|
||||
+2
-1
@@ -17,10 +17,11 @@ package fr.neatmonster.nocheatplus.compat.cbreflect.reflect;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.cbreflect.reflect.ReflectHelper.ReflectFailureException;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.ServerVersion;
|
||||
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
import org.bukkit.Material;
|
||||
|
||||
/**
|
||||
* Reflection for block shape getting (latest).
|
||||
|
||||
+12
-1
@@ -14,6 +14,8 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.cbreflect.reflect;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -55,6 +57,7 @@ public class ReflectBlockSix implements IReflectBlock {
|
||||
|
||||
/** (static) */
|
||||
public final Method nmsGetById;
|
||||
public final Object nmsById;
|
||||
|
||||
public final Method nmsGetMaterial;
|
||||
public final boolean useBlockPosition;
|
||||
@@ -75,6 +78,11 @@ public class ReflectBlockSix implements IReflectBlock {
|
||||
final Class<?> clazz = Class.forName(base.nmsPackageName + ".Block");
|
||||
// byID (static)
|
||||
nmsGetById = ReflectionUtil.getMethod(clazz, "getById", int.class);
|
||||
|
||||
final Class<?> blockArray = Array.newInstance(clazz, 0).getClass();
|
||||
final Field byIdField = ReflectionUtil.getField(clazz, "byId", blockArray);
|
||||
nmsById = byIdField == null ? null : ReflectionUtil.get(byIdField, blockArray, null);
|
||||
|
||||
// getMaterial
|
||||
nmsGetMaterial = ReflectionUtil.getMethodNoArgs(clazz, "getMaterial");
|
||||
// updateShape
|
||||
@@ -215,6 +223,9 @@ public class ReflectBlockSix implements IReflectBlock {
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public Object nms_getByMaterial(final Material id) {
|
||||
if (this.nmsById != null) {
|
||||
return Array.get(nmsById, id.getId());
|
||||
}
|
||||
if (this.nmsGetById == null) {
|
||||
fail();
|
||||
}
|
||||
@@ -258,7 +269,7 @@ public class ReflectBlockSix implements IReflectBlock {
|
||||
|
||||
@Override
|
||||
public boolean isFetchBoundsAvailable() {
|
||||
return nmsGetById != null && nmsUpdateShape != null && nmsGetMinX != null;
|
||||
return (nmsGetById != null || nmsById != null) && nmsUpdateShape != null && nmsGetMinX != null;
|
||||
}
|
||||
|
||||
}
|
||||
+13
-6
@@ -20,15 +20,22 @@ import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
|
||||
public class ReflectDamageSource {
|
||||
|
||||
public final Class<?> nmsClass;
|
||||
public Class<?> nmsClass;
|
||||
|
||||
public final Object nmsFALL;
|
||||
public Object nmsFALL;
|
||||
|
||||
public ReflectDamageSource(ReflectBase base) throws ClassNotFoundException {
|
||||
Class<?> nmsClass = Class.forName(base.nmsPackageName + ".DamageSource");
|
||||
this.nmsClass = nmsClass;
|
||||
Field field = ReflectionUtil.getField(nmsClass, "FALL", nmsClass);
|
||||
nmsFALL = field == null ? null : ReflectionUtil.get(field, nmsClass, null);
|
||||
try {
|
||||
Class<?> nmsClass = Class.forName(base.nmsPackageName + ".DamageSource");
|
||||
this.nmsClass = nmsClass;
|
||||
Field field = ReflectionUtil.getField(nmsClass, "FALL", nmsClass);
|
||||
nmsFALL = field == null ? null : ReflectionUtil.get(field, nmsClass, null);
|
||||
} catch (ClassNotFoundException e) {
|
||||
Class<?> nmsClass = Class.forName("net.minecraft.world.damagesource.DamageSource");
|
||||
this.nmsClass = nmsClass;
|
||||
Field field = ReflectionUtil.getField(nmsClass, "k", nmsClass);
|
||||
nmsFALL = field == null ? null : ReflectionUtil.get(field, nmsClass, null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.cbreflect.reflect;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
|
||||
public class ReflectDamageSources {
|
||||
|
||||
public Class<?> nmsClass;
|
||||
|
||||
public Method nmsDamageSources;
|
||||
public Method nmsfall;
|
||||
|
||||
public ReflectDamageSources(ReflectBase base, ReflectDamageSource reflectDamageSource) throws ClassNotFoundException {
|
||||
this(base, reflectDamageSource, Class.forName(base.nmsPackageName + ".Entity"));
|
||||
}
|
||||
|
||||
public ReflectDamageSources(ReflectBase base, ReflectDamageSource reflectDamageSource, Class<?> nmsEntityClass) throws ClassNotFoundException {
|
||||
nmsClass = Class.forName("net.minecraft.world.damagesource.DamageSources");
|
||||
nmsfall = ReflectionUtil.getMethodNoArgs(nmsClass, "k", reflectDamageSource.nmsClass);
|
||||
// 1.19 Entity.damageSources()
|
||||
nmsDamageSources = ReflectionUtil.getMethodNoArgs(nmsEntityClass, "dG", nmsClass);
|
||||
// 1.20
|
||||
if (nmsDamageSources == null) {
|
||||
nmsDamageSources = ReflectionUtil.getMethodNoArgs(nmsEntityClass, "dJ", nmsClass);
|
||||
}
|
||||
// 1.20.2
|
||||
if (nmsDamageSources == null) {
|
||||
nmsDamageSources = ReflectionUtil.getMethodNoArgs(nmsEntityClass, "dM", nmsClass);
|
||||
}
|
||||
// 1.20.4
|
||||
if (nmsDamageSources == null) {
|
||||
nmsDamageSources = ReflectionUtil.getMethodNoArgs(nmsEntityClass, "dN", nmsClass);
|
||||
}
|
||||
// 1.20.5-1.20.6
|
||||
if (nmsDamageSources == null) {
|
||||
nmsDamageSources = ReflectionUtil.getMethodNoArgs(nmsEntityClass, "dQ", nmsClass);
|
||||
}
|
||||
// 1.21
|
||||
if (nmsDamageSources == null) {
|
||||
nmsDamageSources = ReflectionUtil.getMethodNoArgs(nmsEntityClass, "dP", nmsClass);
|
||||
nmsfall = ReflectionUtil.getMethodNoArgs(nmsClass, "l", reflectDamageSource.nmsClass);
|
||||
}
|
||||
// 1.21.2-1.21.3
|
||||
if (nmsDamageSources == null) {
|
||||
nmsDamageSources = ReflectionUtil.getMethodNoArgs(nmsEntityClass, "dX", nmsClass);
|
||||
nmsfall = ReflectionUtil.getMethodNoArgs(nmsClass, "l", reflectDamageSource.nmsClass);
|
||||
}
|
||||
}
|
||||
|
||||
public Object getDamageSource(Object handle) {
|
||||
if (nmsDamageSources == null || nmsfall == null) return null;
|
||||
Object damageSources = ReflectionUtil.invokeMethodNoArgs(nmsDamageSources, handle);
|
||||
return ReflectionUtil.invokeMethodNoArgs(nmsfall, damageSources);
|
||||
}
|
||||
}
|
||||
+29
-2
@@ -40,6 +40,11 @@ public class ReflectEntity extends ReflectGetHandleBase<Entity> {
|
||||
|
||||
public final Method nmsDamageEntity;
|
||||
|
||||
private final Method nmsDamageEntityNew;
|
||||
|
||||
@MostlyHarmless()
|
||||
public final Method nmsclearActiveItem;
|
||||
|
||||
public final boolean nmsDamageEntityInt;
|
||||
|
||||
public ReflectEntity(ReflectBase base, ReflectAxisAlignedBB reflectAxisAlignedBB, ReflectDamageSource damageSource) throws ClassNotFoundException {
|
||||
@@ -59,13 +64,17 @@ public class ReflectEntity extends ReflectGetHandleBase<Entity> {
|
||||
nmsDead = ReflectionUtil.getField(nmsClass, "dead", boolean.class);
|
||||
|
||||
// damageEntity(...)
|
||||
nmsDamageEntity = ReflectionUtil.getMethod(nmsClass, "damageEntity",
|
||||
new Class<?>[]{damageSource.nmsClass, float.class}, new Class<?>[]{damageSource.nmsClass, int.class});
|
||||
// boolean hurt(net.minecraft.world.damagesource.DamageSource,float) -> a
|
||||
nmsDamageEntityNew = ReflectionUtil.getMethod(nmsClass, "a", new Class<?>[]{damageSource.nmsClass, float.class});
|
||||
nmsDamageEntity = nmsDamageEntityNew != null ? nmsDamageEntityNew :
|
||||
ReflectionUtil.getMethod(nmsClass, "damageEntity",
|
||||
new Class<?>[]{damageSource.nmsClass, float.class}, new Class<?>[]{damageSource.nmsClass, int.class});
|
||||
if (nmsDamageEntity != null) {
|
||||
nmsDamageEntityInt = nmsDamageEntity.getParameterTypes()[1] == int.class;
|
||||
} else {
|
||||
nmsDamageEntityInt = true; // Uncertain.
|
||||
}
|
||||
nmsclearActiveItem = seekClearActiveItemMethod(nmsClass);
|
||||
|
||||
// getBoundingBox
|
||||
if (reflectAxisAlignedBB == null) {
|
||||
@@ -76,6 +85,24 @@ public class ReflectEntity extends ReflectGetHandleBase<Entity> {
|
||||
}
|
||||
}
|
||||
|
||||
private Method seekClearActiveItemMethod(Class<?> nmsClass) {
|
||||
// void releaseUsingItem() -> fE(1.21.2-1.21.3)
|
||||
// fw(1.21-1.21.1)
|
||||
// fA(1.20.5-1.20.6)
|
||||
// fs(1.20.4)
|
||||
// fr(1.20.2)
|
||||
// fn(1.20)
|
||||
// fj(1.19-19.4)
|
||||
// eR(???)
|
||||
// clearActiveItem(1.13-???)
|
||||
String[] methodname = {"fE", "fw", "fA", "fs", "fr", "fn", "fj", "eR", "clearActiveItem", "releaseUsingItem"};
|
||||
for (String name : methodname) {
|
||||
Method method = ReflectionUtil.getMethodNoArgs(nmsClass, name);
|
||||
if (method != null) return method;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fail() {
|
||||
// Unused.
|
||||
|
||||
@@ -0,0 +1,287 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatnonfree</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>ncpcompataggregated</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>NCPCompatAggregated</name>
|
||||
<description>Aggregator for the NMS compat modules.</description>
|
||||
|
||||
<!-- Profile based activation of modules and dependencies. -->
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>all</id>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_12_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!-- ... -->
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_11_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_10_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_9_r2</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_9_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_8_r3</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_8_r2</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_8_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3100</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3043</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3026</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2922</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!-- Legacy, usupported
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2882</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2808</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2794</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2763</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2691</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2645</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2602</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2545</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2512</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
-->
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_12_r1</id>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_12_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_11_r1</id>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_11_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_10_r1</id>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_10_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_9_r2</id>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_9_r2</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_9_r1</id>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_9_r1</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_8_r3</id>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatspigotcb1_8_r3</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_7_r4</id>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3100</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>cblegacy</id>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3100</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3043</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3026</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2922</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2882</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2808</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2794</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2763</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2691</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2645</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!-- Legacy, unsupported
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2602</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2545</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2512</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
-->
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
Whitespace-only changes.
@@ -1,46 +1,34 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2645</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>NCPCompatCB2645</name>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatnonfree</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcore</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.5-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<artifactId>ncpcompatcb2645</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
|
||||
<description>Compatibility for CB 2645 (MC 1.5).
|
||||
</description>
|
||||
<name>NCPCompatCB2645</name>
|
||||
<description>Compatibility for CB2645 (MC 1.5).</description>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcore</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.5-R0.1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/craftbukkit-1.5-R0.1-20130317.180842-21.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
+5
-1
@@ -22,6 +22,7 @@ import org.bukkit.craftbukkit.v1_5_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_5_R1.entity.CraftEntity;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.LegacyBlocks;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import net.minecraft.server.v1_5_R1.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_5_R1.EntityBoat;
|
||||
@@ -109,10 +110,13 @@ public class BlockCacheCB2645 extends BlockCache {
|
||||
public double[] fetchBounds(final int x, final int y, final int z){
|
||||
|
||||
// TODO: change api for this / use nodes (!)
|
||||
final org.bukkit.Material mat = getType(x, y, z);
|
||||
@SuppressWarnings("deprecation")
|
||||
final int id = getType(x, y, z).getId();
|
||||
final int id = mat.getId();
|
||||
final net.minecraft.server.v1_5_R1.Block block = net.minecraft.server.v1_5_R1.Block.byId[id];
|
||||
if (block == null) return null;
|
||||
final double[] shape = LegacyBlocks.getShape(this, mat, x, y, z, true);
|
||||
if (shape != null) return shape;
|
||||
block.updateShape(iBlockAccess, x, y, z); // TODO: use THIS instead of world.
|
||||
|
||||
// minX, minY, minZ, maxX, maxY, maxZ
|
||||
|
||||
+5
@@ -183,6 +183,11 @@ public class MCAccessCB2645 implements MCAccess {
|
||||
return AlmostBoolean.NO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean resetActiveItem(Player player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void correctDirection(final Player player) {
|
||||
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
|
||||
|
||||
Whitespace-only changes.
@@ -1,46 +1,34 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2691</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>NCPCompatCB2691</name>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatnonfree</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcore</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.5.1-R0.3-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<artifactId>ncpcompatcb2691</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
|
||||
<description>Compatibility for CB2691 (1.5.1-R0.1 beta release).
|
||||
</description>
|
||||
<name>NCPCompatCB2691</name>
|
||||
<description>Compatibility for CB2691 (MC 1.5.1-R0.2 beta release).</description>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcore</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.5.1-R0.2</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/craftbukkit-1.5.1-R0.2-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
+5
-1
@@ -22,6 +22,7 @@ import org.bukkit.craftbukkit.v1_5_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_5_R2.entity.CraftEntity;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.LegacyBlocks;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import net.minecraft.server.v1_5_R2.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_5_R2.EntityBoat;
|
||||
@@ -109,10 +110,13 @@ public class BlockCacheCB2691 extends BlockCache {
|
||||
public double[] fetchBounds(final int x, final int y, final int z){
|
||||
|
||||
// TODO: change api for this / use nodes (!)
|
||||
final org.bukkit.Material mat = getType(x, y, z);
|
||||
@SuppressWarnings("deprecation")
|
||||
final int id = getType(x, y, z).getId();
|
||||
final int id = mat.getId();
|
||||
final net.minecraft.server.v1_5_R2.Block block = net.minecraft.server.v1_5_R2.Block.byId[id];
|
||||
if (block == null) return null;
|
||||
final double[] shape = LegacyBlocks.getShape(this, mat, x, y, z, true);
|
||||
if (shape != null) return shape;
|
||||
block.updateShape(iBlockAccess, x, y, z); // TODO: use THIS instead of world.
|
||||
|
||||
// minX, minY, minZ, maxX, maxY, maxZ
|
||||
|
||||
+5
@@ -185,6 +185,11 @@ public class MCAccessCB2691 implements MCAccess{
|
||||
return AlmostBoolean.NO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean resetActiveItem(Player player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void correctDirection(final Player player) {
|
||||
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
|
||||
|
||||
Whitespace-only changes.
@@ -1,46 +1,34 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2763</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>NCPCompatCB2763</name>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatnonfree</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcore</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.5.2-R1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<artifactId>ncpcompatcb2763</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
|
||||
<description>Compatibility for CB 2763 (MC 1.5.2).
|
||||
</description>
|
||||
<name>NCPCompatCB2763</name>
|
||||
<description>Compatibility for CB2763 (MC 1.5.2).</description>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcore</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.5.2-R1.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/craftbukkit-1.5.2-R1.0.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
+4
-1
@@ -22,6 +22,7 @@ import org.bukkit.craftbukkit.v1_5_R3.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_5_R3.entity.CraftEntity;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.LegacyBlocks;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import net.minecraft.server.v1_5_R3.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_5_R3.EntityBoat;
|
||||
@@ -107,11 +108,13 @@ public class BlockCacheCB2763 extends BlockCache {
|
||||
|
||||
@Override
|
||||
public double[] fetchBounds(final int x, final int y, final int z){
|
||||
|
||||
// TODO: change api for this / use nodes (!)
|
||||
final org.bukkit.Material mat = getType(x, y, z);
|
||||
final int id = iBlockAccess.getTypeId(x, y, z);
|
||||
final net.minecraft.server.v1_5_R3.Block block = net.minecraft.server.v1_5_R3.Block.byId[id];
|
||||
if (block == null) return null;
|
||||
final double[] shape = LegacyBlocks.getShape(this, mat, x, y, z, true);
|
||||
if (shape != null) return shape;
|
||||
block.updateShape(iBlockAccess, x, y, z); // TODO: use THIS instead of world.
|
||||
|
||||
// minX, minY, minZ, maxX, maxY, maxZ
|
||||
|
||||
+5
@@ -184,6 +184,11 @@ public class MCAccessCB2763 implements MCAccess{
|
||||
return AlmostBoolean.NO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean resetActiveItem(Player player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void correctDirection(final Player player) {
|
||||
// final EntityPlayer mcPlayer = ((CraftPlayer) player).getHandle();
|
||||
|
||||
Whitespace-only changes.
@@ -1,46 +1,34 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2794</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>NCPCompatCB2794</name>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatnonfree</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcore</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.6.1-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<artifactId>ncpcompatcb2794</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
|
||||
<description>Compatibility for CB 2794 (MC 1.6.1).
|
||||
</description>
|
||||
<name>NCPCompatCB2794</name>
|
||||
<description>Compatibility for CB2794 (MC 1.6.1).</description>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcore</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.6.1-R0.1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/craftbukkit-1.6.1-R0.1-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
+90
-5
@@ -23,6 +23,10 @@ import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
import net.minecraft.server.v1_6_R1.AttributeInstance;
|
||||
import net.minecraft.server.v1_6_R1.AttributeModifier;
|
||||
import net.minecraft.server.v1_6_R1.GenericAttributes;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
import fr.neatmonster.nocheatplus.utilities.moving.Magic;
|
||||
|
||||
|
||||
public class AttributeAccess implements IAttributeAccess {
|
||||
|
||||
@@ -33,25 +37,106 @@ public class AttributeAccess implements IAttributeAccess {
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSpeedAttributeMultiplier(Player player) {
|
||||
public double getSpeedMultiplier(Player player) {
|
||||
final AttributeInstance attr = ((CraftLivingEntity) player).getHandle().a(GenericAttributes.d);
|
||||
double val = attr.e() / attr.b();
|
||||
final AttributeModifier mod = attr.a(AttribUtil.ID_SPRINT_BOOST);
|
||||
if (mod == null) {
|
||||
return val;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return val / AttribUtil.getMultiplier(mod.c(), mod.d());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSprintAttributeMultiplier(Player player) {
|
||||
public float getMovementSpeed(final Player player) {
|
||||
// / by 2 to get the base value 0.1f
|
||||
return (player.getWalkSpeed() / 2f) * (float) getSpeedMultiplier(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSprintMultiplier(Player player) {
|
||||
final AttributeModifier mod = ((CraftLivingEntity) player).getHandle().a(GenericAttributes.d).a(AttribUtil.ID_SPRINT_BOOST);
|
||||
if (mod == null) {
|
||||
return 1.0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return AttribUtil.getMultiplier(mod.c(), mod.d());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Modern attributes. Not available for legacy versions. //
|
||||
////////////////////////////////////////////////////////////////
|
||||
@Override
|
||||
public double getGravity(Player player) {
|
||||
return Magic.DEFAULT_GRAVITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSafeFallDistance(Player player) {
|
||||
return Magic.FALL_DAMAGE_DIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getFallDamageMultiplier(Player player) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getBreakingSpeedMultiplier(Player player) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getJumpGainMultiplier(Player player) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerSneakingFactor(Player player) {
|
||||
return Magic.SNEAK_MULTIPLIER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerMaxBlockReach(Player player) {
|
||||
return 4.5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerMaxAttackReach(Player player) {
|
||||
return 3.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxStepUp(Player player) {
|
||||
final MovingConfig cc = DataManager.getPlayerData(player).getGenericInstance(MovingConfig.class);
|
||||
return cc.sfStepHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMovementEfficiency(Player player) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWaterMovementEfficiency(Player player) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSubmergedMiningSpeedMultiplier(Player player) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMiningEfficiency(Player player) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEntityScale(Player player) {
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
+5
-1
@@ -22,6 +22,7 @@ import org.bukkit.craftbukkit.v1_6_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_6_R1.entity.CraftEntity;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.LegacyBlocks;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import net.minecraft.server.v1_6_R1.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_6_R1.EntityBoat;
|
||||
@@ -109,10 +110,13 @@ public class BlockCacheCB2794 extends BlockCache {
|
||||
public double[] fetchBounds(final int x, final int y, final int z){
|
||||
|
||||
// TODO: change api for this / use nodes (!)
|
||||
final org.bukkit.Material mat = getType(x, y, z);
|
||||
@SuppressWarnings("deprecation")
|
||||
final int id = getType(x, y, z).getId();
|
||||
final int id = mat.getId();
|
||||
final net.minecraft.server.v1_6_R1.Block block = net.minecraft.server.v1_6_R1.Block.byId[id];
|
||||
if (block == null) return null;
|
||||
final double[] shape = LegacyBlocks.getShape(this, mat, x, y, z, true);
|
||||
if (shape != null) return shape;
|
||||
block.updateShape(iBlockAccess, x, y, z);
|
||||
|
||||
// minX, minY, minZ, maxX, maxY, maxZ
|
||||
|
||||
+5
@@ -187,4 +187,9 @@ public class MCAccessCB2794 implements MCAccess {
|
||||
// // Consider setting the lastYaw here too.
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean resetActiveItem(Player player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,46 +1,34 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2808</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>NCPCompatCB2808</name>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatnonfree</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcore</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.6.2-R1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<artifactId>ncpcompatcb2808</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
|
||||
<description>Compatibility for CB2808 (MC 1.6.2).
|
||||
</description>
|
||||
<name>NCPCompatCB2808</name>
|
||||
<description>Compatibility for CB2808 (MC 1.6.2).</description>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcore</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.6.2-R0.1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/craftbukkit-1.6.2-R0.1-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
+89
-4
@@ -23,6 +23,9 @@ import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
import net.minecraft.server.v1_6_R2.AttributeInstance;
|
||||
import net.minecraft.server.v1_6_R2.AttributeModifier;
|
||||
import net.minecraft.server.v1_6_R2.GenericAttributes;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
import fr.neatmonster.nocheatplus.utilities.moving.Magic;
|
||||
|
||||
public class AttributeAccess implements IAttributeAccess {
|
||||
|
||||
@@ -33,25 +36,107 @@ public class AttributeAccess implements IAttributeAccess {
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSpeedAttributeMultiplier(Player player) {
|
||||
public double getSpeedMultiplier(Player player) {
|
||||
final AttributeInstance attr = ((CraftLivingEntity) player).getHandle().getAttributeInstance(GenericAttributes.d);
|
||||
final double val = attr.getValue() / attr.b();
|
||||
final AttributeModifier mod = attr.a(AttribUtil.ID_SPRINT_BOOST);
|
||||
if (mod == null) {
|
||||
return val;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return val / AttribUtil.getMultiplier(mod.c(), mod.d());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSprintAttributeMultiplier(Player player) {
|
||||
public float getMovementSpeed(final Player player) {
|
||||
// / by 2 to get the base value 0.1f
|
||||
return (player.getWalkSpeed() / 2f) * (float) getSpeedMultiplier(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSprintMultiplier(Player player) {
|
||||
final AttributeModifier mod = ((CraftLivingEntity) player).getHandle().getAttributeInstance(GenericAttributes.d).a(AttribUtil.ID_SPRINT_BOOST);
|
||||
if (mod == null) {
|
||||
return 1.0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return AttribUtil.getMultiplier(mod.c(), mod.d());
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Modern attributes. Not available for legacy versions. //
|
||||
////////////////////////////////////////////////////////////////
|
||||
@Override
|
||||
public double getGravity(Player player) {
|
||||
return Magic.DEFAULT_GRAVITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSafeFallDistance(Player player) {
|
||||
return Magic.FALL_DAMAGE_DIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getFallDamageMultiplier(Player player) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getBreakingSpeedMultiplier(Player player) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getJumpGainMultiplier(Player player) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerSneakingFactor(Player player) {
|
||||
return Magic.SNEAK_MULTIPLIER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerMaxBlockReach(Player player) {
|
||||
return 4.5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPlayerMaxAttackReach(Player player) {
|
||||
return 3.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxStepUp(Player player) {
|
||||
final MovingConfig cc = DataManager.getPlayerData(player).getGenericInstance(MovingConfig.class);
|
||||
return cc.sfStepHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMovementEfficiency(Player player) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWaterMovementEfficiency(Player player) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSubmergedMiningSpeedMultiplier(Player player) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMiningEfficiency(Player player) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEntityScale(Player player) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
}
|
||||
Loaded 100 of 488 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user