mirror of
https://github.com/Updated-NoCheatPlus/NoCheatPlus.git
synced 2026-11-08 09:35:18 -05:00
Compare commits
345
Commits
v1.3-beta.1
..
v1.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
d2a2687b83 | ||
|
|
e90d8306a4 | ||
|
|
c84966bbd4 | ||
|
|
83426ab04f | ||
|
|
39e0f10019 | ||
|
|
008f1a7a7e | ||
|
|
55b9590a52 | ||
|
|
a73ad559df | ||
|
|
0bbd26dd9b | ||
|
|
b39f8e0bf4 | ||
|
|
c2512bc014 | ||
|
|
f588275d37 | ||
|
|
3034c8db7a | ||
|
|
d3be5af828 | ||
|
|
17d2c3245d | ||
|
|
41bf0cc684 | ||
|
|
0a973ff745 | ||
|
|
c7137ff5b6 | ||
|
|
e1357e96f2 | ||
|
|
2b313d70fa | ||
|
|
517e4be891 | ||
|
|
08b2f47404 | ||
|
|
9a2473029f | ||
|
|
f6a1d2bed7 | ||
|
|
f5ad1d36ae | ||
|
|
7d41589529 | ||
|
|
ab4d0a9004 | ||
|
|
a823f1e6e8 | ||
|
|
4736f75563 | ||
|
|
3ea26bf0cb | ||
|
|
eb52a3c516 | ||
|
|
e770a09342 | ||
|
|
6bd529cc40 | ||
|
|
07aed9bb6c | ||
|
|
38ff02682a | ||
|
|
43195a3a8d | ||
|
|
9500b491f0 | ||
|
|
b91bceaf38 | ||
|
|
7473559e6f | ||
|
|
2a1678dcb5 | ||
|
|
3822f69fe3 | ||
|
|
bda7cc7742 | ||
|
|
1e3e2b0842 | ||
|
|
83a391d15d | ||
|
|
2e26c51988 | ||
|
|
d640a702d6 | ||
|
|
eee2eab5ce | ||
|
|
1822366c87 | ||
|
|
bc6b9e548f | ||
|
|
77d9a806cc | ||
|
|
c5ccf0c237 | ||
|
|
d1b6bc0ac2 | ||
|
|
0f57ca23a6 | ||
|
|
5b6d0475da | ||
|
|
36af146c10 | ||
|
|
263ec46f19 | ||
|
|
df58970cd9 | ||
|
|
3e2a99e2e5 | ||
|
|
c24346708d | ||
|
|
94ed22789c | ||
|
|
2e41d0273d | ||
|
|
e47260d5c7 | ||
|
|
8286810566 | ||
|
|
63c9e403e4 | ||
|
|
b4e4999803 | ||
|
|
20fc013b6e | ||
|
|
b3143bc432 | ||
|
|
cc96d90199 | ||
|
|
b3da6cf1af | ||
|
|
50d5fdffb6 | ||
|
|
e746ba5c92 | ||
|
|
7d01b45e93 | ||
|
|
f0d22a110d | ||
|
|
e1b11c367c | ||
|
|
2ada6d74cc | ||
|
|
7b8d285c83 | ||
|
|
35cc00b3b2 | ||
|
|
60a8b7db9d | ||
|
|
ff0497ec62 | ||
|
|
9a32beb9ba | ||
|
|
b880e5ddd2 | ||
|
|
bf431db516 | ||
|
|
110de1eef3 | ||
|
|
15d2923407 | ||
|
|
528cf5e5e1 | ||
|
|
90d0f41824 | ||
|
|
2dca31bf63 | ||
|
|
f287974765 | ||
|
|
a5021c5bdb | ||
|
|
3d7f20bb29 | ||
|
|
2e05c37f25 | ||
|
|
b069c6c494 | ||
|
|
1f6bc2694a | ||
|
|
e72929d87b | ||
|
|
e4569977e9 | ||
|
|
de08c6d400 | ||
|
|
55263ce969 | ||
|
|
327be7b302 | ||
|
|
2537611620 | ||
|
|
7c9a081a63 | ||
|
|
7da9bde43f | ||
|
|
52e3ea1556 | ||
|
|
f599946e3c | ||
|
|
693789a448 | ||
|
|
485f4d2e82 | ||
|
|
e1b554edd0 | ||
|
|
bd46085c46 | ||
|
|
6d4dbb28e8 | ||
|
|
4a192f3a1b | ||
|
|
a3b3d4a482 | ||
|
|
e44da6266f | ||
|
|
d737693787 | ||
|
|
b7b684917e | ||
|
|
3e0af41412 | ||
|
|
a8060ff3d2 | ||
|
|
cd5444b794 | ||
|
|
770b0b9322 | ||
|
|
47f2e0267c | ||
|
|
361c1e8355 | ||
|
|
cbcef74a54 | ||
|
|
6bb4f682e9 | ||
|
|
b638d0dff9 | ||
|
|
9961dc99b7 | ||
|
|
5d32ce87af | ||
|
|
e4761ef731 | ||
|
|
682a5717f5 | ||
|
|
c9787ac81b | ||
|
|
1cfab2ee1a | ||
|
|
fb114c3532 | ||
|
|
5f89bbf462 | ||
|
|
a2ac285c0c | ||
|
|
b58049b81a | ||
|
|
da9f94e566 | ||
|
|
cc50883150 | ||
|
|
8c1408546a | ||
|
|
8fda3b0d1f | ||
|
|
9cd142e942 | ||
|
|
e7560fa894 | ||
|
|
e7761cc1e4 | ||
|
|
ae8d5bcd01 | ||
|
|
e60343cd52 | ||
|
|
e20b240669 | ||
|
|
791fabcaf8 | ||
|
|
168eadfec2 | ||
|
|
6511de888c | ||
|
|
2a84e271d7 | ||
|
|
6c25848136 | ||
|
|
ead9915bf3 | ||
|
|
c471130756 | ||
|
|
e9516a9bb3 | ||
|
|
205d7957c3 | ||
|
|
ada91e81cf | ||
|
|
6778416d61 | ||
|
|
76e51ac36b | ||
|
|
5f7f364061 | ||
|
|
8d72767061 | ||
|
|
b7c5c085a9 | ||
|
|
7db23f7cbd | ||
|
|
a4475f5e97 | ||
|
|
c5370ced6f | ||
|
|
cf0d6af701 | ||
|
|
e28479d6c5 | ||
|
|
eb6ba15e50 | ||
|
|
8a03e8ef12 | ||
|
|
86c9137c23 | ||
|
|
26524a6436 | ||
|
|
d7a4e9be77 | ||
|
|
50dc07e8a4 | ||
|
|
2c295f56dd | ||
|
|
6b33f681dd | ||
|
|
7eecae02d4 | ||
|
|
d2a33779fd | ||
|
|
201dae4c1d | ||
|
|
8b908220ef | ||
|
|
9b4589b264 | ||
|
|
9b75344e3e | ||
|
|
a3d64dd5c7 | ||
|
|
3e9f405451 | ||
|
|
c8df5b33ed | ||
|
|
407f8e14f9 | ||
|
|
d3b53bb68b | ||
|
|
280d537064 | ||
|
|
67b7f49af7 | ||
|
|
6eb88e3106 | ||
|
|
3d85f8dd89 | ||
|
|
d9fb5e1444 | ||
|
|
ea685240a3 | ||
|
|
c800e1cc26 | ||
|
|
ab690f7e72 | ||
|
|
84a32fbcf8 | ||
|
|
8dbdeded5e | ||
|
|
47947fc1c5 | ||
|
|
235f937056 | ||
|
|
ad6d1ffe91 | ||
|
|
f6b3ab0a9d | ||
|
|
1075d63244 | ||
|
|
784aed2a0c | ||
|
|
7791cff8a0 | ||
|
|
dd7eebd3a1 | ||
|
|
25b96ca846 | ||
|
|
096bb7ff2d | ||
|
|
f32303cfd7 | ||
|
|
152859da78 | ||
|
|
b44c1eb280 | ||
|
|
687fcafd3d | ||
|
|
9e5ab88f28 | ||
|
|
49a31edc15 | ||
|
|
c8077b43a8 | ||
|
|
be047840c7 | ||
|
|
dec9f754e6 | ||
|
|
063f9fd116 | ||
|
|
0d652109d2 | ||
|
|
ba3348e02e | ||
|
|
c06e2b6468 | ||
|
|
cb6113a36e | ||
|
|
60647d3a03 | ||
|
|
e853eacb3a | ||
|
|
908751e7b6 | ||
|
|
a0d75fc566 | ||
|
|
7f65bd12e6 | ||
|
|
82e8e389c0 | ||
|
|
16b32cb953 | ||
|
|
a6b09f90a1 | ||
|
|
7b4a48e8a9 | ||
|
|
69463aff6b | ||
|
|
75eaab9da0 | ||
|
|
34cd09a70c | ||
|
|
a628b4597c | ||
|
|
94bb30781a | ||
|
|
c0fbe776f0 | ||
|
|
3d9d66e199 | ||
|
|
c58ab8e676 | ||
|
|
a2562d1e6e | ||
|
|
a6f1119db0 | ||
|
|
cf8be9da54 | ||
|
|
13d14b1fc6 | ||
|
|
bdf2fc950a | ||
|
|
c69b6f8e8b | ||
|
|
af429a1740 | ||
|
|
d45afcf169 | ||
|
|
c5e1b47a97 | ||
|
|
9c2c0a5326 | ||
|
|
ae34de5ba1 | ||
|
|
3afbbaea79 | ||
|
|
243dac7aed | ||
|
|
266a15c4bf | ||
|
|
70d58208cc | ||
|
|
755514d4c5 | ||
|
|
3141a08a5e | ||
|
|
82fd3226a4 | ||
|
|
040e7bc73a | ||
|
|
0a9f832a06 | ||
|
|
8a45246d2c | ||
|
|
5ae32be309 | ||
|
|
47cf9d9833 | ||
|
|
391a8af30b | ||
|
|
853ce8dba4 | ||
|
|
ea3b11a435 | ||
|
|
2ffa0c726c | ||
|
|
3de05e27c4 | ||
|
|
5a42e3fc37 | ||
|
|
612b073824 | ||
|
|
fec7f4bcbc | ||
|
|
a00921fafc | ||
|
|
73ed92e299 |
No files matched your search
@@ -2,7 +2,7 @@
|
||||
name: Feature/Check Request
|
||||
about: 'Suggest a feature or check '
|
||||
title: ''
|
||||
labels: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.13-R0.1-SNAPSHOT</version>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.15-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -43,4 +43,5 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
||||
+2
-2
@@ -70,7 +70,7 @@ 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))
|
||||
if (type != EntityType.BOAT && type != EntityType.SHULKER){ // && !(other instanceof Minecart))
|
||||
continue;
|
||||
}
|
||||
final double locY = entity.getLocation(useLoc).getY();
|
||||
@@ -97,4 +97,4 @@ public class BlockCacheBukkit extends BlockCache {
|
||||
world = null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -116,7 +116,7 @@ public class MCAccessBukkitBase implements MCAccess {
|
||||
public String getMCVersion() {
|
||||
// Bukkit API.
|
||||
// TODO: maybe output something else.
|
||||
return "1.4.6-1.11.2|?"; // uh oh
|
||||
return "1.6.1-1.14.4|?"; // uh oh
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+110
-17
@@ -21,17 +21,7 @@ import org.bukkit.Material;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMaterial;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.init.BlockInit;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitDirectionalCentered;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitDoor;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitEndPortalFrame;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitFence;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitGate;
|
||||
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.BukkitStairs;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitStatic;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitTrapDoor;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.*;
|
||||
import fr.neatmonster.nocheatplus.config.WorldConfigProvider;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockFlags;
|
||||
@@ -48,9 +38,13 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
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();
|
||||
|
||||
// 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();
|
||||
|
||||
// Blocks that have a different shape, based on how they have been placed.
|
||||
private static final BukkitShapeModel MODEL_SLAB = new BukkitSlab();
|
||||
@@ -63,17 +57,30 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
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_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_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_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?
|
||||
0.0625, 0.875);
|
||||
private static final BukkitShapeModel MODEL_HONEY_BLOCK = new BukkitStatic(
|
||||
0.0625, 0.9375);
|
||||
|
||||
// Static blocks with full height sorted by inset.
|
||||
private static final BukkitShapeModel MODEL_INSET16_1_HEIGHT100 = new BukkitStatic(
|
||||
@@ -117,7 +124,7 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
|
||||
@Override
|
||||
public String getMCVersion() {
|
||||
return "1.13|?";
|
||||
return "1.13.2-1.15|?";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -135,10 +142,21 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
|
||||
// TODO: Also consider removing flags (passable_x4 etc).
|
||||
|
||||
// Adjust flags for individual blocks.
|
||||
// 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);
|
||||
|
||||
// Directly keep blocks as is.
|
||||
for (final Material mat : new Material[] {
|
||||
@@ -146,11 +164,25 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
BridgeMaterial.COBWEB,
|
||||
Material.HOPPER,
|
||||
BridgeMaterial.MOVING_PISTON,
|
||||
Material.SNOW
|
||||
Material.SNOW,
|
||||
Material.CAKE,
|
||||
Material.BEACON,
|
||||
Material.LADDER,
|
||||
Material.VINE,
|
||||
Material.CHORUS_FLOWER
|
||||
}) {
|
||||
processedBlocks.add(mat);
|
||||
}
|
||||
|
||||
//Anvil
|
||||
for (Material mat : new Material[] {
|
||||
Material.ANVIL,
|
||||
Material.CHIPPED_ANVIL,
|
||||
Material.DAMAGED_ANVIL
|
||||
}) {
|
||||
addModel(mat, MODEL_ANVIL);
|
||||
}
|
||||
|
||||
// Lily pad
|
||||
addModel(BridgeMaterial.LILY_PAD, MODEL_LILY_PAD);
|
||||
|
||||
@@ -238,7 +270,35 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
for (Material mat : MaterialUtil.FLOWER_POTS) {
|
||||
addModel(mat, MODEL_FLOWER_POT);
|
||||
}
|
||||
|
||||
|
||||
// Turtle Eggs.
|
||||
for (Material mat : new Material[] {
|
||||
Material.TURTLE_EGG
|
||||
}) {
|
||||
addModel(mat, MODEL_TURTLE_EGG);
|
||||
}
|
||||
|
||||
// Conduit
|
||||
for (Material mat : new Material[] {
|
||||
Material.CONDUIT
|
||||
}) {
|
||||
addModel(mat, MODEL_CONDUIT);
|
||||
}
|
||||
|
||||
// Cocoa
|
||||
for (Material mat : new Material[] {
|
||||
Material.COCOA
|
||||
}) {
|
||||
addModel(mat, MODEL_COCOA);
|
||||
}
|
||||
|
||||
// Sea Pickles
|
||||
for (Material mat : new Material[] {
|
||||
Material.SEA_PICKLE
|
||||
}) {
|
||||
addModel(mat, MODEL_SEA_PICKLE);
|
||||
}
|
||||
|
||||
// Carpets.
|
||||
for (final Material mat : MaterialUtil.CARPETS) {
|
||||
addModel(mat, MODEL_XZ100_HEIGHT16_1);
|
||||
@@ -248,6 +308,9 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
for (final Material mat : MaterialUtil.HEADS_GROUND) {
|
||||
addModel(mat, MODEL_GROUND_HEAD);
|
||||
}
|
||||
for (final Material mat : MaterialUtil.HEADS_WALL) {
|
||||
addModel(mat, MODEL_WALL_HEAD);
|
||||
}
|
||||
|
||||
// Doors.
|
||||
for (final Material mat : MaterialUtil.ALL_DOORS) {
|
||||
@@ -258,7 +321,33 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
for (final Material mat : MaterialUtil.ALL_TRAP_DOORS) {
|
||||
addModel(mat, MODEL_TRAP_DOOR);
|
||||
}
|
||||
|
||||
// Chorus Plant.
|
||||
for (Material mat : new Material[] {
|
||||
Material.CHORUS_PLANT
|
||||
}) {
|
||||
addModel(mat, MODEL_CHORUS_PLANT);
|
||||
}
|
||||
|
||||
//Lantern
|
||||
Material mt = BridgeMaterial.getBlock("lantern");
|
||||
if (mt != null) addModel(mt, MODEL_LANTERN);
|
||||
|
||||
// Lectern
|
||||
mt = BridgeMaterial.getBlock("lectern");
|
||||
if (mt != null) addModel(mt, MODEL_LECTERN);
|
||||
|
||||
// Bamboo
|
||||
mt = BridgeMaterial.getBlock("bamboo");
|
||||
if (mt != null) addModel(mt, MODEL_BAMBOO);
|
||||
|
||||
// Bell
|
||||
mt = BridgeMaterial.getBlock("bell");
|
||||
if (mt != null) addModel(mt, MODEL_BELL);
|
||||
|
||||
mt = BridgeMaterial.getBlock("honey_block");
|
||||
if (mt != null) addModel(mt, MODEL_HONEY_BLOCK);
|
||||
|
||||
// Sort to processed by flags.
|
||||
for (final Material mat : Material.values()) {
|
||||
final long flags = BlockProperties.getBlockFlags(mat);
|
||||
@@ -266,7 +355,7 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockProperties.F_STAIRS)) {
|
||||
addModel(mat, MODEL_STAIRS);
|
||||
}
|
||||
// Fences, cobblestone wall.
|
||||
// Fences.
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockProperties.F_THICK_FENCE)) {
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockProperties.F_PASSABLE_X4)) {
|
||||
// TODO: Perhaps another model flag.
|
||||
@@ -276,6 +365,10 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
addModel(mat, MODEL_THICK_FENCE);
|
||||
}
|
||||
}
|
||||
// Walls
|
||||
if (BlockFlags.hasAnyFlag(flags, BlockProperties.F_THICK_FENCE2)) {
|
||||
addModel(mat, MODEL_THICK_FENCE2);
|
||||
}
|
||||
}
|
||||
|
||||
super.setupBlockProperties(worldConfigProvider);
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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 BukkitAnvil 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);
|
||||
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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 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 java.text.DecimalFormat;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
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) {
|
||||
|
||||
//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};
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* 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.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) {
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* 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.MultipleFacing;
|
||||
|
||||
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) {
|
||||
|
||||
final Block block = world.getBlockAt(x, y, 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* 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.Directional;
|
||||
import org.bukkit.block.data.type.Cocoa;
|
||||
|
||||
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) {
|
||||
final Block block = world.getBlockAt(x, y, 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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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.Lantern;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitLantern implements BukkitShapeModel {
|
||||
|
||||
private double xz = 0.33;
|
||||
@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);
|
||||
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};
|
||||
}
|
||||
return new double[] {xz, 0.0, xz, 1.0 - xz, 0.5625, 1.0 - xz};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* 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.SeaPickle;
|
||||
|
||||
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) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
|
||||
if (blockData instanceof SeaPickle) {
|
||||
final SeaPickle pick = (SeaPickle) blockData;
|
||||
switch (pick.getPickles()) {
|
||||
case 1: // .375 , 0 , .375 max: .625 , 375 , .625
|
||||
return new double[] {0.375, 0.0, 0.375, 0.625, 0.375, 0.625};
|
||||
case 2: // .1875 , 0 , .1875 max: .8125 , .375 , .8125
|
||||
return new double[] {0.1875, 0.0, 0.1875, 0.8125, 0.375, 0.8125};
|
||||
case 3: // .125 0 .125 max: .875 .375 .875
|
||||
return new double[] {0.125, 0.0, 0.125, 0.875, 0.375, 0.875};
|
||||
case 4: // .125 0 .125 max: .875 .4375 .875
|
||||
return new double[] {0.125, 0.0, 0.125, 0.875, 0.4375, 0.875};
|
||||
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) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+17
-7
@@ -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;
|
||||
@@ -67,12 +66,23 @@ public class BukkitTrapDoor implements BukkitShapeModel {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 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.TurtleEgg;
|
||||
|
||||
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) {
|
||||
final Block block = world.getBlockAt(x, y, z);
|
||||
final BlockState state = block.getState();
|
||||
final BlockData blockData = state.getBlockData();
|
||||
|
||||
if (blockData instanceof TurtleEgg) {
|
||||
final TurtleEgg egg = (TurtleEgg) blockData;
|
||||
switch (egg.getEggs()) {
|
||||
case 1: // .8125 0.0 .1875 max: .25 .4375 .75
|
||||
return new double[] {0.23, 0.0, 0.23, 0.75, 0.4375, 0.75};
|
||||
case 2: // .9375 .0 .0625 max: 0.0625 .4375 .9375
|
||||
case 3:
|
||||
case 4:
|
||||
return new double[] {0.0625, 0.0, 0.0625, 0.9375, 0.4375, 0.9375};
|
||||
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) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* 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 java.util.Set;
|
||||
|
||||
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.MultipleFacing;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
|
||||
public class BukkitWall implements BukkitShapeModel {
|
||||
|
||||
private final double minXZ;
|
||||
private final double maxXZ;
|
||||
private final double height;
|
||||
|
||||
public BukkitWall(double inset, double height) {
|
||||
this(inset, 1.0 - inset, height);
|
||||
}
|
||||
|
||||
public BukkitWall(double minXZ, double maxXZ, double height) {
|
||||
this.minXZ = minXZ;
|
||||
this.maxXZ = maxXZ;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
@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);
|
||||
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.
|
||||
double[] res = new double[] {minXZ, 0.0, minXZ, maxXZ, height, maxXZ};
|
||||
for (final BlockFace face : fence.getFaces()) {
|
||||
switch (face) {
|
||||
case EAST:
|
||||
res[3] = 1.0;
|
||||
break;
|
||||
case NORTH:
|
||||
res[2] = 0.0;
|
||||
break;
|
||||
case WEST:
|
||||
res[0] = 0.0;
|
||||
break;
|
||||
case SOUTH:
|
||||
res[5] = 1.0;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
+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.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Directional;
|
||||
|
||||
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) {
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
+4
-4
@@ -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.MCAccessBukkitBase;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.MCAccessBukkitModern;
|
||||
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 MCAccessBukkitBase {
|
||||
public class MCAccessCBReflect extends MCAccessBukkitModern {
|
||||
|
||||
protected final ReflectHelper helper;
|
||||
|
||||
@@ -53,7 +53,7 @@ public class MCAccessCBReflect extends MCAccessBukkitBase {
|
||||
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.12.2") > 0) {
|
||||
else if (GenericVersion.compareVersions(mcVersion, "1.14.4") > 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 {
|
||||
@@ -71,7 +71,7 @@ public class MCAccessCBReflect extends MCAccessBukkitBase {
|
||||
@Override
|
||||
public String getMCVersion() {
|
||||
// Potentially all :p.
|
||||
return "1.4.5-1.12.2|?";
|
||||
return "1.7-1.14.4|?";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.10-R0.1-SNAPSHOT</version>
|
||||
<version>1.10.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -32,9 +32,9 @@
|
||||
|
||||
To add a new compat module the pom.xml file within NCPCompatNonFree has to be modified:
|
||||
- Add as module within the profile with id 'all'.
|
||||
- Add as dependency within the profile with id 'all'.
|
||||
- (Add a new profile with both the module and dependency set.)
|
||||
|
||||
- Add as dependency within the profile with id 'all'.
|
||||
- (Add a new profile with both the module and dependency set.)
|
||||
|
||||
The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, EntityAccessFactory, AttributeAccessFactory).</description>
|
||||
|
||||
<build>
|
||||
@@ -49,4 +49,4 @@ The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, Enti
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
@@ -23,7 +23,7 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.11.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.11-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -32,9 +32,9 @@
|
||||
|
||||
To add a new compat module the pom.xml file within NCPCompatNonFree has to be modified:
|
||||
- Add as module within the profile with id 'all'.
|
||||
- Add as dependency within the profile with id 'all'.
|
||||
- (Add a new profile with both the module and dependency set.)
|
||||
|
||||
- Add as dependency within the profile with id 'all'.
|
||||
- (Add a new profile with both the module and dependency set.)
|
||||
|
||||
The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, EntityAccessFactory, AttributeAccessFactory).</description>
|
||||
|
||||
<build>
|
||||
@@ -49,4 +49,4 @@ The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, Enti
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
@@ -23,7 +23,7 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.8.4-R0.1-SNAPSHOT</version>
|
||||
<version>1.8.8-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -39,4 +39,4 @@
|
||||
</plugins>
|
||||
</build>
|
||||
<description>Compatibility for Minecraft 1.8.4-1.8.6 with CraftBukkit/Spigot (1_8_R3).</description>
|
||||
</project>
|
||||
</project>
|
||||
+379
-379
@@ -1,381 +1,381 @@
|
||||
<?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>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatnonfree</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<name>NCPCompatNonFree</name>
|
||||
<description>Combine compatibility modules with dependencies that can't be obtained from a public maven repository, such as CraftBukkit or Spigot builds, hence "NonFree".
|
||||
|
||||
<?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>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatnonfree</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<name>NCPCompatNonFree</name>
|
||||
<description>Combine compatibility modules with dependencies that can't be obtained from a public maven repository, such as CraftBukkit or Spigot builds, hence "NonFree".
|
||||
|
||||
To add a new compat module:
|
||||
- Add as module within the profile with id 'all'.
|
||||
- Add as dependency within the profile with id 'all'.
|
||||
- (Add a new profile with both the module and dependency set.)
|
||||
|
||||
The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, EntityAccessFactory, AttributeAccessFactory).</description>
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<!-- Profile based activation of modules and dependencies. -->
|
||||
<profiles>
|
||||
|
||||
<profile>
|
||||
<id>all</id>
|
||||
|
||||
<modules>
|
||||
<module>NCPCompatCB2512</module>
|
||||
<module>NCPCompatCB2545</module>
|
||||
<module>NCPCompatCB2602</module>
|
||||
<module>NCPCompatCB2645</module>
|
||||
<module>NCPCompatCB2691</module>
|
||||
<module>NCPCompatCB2763</module>
|
||||
<module>NCPCompatCB2794</module>
|
||||
<module>NCPCompatCB2808</module>
|
||||
<module>NCPCompatCB2882</module>
|
||||
<module>NCPCompatCB2922</module>
|
||||
<module>NCPCompatCB3026</module>
|
||||
<module>NCPCompatCB3043</module>
|
||||
<module>NCPCompatCB3100</module>
|
||||
<module>NCPCompatSpigotCB1_8_R1</module>
|
||||
<module>NCPCompatSpigotCB1_8_R2</module>
|
||||
<module>NCPCompatSpigotCB1_8_R3</module>
|
||||
<module>NCPCompatSpigotCB1_9_R1</module>
|
||||
<module>NCPCompatSpigotCB1_9_R2</module>
|
||||
<module>NCPCompatSpigotCB1_10_R1</module>
|
||||
<module>NCPCompatSpigotCB1_11_R1</module>
|
||||
<!-- ... -->
|
||||
<module>NCPCompatCBDev</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcbdev</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>
|
||||
<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>cbdev</id>
|
||||
<modules>
|
||||
<module>NCPCompatCBDev</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcbdev</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<!-- ... -->
|
||||
|
||||
<profile>
|
||||
<id>spigot1_12_r1</id>
|
||||
<modules>
|
||||
<module>NCPCompatCBDev</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcbdev</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_11_r1</id>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_11_R1</module>
|
||||
</modules>
|
||||
<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>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_10_R1</module>
|
||||
</modules>
|
||||
<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>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_9_R2</module>
|
||||
</modules>
|
||||
<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>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_9_R1</module>
|
||||
</modules>
|
||||
<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>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_8_R3</module>
|
||||
</modules>
|
||||
<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>
|
||||
<modules>
|
||||
<module>NCPCompatCB3100</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3100</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>cblegacy</id>
|
||||
|
||||
<modules>
|
||||
<module>NCPCompatCB2512</module>
|
||||
<module>NCPCompatCB2545</module>
|
||||
<module>NCPCompatCB2602</module>
|
||||
<module>NCPCompatCB2645</module>
|
||||
<module>NCPCompatCB2691</module>
|
||||
<module>NCPCompatCB2763</module>
|
||||
<module>NCPCompatCB2794</module>
|
||||
<module>NCPCompatCB2808</module>
|
||||
<module>NCPCompatCB2882</module>
|
||||
<module>NCPCompatCB2922</module>
|
||||
<module>NCPCompatCB3026</module>
|
||||
<module>NCPCompatCB3043</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<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>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2602</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>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>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
- Add as dependency within the profile with id 'all'.
|
||||
- (Add a new profile with both the module and dependency set.)
|
||||
|
||||
The NCPPlugin sub-project contains the relevant factories (MCAccessFactory, EntityAccessFactory, AttributeAccessFactory).</description>
|
||||
<parent>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>nocheatplus-parent</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<!-- Profile based activation of modules and dependencies. -->
|
||||
<profiles>
|
||||
|
||||
<profile>
|
||||
<id>all</id>
|
||||
|
||||
<modules>
|
||||
<!-- <module>NCPCompatCB2512</module>
|
||||
<module>NCPCompatCB2545</module>
|
||||
<module>NCPCompatCB2602</module>
|
||||
<module>NCPCompatCB2645</module>
|
||||
<module>NCPCompatCB2691</module>
|
||||
<module>NCPCompatCB2763</module>
|
||||
<module>NCPCompatCB2794</module>
|
||||
<module>NCPCompatCB2808</module>
|
||||
<module>NCPCompatCB2882</module> -->
|
||||
<module>NCPCompatCB2922</module>
|
||||
<module>NCPCompatCB3026</module>
|
||||
<module>NCPCompatCB3043</module>
|
||||
<module>NCPCompatCB3100</module>
|
||||
<module>NCPCompatSpigotCB1_8_R1</module>
|
||||
<module>NCPCompatSpigotCB1_8_R2</module>
|
||||
<module>NCPCompatSpigotCB1_8_R3</module>
|
||||
<module>NCPCompatSpigotCB1_9_R1</module>
|
||||
<module>NCPCompatSpigotCB1_9_R2</module>
|
||||
<module>NCPCompatSpigotCB1_10_R1</module>
|
||||
<module>NCPCompatSpigotCB1_11_R1</module>
|
||||
<!-- ... -->
|
||||
<module>NCPCompatCBDev</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcbdev</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>
|
||||
<!-- <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>cbdev</id>
|
||||
<modules>
|
||||
<module>NCPCompatCBDev</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcbdev</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<!-- ... -->
|
||||
|
||||
<profile>
|
||||
<id>spigot1_12_r1</id>
|
||||
<modules>
|
||||
<module>NCPCompatCBDev</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcbdev</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spigot1_11_r1</id>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_11_R1</module>
|
||||
</modules>
|
||||
<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>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_10_R1</module>
|
||||
</modules>
|
||||
<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>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_9_R2</module>
|
||||
</modules>
|
||||
<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>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_9_R1</module>
|
||||
</modules>
|
||||
<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>
|
||||
<modules>
|
||||
<module>NCPCompatSpigotCB1_8_R3</module>
|
||||
</modules>
|
||||
<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>
|
||||
<modules>
|
||||
<module>NCPCompatCB3100</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb3100</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>cblegacy</id>
|
||||
|
||||
<modules>
|
||||
<module>NCPCompatCB2512</module>
|
||||
<module>NCPCompatCB2545</module>
|
||||
<module>NCPCompatCB2602</module>
|
||||
<module>NCPCompatCB2645</module>
|
||||
<module>NCPCompatCB2691</module>
|
||||
<module>NCPCompatCB2763</module>
|
||||
<module>NCPCompatCB2794</module>
|
||||
<module>NCPCompatCB2808</module>
|
||||
<module>NCPCompatCB2882</module>
|
||||
<module>NCPCompatCB2922</module>
|
||||
<module>NCPCompatCB3026</module>
|
||||
<module>NCPCompatCB3043</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<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>
|
||||
<dependency>
|
||||
<groupId>fr.neatmonster</groupId>
|
||||
<artifactId>ncpcompatcb2602</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>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>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -22,9 +22,9 @@
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.12-pre2-SNAPSHOT</version>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.15-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.comphenix.protocol</groupId>
|
||||
<artifactId>ProtocolLib-API</artifactId>
|
||||
<version>4.3.0-SNAPSHOT</version>
|
||||
<artifactId>ProtocolLib</artifactId>
|
||||
<version>4.5.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<description>Features using the plugin ProtocolLib:
|
||||
<description>Features using the plugin ProtocolLib:
|
||||
https://dev.bukkit.org/bukkit-plugins/protocollib/</description>
|
||||
|
||||
<build>
|
||||
@@ -56,4 +56,4 @@ https://dev.bukkit.org/bukkit-plugins/protocollib/</description>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
+1
@@ -68,6 +68,7 @@ public class CatchAllAdapter extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(PacketEvent event) {
|
||||
if (event.isPlayerTemporary()) return;
|
||||
final Player player = event.getPlayer();
|
||||
if (player == null) {
|
||||
counters.add(ProtocolLibComponent.idNullPlayer, 1);
|
||||
|
||||
+1
@@ -35,6 +35,7 @@ public class DebugAdapter extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(PacketEvent event) {
|
||||
if (event.isPlayerTemporary()) return;
|
||||
final Player player = event.getPlayer();
|
||||
if (DataManager.getPlayerDataSafe(player).isDebugActive(CheckType.NET)) {
|
||||
debug(player, "packet: " + event.getPacketType());
|
||||
|
||||
+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.checks.net.protocollib;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.comphenix.protocol.PacketType;
|
||||
import com.comphenix.protocol.events.ListenerPriority;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.fight.FightData;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
|
||||
public class Fight extends BaseAdapter{
|
||||
private static PacketType[] initPacketTypes() {
|
||||
final List<PacketType> types = new LinkedList<PacketType>(Arrays.asList(
|
||||
PacketType.Play.Client.ARM_ANIMATION
|
||||
));
|
||||
return types.toArray(new PacketType[types.size()]);
|
||||
}
|
||||
|
||||
public Fight(Plugin plugin) {
|
||||
super(plugin, ListenerPriority.LOW, initPacketTypes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(final PacketEvent event) {
|
||||
handleAnmationPacket(event);
|
||||
}
|
||||
|
||||
public void handleAnmationPacket(final PacketEvent event) {
|
||||
if (event.isPlayerTemporary()) return;
|
||||
final FightData data = DataManager.getGenericInstance(event.getPlayer(), FightData.class);
|
||||
data.noSwingPacket = true;
|
||||
data.noSwingArmSwung = true;
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -57,7 +57,8 @@ public class KeepAliveAdapter extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(final PacketEvent event) {
|
||||
final long time = System.currentTimeMillis();
|
||||
if (event.isPlayerTemporary()) return;
|
||||
final long time = System.currentTimeMillis();
|
||||
final Player player = event.getPlayer();
|
||||
if (player == null) {
|
||||
counters.add(ProtocolLibComponent.idNullPlayer, 1);
|
||||
|
||||
+55
-3
@@ -21,6 +21,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
@@ -34,6 +35,7 @@ import com.comphenix.protocol.reflect.StructureModifier;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.net.FlyingFrequency;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetData;
|
||||
@@ -41,6 +43,7 @@ import fr.neatmonster.nocheatplus.checks.net.model.DataPacketFlying;
|
||||
import fr.neatmonster.nocheatplus.checks.net.model.DataPacketFlying.PACKET_CONTENT;
|
||||
import fr.neatmonster.nocheatplus.checks.net.model.TeleportQueue.AckReference;
|
||||
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
import fr.neatmonster.nocheatplus.logging.Streams;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
@@ -50,6 +53,7 @@ import fr.neatmonster.nocheatplus.utilities.CheckUtils;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.count.ActionFrequency;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.LocUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.TrigUtil;
|
||||
import fr.neatmonster.nocheatplus.worlds.IWorldData;
|
||||
|
||||
/**
|
||||
@@ -72,6 +76,8 @@ public class MovingFlying extends BaseAdapter {
|
||||
public static final int indexStance = 3;
|
||||
public static final int indexYaw = 0;
|
||||
public static final int indexPitch = 1;
|
||||
|
||||
private final Plugin plugin = Bukkit.getPluginManager().getPlugin("NoCheatPlus");
|
||||
|
||||
private static PacketType[] initPacketTypes() {
|
||||
final List<PacketType> types = new LinkedList<PacketType>(Arrays.asList(
|
||||
@@ -82,7 +88,7 @@ public class MovingFlying extends BaseAdapter {
|
||||
));
|
||||
// Add confirm teleport.
|
||||
// PacketPlayInTeleportAccept
|
||||
PacketType confirmType = ProtocolLibComponent.findPacketTypeByName(Protocol.PLAY, Sender.CLIENT, "PacketPlayInTeleportAccept");
|
||||
PacketType confirmType = ProtocolLibComponent.findPacketTypeByName(Protocol.PLAY, Sender.CLIENT, "TeleportAccept");
|
||||
if (confirmType != null) {
|
||||
StaticLog.logInfo("Confirm teleport packet available (via name): " + confirmType);
|
||||
types.add(confirmType);
|
||||
@@ -105,7 +111,7 @@ public class MovingFlying extends BaseAdapter {
|
||||
private long packetMismatchLogFrequency = 60000; // Every minute max, good for updating :).
|
||||
|
||||
private final HashSet<PACKET_CONTENT> validContent = new LinkedHashSet<PACKET_CONTENT>();
|
||||
private final PacketType confirmTeleportType = ProtocolLibComponent.findPacketTypeByName(Protocol.PLAY, Sender.CLIENT, "PacketPlayInTeleportAccept");
|
||||
private final PacketType confirmTeleportType = ProtocolLibComponent.findPacketTypeByName(Protocol.PLAY, Sender.CLIENT, "TeleportAccept");
|
||||
private boolean acceptConfirmTeleportPackets = confirmTeleportType != null;
|
||||
|
||||
public MovingFlying(Plugin plugin) {
|
||||
@@ -123,7 +129,7 @@ public class MovingFlying extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(final PacketEvent event) {
|
||||
|
||||
if (event.isPlayerTemporary()) return;
|
||||
if (event.getPacketType().equals(confirmTeleportType)) {
|
||||
if (acceptConfirmTeleportPackets) {
|
||||
onConfirmTeleportPacket(event);
|
||||
@@ -223,6 +229,52 @@ public class MovingFlying extends BaseAdapter {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Should let it here?
|
||||
// Work as ExtremeMove but for packet sent!
|
||||
if (packetData.hasPos) {
|
||||
final MovingData Mdata = pData.getGenericInstance(MovingData.class);
|
||||
final Location loc1 = player.getLocation();
|
||||
final Location loc2 = new Location(null, packetData.getX(), packetData.getY(), packetData.getZ());
|
||||
final double xzdist = TrigUtil.distance(loc1, loc2);
|
||||
final double amount = xzdist - Mdata.getHorizontalFreedom();
|
||||
final double ydist = Math.abs(loc1.getY() - loc2.getY());
|
||||
final boolean allowVerticalVelocity = true; // TODO: Configurable
|
||||
final boolean allowHorizontalVelocity = true; // TODO: Configurable
|
||||
|
||||
// Vertical move.
|
||||
if (ydist > 100.0 && !(allowVerticalVelocity && Mdata.getOrUseVerticalVelocity(ydist) != null)) {
|
||||
++data.diffpacketVLs;
|
||||
}
|
||||
// Horizontal move.
|
||||
else if (amount > 100.0 && !(allowHorizontalVelocity && Mdata.useHorizontalVelocity(amount) >= amount)) {
|
||||
++data.diffpacketVLs;
|
||||
} else data.diffpacketVLs *= 0.98;
|
||||
|
||||
if (data.diffpacketVLs > 7) {
|
||||
cancel = true;
|
||||
}
|
||||
if (data.diffpacketVLs > 15) {
|
||||
// Player might be freezed by canceling, set back might turn it to normal
|
||||
|
||||
data.diffpacketVLs = 0.0;
|
||||
int task = -1;
|
||||
task = Bukkit.getScheduler().scheduleSyncDelayedTask(plugin,
|
||||
(Runnable)new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Mask player teleport as a set back.
|
||||
Mdata.prepareSetBack(loc1);
|
||||
player.teleport(LocUtil.clone(loc1),
|
||||
BridgeMisc.TELEPORT_CAUSE_CORRECTION_OF_POSITION);
|
||||
}
|
||||
});
|
||||
if (task == -1) {
|
||||
NCPAPIProvider.getNoCheatPlusAPI().getLogManager().warning(Streams.STATUS, "Failed to schedule set back task. Player: " + player.getName() + " , set back: " + loc1);
|
||||
}
|
||||
Mdata.resetTeleported(); // Cleanup, just in case.
|
||||
}
|
||||
}
|
||||
switch(data.teleportQueue.processAck(packetData)) {
|
||||
case WAITING: {
|
||||
if (pData.isDebugActive(this.checkType)) {
|
||||
|
||||
+253
@@ -0,0 +1,253 @@
|
||||
/*
|
||||
* 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.net.protocollib;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.data.Ageable;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerItemConsumeEvent;
|
||||
import org.bukkit.event.player.PlayerItemHeldEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.comphenix.protocol.PacketType;
|
||||
import com.comphenix.protocol.events.ListenerPriority;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import com.comphenix.protocol.wrappers.EnumWrappers.PlayerDigType;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.components.NoCheatPlusAPI;
|
||||
import fr.neatmonster.nocheatplus.components.registry.order.RegistrationOrder.RegisterMethodWithOrder;
|
||||
import fr.neatmonster.nocheatplus.event.mini.MiniListener;
|
||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.InventoryUtil;
|
||||
|
||||
public class NoSlow extends BaseAdapter {
|
||||
private final static String dftag = "system.nocheatplus.noslow";
|
||||
private final static MiniListener<?>[] miniListeners = new MiniListener<?>[] {
|
||||
new MiniListener<PlayerItemConsumeEvent>() {
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final PlayerItemConsumeEvent event) {
|
||||
onItemConsume(event);
|
||||
}
|
||||
},
|
||||
new MiniListener<PlayerInteractEvent>() {
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final PlayerInteractEvent event) {
|
||||
onItemInteract(event);
|
||||
}
|
||||
},
|
||||
new MiniListener<InventoryOpenEvent>() {
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final InventoryOpenEvent event) {
|
||||
onInventoryOpen(event);
|
||||
}
|
||||
},
|
||||
new MiniListener<PlayerItemHeldEvent>() {
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final PlayerItemHeldEvent event) {
|
||||
onChangeSlot(event);
|
||||
}
|
||||
},
|
||||
new MiniListener<BlockPlaceEvent>() {
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
@RegisterMethodWithOrder(tag = dftag)
|
||||
@Override
|
||||
public void onEvent(final BlockPlaceEvent event) {
|
||||
onPlace(event);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private static int timeBetweenRL = 70;
|
||||
private static PacketType[] initPacketTypes() {
|
||||
final List<PacketType> types = new LinkedList<PacketType>(Arrays.asList(
|
||||
PacketType.Play.Client.BLOCK_DIG
|
||||
));
|
||||
return types.toArray(new PacketType[types.size()]);
|
||||
}
|
||||
|
||||
public NoSlow(Plugin plugin) {
|
||||
super(plugin, ListenerPriority.LOW, initPacketTypes());
|
||||
final NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI();
|
||||
for (final MiniListener<?> listener : miniListeners) {
|
||||
api.addComponent(listener, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(final PacketEvent event) {
|
||||
if (event.isPlayerTemporary()) return;
|
||||
handleDiggingPacket(event);
|
||||
}
|
||||
|
||||
private static void onItemConsume(final PlayerItemConsumeEvent e){
|
||||
final Player p = e.getPlayer();
|
||||
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
data.isusingitem = false;
|
||||
}
|
||||
|
||||
private static void onInventoryOpen(final InventoryOpenEvent e){
|
||||
if (e.isCancelled()) return;
|
||||
final Player p = (Player) e.getPlayer();
|
||||
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
data.isusingitem = false;
|
||||
}
|
||||
|
||||
private static void onItemInteract(final PlayerInteractEvent e){
|
||||
if (e.getAction() != Action.RIGHT_CLICK_AIR && e.getAction() != Action.RIGHT_CLICK_BLOCK) return;
|
||||
final Player p = e.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
Block b = e.getClickedBlock();
|
||||
if (p.getGameMode() == GameMode.CREATIVE) {
|
||||
data.isusingitem = false;
|
||||
return;
|
||||
}
|
||||
if (b != null && (
|
||||
b.getType().toString().endsWith("DOOR")
|
||||
|| b.getType().toString().endsWith("GATE")
|
||||
|| b.getType().toString().endsWith("BUTTON")
|
||||
|| b.getType().toString().endsWith("LEVER")
|
||||
|| (b.getType().name().startsWith("SWEET_BERRY_BUSH") && ((Ageable) b.getBlockData()).getAge() > 1)
|
||||
)) {
|
||||
data.isusingitem = false;
|
||||
return;
|
||||
}
|
||||
if (e.hasItem()) {
|
||||
ItemStack item = e.getItem();
|
||||
Material m = item.getType();
|
||||
if (InventoryUtil.isConsumable(item)) {
|
||||
// pre1.9 splash potion
|
||||
if (item.getDurability() > 16384) return;
|
||||
if (m == Material.POTION || m == Material.MILK_BUCKET || m.toString().endsWith("_APPLE") || m.name().startsWith("HONEY_BOTTLE")) {
|
||||
data.isusingitem = true;
|
||||
return;
|
||||
}
|
||||
if (item.getType().isEdible() && p.getFoodLevel() < 20) {
|
||||
data.isusingitem = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (m.toString().equals("BOW") && hasArrow(p.getInventory())) {
|
||||
data.isusingitem = true;
|
||||
return;
|
||||
}
|
||||
if (m.toString().equals("CROSSBOW")) {
|
||||
if (item.getItemMeta().serialize().get("charged").equals(false) && hasArrow(p.getInventory())) {
|
||||
data.isusingitem = true;
|
||||
}
|
||||
}
|
||||
} else data.isusingitem = false;
|
||||
}
|
||||
|
||||
private static void onChangeSlot(final PlayerItemHeldEvent e) {
|
||||
final Player p = e.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
data.isusingitem = false;
|
||||
}
|
||||
|
||||
private static void onPlace(final BlockPlaceEvent e) {
|
||||
final Player p = e.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(p);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
if (InventoryUtil.isConsumable(e.getItemInHand())) data.isusingitem = false;
|
||||
}
|
||||
|
||||
private static boolean hasArrow(PlayerInventory i) {
|
||||
if (Bridge1_9.hasElytra()) {
|
||||
Material m = i.getItemInOffHand().getType();
|
||||
return i.contains(Material.ARROW) || m.toString().endsWith("ARROW") || i.contains(Material.TIPPED_ARROW) || i.contains(Material.SPECTRAL_ARROW);
|
||||
}
|
||||
return i.contains(Material.ARROW);
|
||||
}
|
||||
|
||||
private void handleDiggingPacket(PacketEvent event)
|
||||
{
|
||||
if(event.getPacketType() != PacketType.Play.Client.BLOCK_DIG) return;
|
||||
|
||||
Player p = event.getPlayer();
|
||||
|
||||
if (p == null) {
|
||||
counters.add(ProtocolLibComponent.idNullPlayer, 1);
|
||||
return;
|
||||
}
|
||||
final IPlayerData pData = DataManager.getPlayerDataSafe(p);
|
||||
if (pData == null) {
|
||||
StaticLog.logWarning("Failed to fetch player data with " + event.getPacketType() + " for: " + p.toString());
|
||||
return;
|
||||
}
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
PlayerDigType digtype = event.getPacket().getPlayerDigTypes().read(0);
|
||||
data.isusingitem = false;
|
||||
|
||||
//Advanced check
|
||||
if(digtype == PlayerDigType.RELEASE_USE_ITEM) {
|
||||
long now = System.currentTimeMillis();
|
||||
if (data.time_rl_item != 0) {
|
||||
if (now < data.time_rl_item) {
|
||||
data.time_rl_item = now;
|
||||
data.isusingitem = false;
|
||||
return;
|
||||
}
|
||||
if (data.time_rl_item + timeBetweenRL > now) {
|
||||
data.isHackingRI = true;
|
||||
}
|
||||
}
|
||||
data.time_rl_item = now;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Minimum time between RELEASE_USE_ITEM packet is sent.
|
||||
* If time lower this value, A check will flag
|
||||
* Should be set from 51-100. Larger number, more protection more false-positive
|
||||
*
|
||||
* @param milliseconds
|
||||
*/
|
||||
public static void setuseRLThreshold(int time) {
|
||||
timeBetweenRL = time;
|
||||
}
|
||||
}
|
||||
+12
-2
@@ -27,6 +27,7 @@ import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetData;
|
||||
import fr.neatmonster.nocheatplus.checks.net.model.CountableLocation;
|
||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
import fr.neatmonster.nocheatplus.logging.Streams;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
@@ -53,12 +54,21 @@ public class OutgoingPosition extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketSending(PacketEvent event) {
|
||||
if (event.isCancelled()) {
|
||||
if (event.isPlayerTemporary()) return;
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
final long time = System.currentTimeMillis();
|
||||
final Player player = event.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
if (player == null) {
|
||||
counters.add(ProtocolLibComponent.idNullPlayer, 1);
|
||||
return;
|
||||
}
|
||||
final IPlayerData pData = DataManager.getPlayerDataSafe(player);
|
||||
if (pData == null) {
|
||||
StaticLog.logWarning("Failed to fetch player data with " + event.getPacketType() + " for: " + player.toString());
|
||||
return;
|
||||
}
|
||||
// TODO: In future multiple checks might use this (!)
|
||||
if (pData.isCheckActive(CheckType.NET_FLYINGFREQUENCY, player)) {
|
||||
interpretPacket(player, event.getPacket(), time,
|
||||
|
||||
+7
-1
@@ -126,13 +126,19 @@ public class ProtocolLibComponent implements IDisableListener, INotifyReload, Jo
|
||||
}
|
||||
if (worldMan.isActiveAnywhere(CheckType.NET_SOUNDDISTANCE)) {
|
||||
register("fr.neatmonster.nocheatplus.checks.net.protocollib.SoundDistance", plugin);
|
||||
}
|
||||
if (worldMan.isActiveAnywhere(CheckType.NET_WRONGTURN)) {
|
||||
register("fr.neatmonster.nocheatplus.checks.net.protocollib.WrongTurnAdapter", plugin);
|
||||
}
|
||||
if (ServerVersion.compareMinecraftVersion("1.9") < 0) {
|
||||
if (worldMan.isActiveAnywhere(CheckType.NET_PACKETFREQUENCY)) {
|
||||
register("fr.neatmonster.nocheatplus.checks.net.protocollib.CatchAllAdapter", plugin);
|
||||
}
|
||||
}
|
||||
|
||||
if (ServerVersion.compareMinecraftVersion("1.8") >= 0) {
|
||||
register("fr.neatmonster.nocheatplus.checks.net.protocollib.NoSlow", plugin);
|
||||
register("fr.neatmonster.nocheatplus.checks.net.protocollib.Fight", plugin);
|
||||
}
|
||||
if (!registeredPacketAdapters.isEmpty()) {
|
||||
List<String> names = new ArrayList<String>(registeredPacketAdapters.size());
|
||||
for (PacketAdapter adapter : registeredPacketAdapters) {
|
||||
|
||||
+1
@@ -142,6 +142,7 @@ public class SoundDistance extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketSending(final PacketEvent event) {
|
||||
if (event.isPlayerTemporary()) return;
|
||||
final PacketContainer packetContainer = event.getPacket();
|
||||
|
||||
// Compare sound effect name.
|
||||
|
||||
+1
@@ -123,6 +123,7 @@ public class UseEntityAdapter extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(final PacketEvent event) {
|
||||
if (event.isPlayerTemporary()) return;
|
||||
final long time = System.currentTimeMillis();
|
||||
final Player player = event.getPlayer();
|
||||
if (player == null) {
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package fr.neatmonster.nocheatplus.checks.net.protocollib;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.comphenix.protocol.PacketType;
|
||||
import com.comphenix.protocol.events.ListenerPriority;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import com.comphenix.protocol.reflect.StructureModifier;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetData;
|
||||
import fr.neatmonster.nocheatplus.checks.net.WrongTurn;
|
||||
import fr.neatmonster.nocheatplus.config.ConfPaths;
|
||||
import fr.neatmonster.nocheatplus.config.ConfigManager;
|
||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
|
||||
public class WrongTurnAdapter extends BaseAdapter {
|
||||
|
||||
private final WrongTurn wrongTurn = new WrongTurn();
|
||||
|
||||
public WrongTurnAdapter(Plugin plugin) {
|
||||
super(plugin, ListenerPriority.LOW, PacketType.Play.Client.LOOK, PacketType.Play.Client.POSITION_LOOK);
|
||||
if (ConfigManager.isTrueForAnyConfig(ConfPaths.NET_WRONGTURN_ACTIVE)) {
|
||||
NCPAPIProvider.getNoCheatPlusAPI().addFeatureTags("checks", Arrays.asList(WrongTurn.class.getSimpleName()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPacketReceiving(final PacketEvent event) {
|
||||
final StructureModifier<Float> floats = event.getPacket().getFloat();
|
||||
final float pitch = floats.read(1);
|
||||
final Player player = event.getPlayer();
|
||||
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
final NetData data = pData.getGenericInstance(NetData.class);
|
||||
final NetConfig cc = pData.getGenericInstance(NetConfig.class);
|
||||
|
||||
if (pData.isCheckActive(CheckType.NET_WRONGTURN, player) && wrongTurn.check(player, pitch, data, cc)) {
|
||||
event.setCancelled(true); // Is it a good idea to cancel or should we just reset the players pitch?
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+9
-3
@@ -15,9 +15,9 @@
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.15-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -25,6 +25,12 @@
|
||||
<artifactId>ncpcommons</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<description>Core components and checks implementations. This contains about everything, just not the component/compat factories and not the plugin itself. NCPCore allows to add more modules/components that use check-specific classes to be added in the factories on NCPPlugin level.
|
||||
|
||||
@@ -51,6 +51,7 @@ public enum CheckType {
|
||||
BLOCKPLACE_FASTPLACE(CheckTypeType.CHECK, BLOCKPLACE, Permissions.BLOCKPLACE_FASTPLACE),
|
||||
BLOCKPLACE_NOSWING(CheckTypeType.CHECK, BLOCKPLACE, Permissions.BLOCKPLACE_NOSWING),
|
||||
BLOCKPLACE_REACH(CheckTypeType.CHECK, BLOCKPLACE, Permissions.BLOCKBREAK_REACH),
|
||||
BLOCKPLACE_SCAFFOLD(CheckTypeType.CHECK, BLOCKPLACE, Permissions.BLOCKBREAK_REACH),
|
||||
BLOCKPLACE_SPEED(CheckTypeType.CHECK, BLOCKPLACE, Permissions.BLOCKPLACE_SPEED),
|
||||
|
||||
CHAT(CheckTypeType.GROUP, CheckType.ALL, Permissions.CHAT),
|
||||
@@ -88,7 +89,8 @@ public enum CheckType {
|
||||
INVENTORY_GUTENBERG(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_GUTENBERG),
|
||||
INVENTORY_INSTANTBOW(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_INSTANTBOW),
|
||||
INVENTORY_INSTANTEAT(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_INSTANTEAT),
|
||||
INVENTORY_MOVE(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_MOVE),
|
||||
INVENTORY_INVENTORYMOVE(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_INVENTORYMOVE),
|
||||
INVENTORY_MOREINVENTORY(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_MOREINVENTORY),
|
||||
INVENTORY_ITEMS(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_ITEMS),
|
||||
INVENTORY_OPEN(CheckTypeType.CHECK, INVENTORY, Permissions.INVENTORY_OPEN),
|
||||
|
||||
@@ -108,6 +110,7 @@ public enum CheckType {
|
||||
NET_KEEPALIVEFREQUENCY(CheckTypeType.CHECK, NET, Permissions.NET_KEEPALIVEFREQUENCY),
|
||||
NET_PACKETFREQUENCY(CheckTypeType.CHECK, NET, Permissions.NET_PACKETFREQUENCY),
|
||||
NET_SOUNDDISTANCE(CheckTypeType.CHECK, NET), // Can not exempt players from this one.
|
||||
NET_WRONGTURN(CheckTypeType.CHECK, NET, Permissions.NET_WRONGTURN),
|
||||
|
||||
;
|
||||
|
||||
|
||||
+4
@@ -56,6 +56,8 @@ public class BlockBreakConfig extends ACheckConfig {
|
||||
public final ActionList reachActions;
|
||||
|
||||
public final float wrongBLockLevel;
|
||||
public final boolean wrongBlockImprobableFeedOnly;
|
||||
public final float wrongBlockImprobableWeight;
|
||||
public final ActionList wrongBlockActions;
|
||||
|
||||
/**
|
||||
@@ -93,6 +95,8 @@ public class BlockBreakConfig extends ACheckConfig {
|
||||
noSwingActions = config.getOptimizedActionList(ConfPaths.BLOCKBREAK_NOSWING_ACTIONS, Permissions.BLOCKBREAK_NOSWING);
|
||||
|
||||
reachActions = config.getOptimizedActionList(ConfPaths.BLOCKBREAK_REACH_ACTIONS, Permissions.BLOCKBREAK_REACH);
|
||||
wrongBlockImprobableFeedOnly = config.getBoolean(ConfPaths.BLOCKBREAK_WRONGBLOCK_IMPROBABLE_FEEDONLY);
|
||||
wrongBlockImprobableWeight = (float) config.getDouble(ConfPaths.BLOCKBREAK_WRONGBLOCK_IMPROBABLE_WEIGHT);
|
||||
|
||||
wrongBLockLevel = config.getInt(ConfPaths.BLOCKBREAK_WRONGBLOCK_LEVEL);
|
||||
wrongBlockActions = config.getOptimizedActionList(ConfPaths.BLOCKBREAK_WRONGBLOCK_ACTIONS, Permissions.BLOCKBREAK_WRONGBLOCK);
|
||||
|
||||
+3
-3
@@ -153,7 +153,7 @@ public class BlockBreakListener extends CheckListener {
|
||||
|
||||
final Block block = event.getBlock();
|
||||
boolean cancelled = false;
|
||||
|
||||
if (block.getType().toString().equals("SCAFFOLDING")) return;
|
||||
// Do the actual checks, if still needed. It's a good idea to make computationally cheap checks first, because
|
||||
// it may save us from doing the computationally expensive checks.
|
||||
|
||||
@@ -232,7 +232,7 @@ public class BlockBreakListener extends CheckListener {
|
||||
}
|
||||
|
||||
// Destroying liquid blocks.
|
||||
if (!cancelled && BlockProperties.isLiquid(block.getType())
|
||||
if (!cancelled && BlockProperties.isLiquid(block.getType()) && !BlockProperties.isNewLiq(block.getType())
|
||||
&& !pData.hasPermission(Permissions.BLOCKBREAK_BREAK_LIQUID, player)
|
||||
&& !NCPExemptionManager.isExempted(player, CheckType.BLOCKBREAK_BREAK)){
|
||||
cancelled = true;
|
||||
@@ -409,4 +409,4 @@ public class BlockBreakListener extends CheckListener {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,7 @@ public class WrongBlock extends Check {
|
||||
* @param isInstaBreak
|
||||
* @return
|
||||
*/
|
||||
|
||||
public boolean check(final Player player, final Block block,
|
||||
final BlockBreakConfig cc, final BlockBreakData data, final IPlayerData pData,
|
||||
final AlmostBoolean isInstaBreak) {
|
||||
@@ -90,8 +91,12 @@ public class WrongBlock extends Check {
|
||||
if (executeActions(player, score, 1D, cc.wrongBlockActions).willCancel()) {
|
||||
cancel = true;
|
||||
}
|
||||
if (Improbable.check(player, 2.0f, now, "blockbreak.wrongblock", pData)) {
|
||||
cancel = true;
|
||||
if (cc.wrongBlockImprobableWeight > 0.0f) {
|
||||
if (cc.wrongBlockImprobableFeedOnly) {
|
||||
Improbable.feed(player, cc.wrongBlockImprobableWeight, now);
|
||||
} else if (Improbable.check(player, cc.wrongBlockImprobableWeight, now, "blockbreak.wrongblock", pData)) {
|
||||
cancel = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-2
@@ -186,6 +186,8 @@ public class BlockInteractListener extends CheckListener {
|
||||
if (block == null) {
|
||||
data.resetLastBlock();
|
||||
blockChecks = false;
|
||||
} else if (block.getType().toString().equals("SCAFFOLDING")) {
|
||||
blockChecks = false;
|
||||
}
|
||||
else {
|
||||
data.setLastBlock(block, action);
|
||||
@@ -205,6 +207,9 @@ public class BlockInteractListener extends CheckListener {
|
||||
if (stack != null && stack.getType() == Material.ENDER_PEARL) {
|
||||
checkEnderPearlRightClickBlock(player, block, face, event, previousLastTick, data, pData);
|
||||
}
|
||||
if (stack != null && stack.getType().toString().equals("SCAFFOLDING")) {
|
||||
blockChecks = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
data.setPlayerInteractEventResolution(event);
|
||||
@@ -373,8 +378,9 @@ public class BlockInteractListener extends CheckListener {
|
||||
if (stack != null && BridgeMisc.maybeElytraBoost(player, stack.getType())) {
|
||||
final int power = BridgeMisc.getFireworksPower(stack);
|
||||
final MovingData mData = pData.getGenericInstance(MovingData.class);
|
||||
final int ticks = Math.max((1 + power) * 20, 30);
|
||||
final int ticks = Math.max((1 + power) * 15, 30);
|
||||
mData.fireworksBoostDuration = ticks;
|
||||
mData.fireworksBoostTickNeedCheck = ticks - 1;
|
||||
// Expiration tick: not general latency, rather a minimum margin for sudden congestion.
|
||||
mData.fireworksBoostTickExpire = TickTask.getTick() + ticks;
|
||||
// TODO: Invalidation mechanics: by tick/time well ?
|
||||
@@ -433,4 +439,4 @@ public class BlockInteractListener extends CheckListener {
|
||||
debug(player, builder.toString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -70,11 +70,17 @@ public class Against extends Check {
|
||||
else if (BlockProperties.isLiquid(againstType)) {
|
||||
// TODO: F_PLACE_AGAINST_WATER|LIQUID...
|
||||
if ((placedMat != BridgeMaterial.LILY_PAD
|
||||
|| !BlockProperties.isLiquid(block.getRelative(BlockFace.DOWN).getType()))
|
||||
|| !BlockProperties.isLiquid(block.getRelative(BlockFace.DOWN).getType()))
|
||||
&& !BlockProperties.isNewLiq(bdata.getLastType())
|
||||
&& !pData.hasPermission(Permissions.BLOCKPLACE_AGAINST_LIQUIDS, player)) {
|
||||
violation = true;
|
||||
}
|
||||
}
|
||||
} else
|
||||
// Replace block placed by block placed and interact with air or water
|
||||
if (block.equals(blockAgainst) && (bdata.getLastType() == null || (BlockProperties.isLiquid(bdata.getLastType()) && !BlockProperties.isNewLiq(bdata.getLastType())))
|
||||
&& !pData.hasPermission(Permissions.BLOCKPLACE_AGAINST_SELF, player)) {
|
||||
violation = true;
|
||||
}
|
||||
// Handle violation and return.
|
||||
bdata.addConsumedCheck(this.type);
|
||||
if (violation) {
|
||||
@@ -90,4 +96,4 @@ public class Against extends Check {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -60,8 +60,17 @@ public class AutoSign extends Check {
|
||||
final BlockPlaceData data = pData.getGenericInstance(BlockPlaceData.class);
|
||||
final BlockPlaceConfig cc = pData.getGenericInstance(BlockPlaceConfig.class);
|
||||
Material mat = block.getType();
|
||||
if (mat == BridgeMaterial.SIGN || mat == Material.WALL_SIGN) {
|
||||
mat = Material.SIGN; // ITEM
|
||||
|
||||
String s = mat.toString();
|
||||
if (s.endsWith("_WALL_SIGN")) {
|
||||
s = s.replace("_WALL_SIGN", "_SIGN");
|
||||
mat = Material.getMaterial(s);
|
||||
} else if (s.endsWith("WALL_SIGN")) {
|
||||
s = s.replace("WALL_", "");
|
||||
mat = Material.getMaterial(s);
|
||||
}
|
||||
if (s.equals("SIGN_POST")) {
|
||||
mat = Material.getMaterial("SIGN");
|
||||
}
|
||||
if (data.autoSignPlacedHash != BlockPlaceListener.getBlockPlaceHash(block, mat)){
|
||||
tags.add("block_mismatch");
|
||||
|
||||
+19
-1
@@ -42,6 +42,8 @@ public class BlockPlaceConfig extends ACheckConfig {
|
||||
public final int fastPlaceLimit;
|
||||
public final int fastPlaceShortTermTicks;
|
||||
public final int fastPlaceShortTermLimit;
|
||||
public final boolean fastPlaceImprobableFeedOnly;
|
||||
public final float fastPlaceImprobableWeight;
|
||||
public final ActionList fastPlaceActions;
|
||||
|
||||
public final Set<Material> noSwingExceptions = new HashSet<Material>();
|
||||
@@ -49,7 +51,14 @@ public class BlockPlaceConfig extends ACheckConfig {
|
||||
|
||||
public final ActionList reachActions;
|
||||
|
||||
public final ActionList scaffoldActions;
|
||||
public final boolean scaffoldAngle;
|
||||
public final boolean scaffoldTime;
|
||||
public final boolean scaffoldSprint;
|
||||
|
||||
public final long speedInterval;
|
||||
public final boolean speedImprobableFeedOnly;
|
||||
public final float speedImprobableWeight;
|
||||
public final ActionList speedActions;
|
||||
|
||||
/** General activation flag. */
|
||||
@@ -76,6 +85,8 @@ public class BlockPlaceConfig extends ACheckConfig {
|
||||
fastPlaceLimit = config.getInt(ConfPaths.BLOCKPLACE_FASTPLACE_LIMIT);
|
||||
fastPlaceShortTermTicks = config.getInt(ConfPaths.BLOCKPLACE_FASTPLACE_SHORTTERM_TICKS);
|
||||
fastPlaceShortTermLimit = config.getInt(ConfPaths.BLOCKPLACE_FASTPLACE_SHORTTERM_LIMIT);
|
||||
fastPlaceImprobableFeedOnly = config.getBoolean(ConfPaths.BLOCKPLACE_FASTPLACE_IMPROBABLE_FEEDONLY);
|
||||
fastPlaceImprobableWeight = (float) config.getDouble(ConfPaths.BLOCKPLACE_FASTPLACE_IMPROBABLE_WEIGHT);
|
||||
fastPlaceActions = config.getOptimizedActionList(ConfPaths.BLOCKPLACE_FASTPLACE_ACTIONS, Permissions.BLOCKPLACE_FASTPLACE);
|
||||
|
||||
config.readMaterialFromList(ConfPaths.BLOCKPLACE_NOSWING_EXCEPTIONS, noSwingExceptions);
|
||||
@@ -83,7 +94,14 @@ public class BlockPlaceConfig extends ACheckConfig {
|
||||
|
||||
reachActions = config.getOptimizedActionList(ConfPaths.BLOCKPLACE_REACH_ACTIONS, Permissions.BLOCKPLACE_REACH);
|
||||
|
||||
scaffoldActions = config.getOptimizedActionList(ConfPaths.BLOCKPLACE_SCAFFOLD_ACTIONS, Permissions.BLOCKPLACE_REACH);
|
||||
scaffoldAngle = config.getBoolean(ConfPaths.BLOCKPLACE_SCAFFOLD_ANGLE);
|
||||
scaffoldTime = config.getBoolean(ConfPaths.BLOCKPLACE_SCAFFOLD_TIME);
|
||||
scaffoldSprint = config.getBoolean(ConfPaths.BLOCKPLACE_SCAFFOLD_SPRINT);
|
||||
|
||||
speedInterval = config.getLong(ConfPaths.BLOCKPLACE_SPEED_INTERVAL);
|
||||
speedImprobableFeedOnly = config.getBoolean(ConfPaths.BLOCKPLACE_SPEED_IMPROBABLE_FEEDONLY);
|
||||
speedImprobableWeight = (float) config.getDouble(ConfPaths.BLOCKPLACE_SPEED_IMPROBABLE_WEIGHT);
|
||||
speedActions = config.getOptimizedActionList(ConfPaths.BLOCKPLACE_SPEED_ACTIONS, Permissions.BLOCKPLACE_SPEED);
|
||||
|
||||
preventBoatsAnywhere = config.getBoolean(ConfPaths.BLOCKPLACE_PREVENTMISC_BOATSANYWHERE);
|
||||
@@ -96,4 +114,4 @@ public class BlockPlaceConfig extends ACheckConfig {
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+12
-1
@@ -14,6 +14,8 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.checks.blockplace;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.access.ACheckData;
|
||||
import fr.neatmonster.nocheatplus.utilities.ds.count.ActionFrequency;
|
||||
|
||||
@@ -29,6 +31,7 @@ public class BlockPlaceData extends ACheckData {
|
||||
public double fastPlaceVL = 0;
|
||||
public double noSwingVL = 0;
|
||||
public double reachVL = 0;
|
||||
public double scaffoldVL = 0;
|
||||
public double speedVL = 0;
|
||||
|
||||
// AutoSign.
|
||||
@@ -36,6 +39,14 @@ public class BlockPlaceData extends ACheckData {
|
||||
/** Using Material.SIGN . */
|
||||
public long autoSignPlacedHash = 0;
|
||||
|
||||
// Scaffold data
|
||||
public long lastPlaceTime = 0;
|
||||
public long lastPlaceAvg = 0;
|
||||
public ArrayList<Long> placeTime = new ArrayList<Long>();
|
||||
public long sneakTime = 0;
|
||||
public long sprintTime = 0;
|
||||
public boolean cancelNextPlace = false;
|
||||
|
||||
// Data of the fast place check.
|
||||
public final ActionFrequency fastPlaceBuckets = new ActionFrequency(2, 1000);
|
||||
public int fastPlaceShortTermTick = 0;
|
||||
@@ -51,4 +62,4 @@ public class BlockPlaceData extends ACheckData {
|
||||
public boolean speedLastRefused;
|
||||
public long speedLastTime;
|
||||
|
||||
}
|
||||
}
|
||||
+66
-10
@@ -14,6 +14,9 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.checks.blockplace;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
@@ -31,6 +34,7 @@ import org.bukkit.event.block.SignChangeEvent;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
@@ -47,6 +51,7 @@ import fr.neatmonster.nocheatplus.checks.net.FlyingQueueHandle;
|
||||
import fr.neatmonster.nocheatplus.checks.net.model.DataPacketFlying;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.ServerVersion;
|
||||
import fr.neatmonster.nocheatplus.components.NoCheatPlusAPI;
|
||||
import fr.neatmonster.nocheatplus.components.data.ICheckData;
|
||||
import fr.neatmonster.nocheatplus.components.data.IData;
|
||||
@@ -108,7 +113,10 @@ public class BlockPlaceListener extends CheckListener {
|
||||
/** The reach check. */
|
||||
private final Reach reach = addCheck(new Reach());
|
||||
|
||||
/** The speed check. */
|
||||
/** The scaffold check. */
|
||||
private final Scaffold Scaffold = addCheck(new Scaffold());
|
||||
|
||||
/** The speed check. */
|
||||
private final Speed speed = addCheck(new Speed());
|
||||
|
||||
/** For temporary use: LocUtil.clone before passing deeply, call setWorld(null) after use. */
|
||||
@@ -194,6 +202,12 @@ public class BlockPlaceListener extends CheckListener {
|
||||
int skippedRedundantChecks = 0;
|
||||
final boolean debug = pData.isDebugActive(CheckType.BLOCKPLACE);
|
||||
|
||||
final BlockFace placedFace = event.getBlock().getFace(event.getBlockAgainst());
|
||||
final Block blockPlaced = event.getBlockPlaced();
|
||||
// TODO: change to distsquared for possible performance boost
|
||||
final double distance = player.getLocation().distance(blockPlaced.getLocation());
|
||||
boolean shouldCheck = false;
|
||||
|
||||
final boolean shouldSkipSome;
|
||||
if (blockMultiPlaceEvent != null && event.getClass() == blockMultiPlaceEvent) {
|
||||
if (placedMat == Material.BEDROCK
|
||||
@@ -206,16 +220,18 @@ public class BlockPlaceListener extends CheckListener {
|
||||
}
|
||||
shouldSkipSome = false;
|
||||
}
|
||||
} else if (placedMat.toString().equals("SCAFFOLDING")) {
|
||||
shouldSkipSome = true;
|
||||
}
|
||||
else {
|
||||
shouldSkipSome = false;
|
||||
}
|
||||
|
||||
if (placedMat == Material.SIGN) {
|
||||
if (placedMat.toString().endsWith("SIGN")) {
|
||||
// Might move to MONITOR priority.
|
||||
data.autoSignPlacedTime = System.currentTimeMillis();
|
||||
// Always hash as sign post for improved compatibility with Lockette etc.
|
||||
data.autoSignPlacedHash = getBlockPlaceHash(block, Material.SIGN);
|
||||
data.autoSignPlacedHash = getBlockPlaceHash(block, placedMat);
|
||||
}
|
||||
|
||||
// Don't run checks, if a set back is scheduled.
|
||||
@@ -228,9 +244,12 @@ public class BlockPlaceListener extends CheckListener {
|
||||
if (fastPlace.check(player, block, tick, data, cc, pData)) {
|
||||
cancelled = true;
|
||||
}
|
||||
else {
|
||||
// Feed the improbable.
|
||||
Improbable.feed(player, 0.5f, System.currentTimeMillis(), pData);
|
||||
else if (cc.fastPlaceImprobableWeight > 0.0f) {
|
||||
if (cc.fastPlaceImprobableFeedOnly) {
|
||||
Improbable.feed(player, cc.fastPlaceImprobableWeight, System.currentTimeMillis());
|
||||
} else if (Improbable.check(player, cc.fastPlaceImprobableWeight, System.currentTimeMillis(), "blockplace.fastplace", pData)) {
|
||||
cancelled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,6 +260,24 @@ public class BlockPlaceListener extends CheckListener {
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
switch (placedFace) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
case EAST:
|
||||
case WEST:
|
||||
shouldCheck = true;
|
||||
break;
|
||||
default:
|
||||
shouldCheck = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (Scaffold.isEnabled(player, pData) && player.getLocation().getY() - blockPlaced.getY() < 2D && blockPlaced.getType().isSolid() && shouldCheck && distance < 2D) {
|
||||
|
||||
cancelled = Scaffold.check(player, placedFace, pData, data, cc);
|
||||
|
||||
}
|
||||
|
||||
final FlyingQueueHandle flyingHandle;
|
||||
final boolean reachCheck = pData.isCheckActive(CheckType.BLOCKPLACE_REACH, player);
|
||||
final boolean directionCheck = pData.isCheckActive(CheckType.BLOCKPLACE_DIRECTION, player);
|
||||
@@ -258,6 +295,7 @@ public class BlockPlaceListener extends CheckListener {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Direction check.
|
||||
if (!cancelled && !shouldSkipSome) {
|
||||
if (isInteractBlock && bdata.isPassedCheck(CheckType.BLOCKINTERACT_DIRECTION)) {
|
||||
@@ -482,9 +520,12 @@ public class BlockPlaceListener extends CheckListener {
|
||||
// If the check was positive, cancel the event.
|
||||
cancel = true;
|
||||
}
|
||||
else if (Improbable.check(player, 0.6f, now, "blockplace.speed", pData)) {
|
||||
// Combined fighting speed.
|
||||
cancel = true;
|
||||
else if (cc.speedImprobableWeight > 0.0f) {
|
||||
if (cc.speedImprobableFeedOnly) {
|
||||
Improbable.feed(player, cc.speedImprobableWeight, now);
|
||||
} else if (Improbable.check(player, cc.speedImprobableWeight, now, "blockplace.speed", pData)) {
|
||||
cancel = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -531,4 +572,19 @@ public class BlockPlaceListener extends CheckListener {
|
||||
// Cleanup.
|
||||
useLoc.setWorld(null);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onMove(PlayerMoveEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
final BlockPlaceData data = pData.getGenericInstance(BlockPlaceData.class);
|
||||
|
||||
if (player.isSprinting()) {
|
||||
data.sprintTime = System.currentTimeMillis();
|
||||
} else if (player.isSneaking()) {
|
||||
data.sneakTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package fr.neatmonster.nocheatplus.checks.blockplace;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
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.checks.inventory.InventoryConfig;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
|
||||
public class Scaffold extends Check {
|
||||
|
||||
private final List<String> tags = new LinkedList<String>();
|
||||
|
||||
public Scaffold() {
|
||||
super(CheckType.BLOCKPLACE_SCAFFOLD);
|
||||
}
|
||||
|
||||
final static double MAX_ANGLE = Math.toRadians(90);
|
||||
|
||||
public boolean check(Player player, BlockFace placedFace, final IPlayerData pData, final BlockPlaceData data, final BlockPlaceConfig cc) {
|
||||
boolean cancel = false;
|
||||
|
||||
final Vector placedVector = new Vector(placedFace.getModX(), placedFace.getModY(), placedFace.getModZ());
|
||||
float placedAngle = player.getLocation().getDirection().angle(placedVector);
|
||||
long now = System.currentTimeMillis();
|
||||
float pitchNow = player.getLocation().getPitch();
|
||||
int current = player.getInventory().getHeldItemSlot();
|
||||
|
||||
// Angle Check
|
||||
if (cc.scaffoldAngle && placedAngle > MAX_ANGLE) {
|
||||
ViolationData vd = new ViolationData(this, player, data.scaffoldVL, 1, pData.getGenericInstance(BlockPlaceConfig.class).scaffoldActions);
|
||||
tags.add("Angle");
|
||||
if (vd.needsParameters()) {
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
cancel = executeActions(vd).willCancel();
|
||||
data.scaffoldVL += 1D;
|
||||
}
|
||||
|
||||
// Average time check
|
||||
if (cc.scaffoldTime && data.sneakTime + 150 < now && !player.hasPotionEffect(PotionEffectType.SPEED)) {
|
||||
// TODO: need to make this more efficient
|
||||
if (data.placeTime.size() > 2) {
|
||||
long avg = 0;
|
||||
for (int i = 0; i < data.placeTime.size(); i++) {
|
||||
avg += data.placeTime.get(i);
|
||||
}
|
||||
avg = avg / data.placeTime.size();
|
||||
if (avg < 238L) {
|
||||
ViolationData vd = new ViolationData(this, player, data.scaffoldVL, 1, pData.getGenericInstance(BlockPlaceConfig.class).scaffoldActions);
|
||||
tags.add("Time");
|
||||
if (vd.needsParameters()) {
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
cancel = executeActions(vd).willCancel();
|
||||
data.scaffoldVL += 1D;
|
||||
}
|
||||
data.lastPlaceAvg = avg;
|
||||
data.placeTime.clear();
|
||||
data.lastPlaceTime = 0L;
|
||||
|
||||
} else {
|
||||
if (data.lastPlaceTime == 0) {
|
||||
data.lastPlaceTime = now;
|
||||
} else {
|
||||
long diff = now - data.lastPlaceTime;
|
||||
data.placeTime.add(diff);
|
||||
data.lastPlaceTime = now;
|
||||
if (diff <= data.lastPlaceAvg && data.lastPlaceAvg < 238L) {
|
||||
ViolationData vd = new ViolationData(this, player, data.scaffoldVL, 1, pData.getGenericInstance(BlockPlaceConfig.class).scaffoldActions);
|
||||
tags.add("TimeAvg");
|
||||
if (vd.needsParameters()) {
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
cancel = executeActions(vd).willCancel();
|
||||
data.scaffoldVL += 1D;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Pitch Check
|
||||
//Bukkit.getScheduler().runTaskLater(data.plugin, checkDiff(player, now, pData, data), 2L);
|
||||
// Tool switch check
|
||||
// Bukkit.getScheduler().runTaskLater(data.plugin, checkTool(player, current, pData, data), 1L);
|
||||
|
||||
// Sprint check
|
||||
long diff = System.currentTimeMillis() - data.sprintTime;
|
||||
if (cc.scaffoldSprint && diff < 400) {
|
||||
ViolationData vd = new ViolationData(this, player, data.scaffoldVL, 1, pData.getGenericInstance(BlockPlaceConfig.class).scaffoldActions);
|
||||
tags.add("Sprint");
|
||||
if (vd.needsParameters()) {
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
cancel = executeActions(vd).willCancel();
|
||||
data.scaffoldVL += 1D;
|
||||
}
|
||||
|
||||
tags.clear();
|
||||
return cancel;
|
||||
}
|
||||
|
||||
// Check diff
|
||||
private void checkDiff(Player player, float now, final IPlayerData pData, final BlockPlaceData data) {
|
||||
float pitchNow = player.getLocation().getPitch();
|
||||
float diff = Math.abs(now - pitchNow);
|
||||
|
||||
if (diff > 20F) {
|
||||
executeActions(player, data.scaffoldVL, 1D, pData.getGenericInstance(BlockPlaceConfig.class).scaffoldActions).willCancel();
|
||||
data.scaffoldVL += 1D;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void checkTool(Player player, int item, final IPlayerData pData, final BlockPlaceData data) {
|
||||
int newItem = player.getInventory().getHeldItemSlot();
|
||||
|
||||
if (newItem != item) {
|
||||
executeActions(player, data.scaffoldVL, 1D, pData.getGenericInstance(BlockPlaceConfig.class).scaffoldActions).willCancel();
|
||||
data.scaffoldVL += 1D;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -198,10 +198,15 @@ public class Combined {
|
||||
Math.max(cc.yawRatePenaltyFactor * amount , cc.yawRatePenaltyMin),
|
||||
cc.yawRatePenaltyMax));
|
||||
// TODO: balance (100 ... 200 ) ?
|
||||
if (cc.yawRateImprobable && Improbable.check(player, amount / 100f, now, "combined.yawrate",
|
||||
pData))
|
||||
cancel = true;
|
||||
}
|
||||
// TODO: New calculations so that weight is not inverse
|
||||
if (cc.yawRateImprobableWeight > 0.0f) {
|
||||
if (cc.yawRateImprobableFeedOnly) {
|
||||
Improbable.feed(player, amount / cc.yawRateImprobableWeight, now);
|
||||
} else if (Improbable.check(player, amount / cc.yawRateImprobableWeight, now, "combined.yawrate", pData)) {
|
||||
cancel = true;
|
||||
}
|
||||
}
|
||||
} // Improbable.check(player, amount / 100f, now, "combined.yawrate", pData)
|
||||
if (data.timeFreeze.isPenalty()) {
|
||||
cancel = true;
|
||||
}
|
||||
|
||||
+4
-2
@@ -59,7 +59,8 @@ public class CombinedConfig extends ACheckConfig {
|
||||
|
||||
// Last yaw tracking
|
||||
public final float yawRate;
|
||||
public final boolean yawRateImprobable;
|
||||
public final boolean yawRateImprobableFeedOnly;
|
||||
public final float yawRateImprobableWeight;
|
||||
public final float yawRatePenaltyFactor;
|
||||
public final int yawRatePenaltyMin;
|
||||
public final int yawRatePenaltyMax;
|
||||
@@ -116,7 +117,8 @@ public class CombinedConfig extends ACheckConfig {
|
||||
munchHausenActions = config.getOptimizedActionList(ConfPaths.COMBINED_MUNCHHAUSEN_ACTIONS, Permissions.COMBINED_MUNCHHAUSEN);
|
||||
|
||||
yawRate = config.getInt(ConfPaths.COMBINED_YAWRATE_RATE);
|
||||
yawRateImprobable = config.getBoolean(ConfPaths.COMBINED_YAWRATE_IMPROBABLE);
|
||||
yawRateImprobableFeedOnly = config.getBoolean(ConfPaths.COMBINED_YAWRATE_IMPROBABLE_FEEDONLY);
|
||||
yawRateImprobableWeight = (float) config.getDouble(ConfPaths.COMBINED_YAWRATE_IMPROBABLE_WEIGHT);
|
||||
yawRatePenaltyFactor = (float) config.getDouble(ConfPaths.COMBINED_YAWRATE_PENALTY_FACTOR);
|
||||
yawRatePenaltyMin = config.getInt(ConfPaths.COMBINED_YAWRATE_PENALTY_MIN);
|
||||
yawRatePenaltyMax = config.getInt(ConfPaths.COMBINED_YAWRATE_PENALTY_MAX);
|
||||
|
||||
@@ -15,17 +15,22 @@
|
||||
package fr.neatmonster.nocheatplus.checks.fight;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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.permissions.Permissions;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.players.PlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.TickTask;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.TrigUtil;
|
||||
import org.bukkit.ChatColor;
|
||||
@@ -36,6 +41,8 @@ import org.bukkit.ChatColor;
|
||||
* Thanks @asofold for the original idea!
|
||||
*/
|
||||
public class Angle extends Check {
|
||||
|
||||
private final List<String> tags = new LinkedList<String>();
|
||||
|
||||
public static class AttackLocation {
|
||||
public final double x, y, z;
|
||||
@@ -100,6 +107,7 @@ public class Angle extends Check {
|
||||
}
|
||||
|
||||
boolean cancel = false;
|
||||
tags.clear();
|
||||
|
||||
// Quick check for expiration of all entries.
|
||||
final long time = System.currentTimeMillis();
|
||||
@@ -163,6 +171,7 @@ public class Angle extends Check {
|
||||
// If the average move is between 0 and 0.2 block(s), add it to the violation.
|
||||
if (averageMove >= 0.0 && averageMove < 0.2D) {
|
||||
violationone += 20.0 * (0.2 - averageMove) / 0.2;
|
||||
tags.add("Average_move");
|
||||
if (pData.isDebugActive(type) && pData.hasPermission(Permissions.ADMINISTRATION_DEBUG, player)){
|
||||
player.sendMessage(ChatColor.RED + "NC+ Debug: " + ChatColor.RESET + "avgMove: " + averageMove + " avgMove VL: " + violationone + "/" + cc.angleMove);
|
||||
}
|
||||
@@ -171,6 +180,7 @@ public class Angle extends Check {
|
||||
// If the average time elapsed is between 0 and 150 millisecond(s), add it to the violation.
|
||||
if (averageTime >= 0.0 && averageTime < 150.0) {
|
||||
violationtwo += 30.0 * (150.0 - averageTime) / 150.0;
|
||||
tags.add("Average_time");
|
||||
if (pData.isDebugActive(type) && pData.hasPermission(Permissions.ADMINISTRATION_DEBUG, player)){
|
||||
player.sendMessage(ChatColor.RED + "NC+ Debug: " + ChatColor.RESET + "avgTime: " + averageTime + " avgTime VL: " + violationtwo + "/" + cc.angleTime);
|
||||
}
|
||||
@@ -179,6 +189,7 @@ public class Angle extends Check {
|
||||
// If the average difference of yaw is superior to 50 degrees, add it to the violation.
|
||||
if (averageYaw > 50.0) {
|
||||
violationthree += 30.0 * averageYaw / 180.0;
|
||||
tags.add("Average_yaw");
|
||||
if (pData.isDebugActive(type) && pData.hasPermission(Permissions.ADMINISTRATION_DEBUG, player)){
|
||||
player.sendMessage(ChatColor.RED + "NC+ Debug: " + ChatColor.RESET + "avgYaw: " + averageYaw + " avgYaw VL: " + violationthree + "/" + cc.angleYaw);
|
||||
}
|
||||
@@ -186,6 +197,7 @@ public class Angle extends Check {
|
||||
|
||||
if (averageSwitching > 0.0) {
|
||||
violationfour += 20.0 * averageSwitching;
|
||||
tags.add("SwitchSpeed");
|
||||
if (pData.isDebugActive(type) && pData.hasPermission(Permissions.ADMINISTRATION_DEBUG, player)){
|
||||
player.sendMessage(ChatColor.RED + "NC+ Debug: " + ChatColor.RESET + "avgSwitch: " + averageSwitching + " avgSwitch VL: " + violationfour + "/" + cc.angleSwitch);
|
||||
}
|
||||
@@ -193,60 +205,61 @@ public class Angle extends Check {
|
||||
|
||||
// Is the violation is superior to the threshold defined in the configuration?
|
||||
if (violationone > cc.angleMove) {
|
||||
// Has the server lagged?
|
||||
if (TickTask.getLag(maxTimeDiff, true) < 1.5f){
|
||||
// TODO: 1.5 is a fantasy value.
|
||||
// If it hasn't, increment the violation level.
|
||||
violation = violationone;
|
||||
data.angleVL += violation;
|
||||
}
|
||||
|
||||
// Execute whatever actions are associated with this check and the violation level and find out if we should
|
||||
// cancel the event.
|
||||
cancel = executeActions(player, data.angleVL, violation, cc.angleActions).willCancel();
|
||||
} else if (violationtwo > cc.angleTime) {
|
||||
// Has the server lagged?
|
||||
if (TickTask.getLag(maxTimeDiff, true) < 1.5f){
|
||||
// If it hasn't, increment the violation level
|
||||
violation = violationone;
|
||||
data.angleVL += violation;
|
||||
final ViolationData vd = new ViolationData(this, player, data.angleVL, violation, cc.angleActions);
|
||||
if (vd.needsParameters()){
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
return executeActions(vd).willCancel();
|
||||
}
|
||||
}
|
||||
else if (violationtwo > cc.angleTime) {
|
||||
// Has the server lagged?
|
||||
if (TickTask.getLag(maxTimeDiff, true) < 1.5f){
|
||||
// If it hasn't, increment the violation level
|
||||
violation = violationtwo;
|
||||
data.angleVL += violation;
|
||||
final ViolationData vd = new ViolationData(this, player, data.angleVL, violation, cc.angleActions);
|
||||
if (vd.needsParameters()){
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
return executeActions(vd).willCancel();
|
||||
}
|
||||
}
|
||||
else if (violationthree > cc.angleYaw) {
|
||||
// Has the server lagged?
|
||||
if (TickTask.getLag(maxTimeDiff, true) < 1.5f){
|
||||
// TODO: 1.5 is a fantasy value.
|
||||
// If it hasn't, increment the violation level.
|
||||
violation = violationtwo;
|
||||
data.angleVL += violation;
|
||||
}
|
||||
|
||||
// Execute whatever actions are associated with this check and the violation level and find out if we should
|
||||
// cancel the event.
|
||||
cancel = executeActions(player, data.angleVL, violation, cc.angleActions).willCancel();
|
||||
} else if (violationthree > cc.angleYaw) {
|
||||
// Has the server lagged?
|
||||
if (TickTask.getLag(maxTimeDiff, true) < 1.5f){
|
||||
// TODO: 1.5 is a fantasy value.
|
||||
// If it hasn't, increment the violation level.
|
||||
violation = violationthree;
|
||||
data.angleVL += violation;
|
||||
}
|
||||
|
||||
// Execute whatever actions are associated with this check and the violation level and find out if we should
|
||||
// cancel the event.
|
||||
cancel = executeActions(player, data.angleVL, violation, cc.angleActions).willCancel();
|
||||
|
||||
} else if (violationfour > cc.angleSwitch) {
|
||||
// Has the server lagged?
|
||||
if (TickTask.getLag(maxTimeDiff, true) < 1.5f){
|
||||
// TODO: 1.5 is a fantasy value.
|
||||
// If it hasn't, increment the violation level.
|
||||
violation = violationfour;
|
||||
data.angleVL += violation;
|
||||
}
|
||||
|
||||
// Execute whatever actions are associated with this check and the violation level and find out if we should
|
||||
// cancel the event.
|
||||
cancel = executeActions(player, data.angleVL, violation, cc.angleActions).willCancel();
|
||||
|
||||
} else {
|
||||
if (TickTask.getLag(maxTimeDiff, true) < 1.5f){
|
||||
// If it hasn't, increment the violation level
|
||||
violation = violationthree;
|
||||
data.angleVL += violation;
|
||||
final ViolationData vd = new ViolationData(this, player, data.angleVL, violation, cc.angleActions);
|
||||
if (vd.needsParameters()){
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
return executeActions(vd).willCancel();
|
||||
}
|
||||
}
|
||||
else if (violationfour > cc.angleSwitch) {
|
||||
// Has the server lagged?
|
||||
if (TickTask.getLag(maxTimeDiff, true) < 1.5f){
|
||||
// If it hasn't, increment the violation level
|
||||
violation = violationfour;
|
||||
data.angleVL += violation;
|
||||
final ViolationData vd = new ViolationData(this, player, data.angleVL, violation, cc.angleActions);
|
||||
if (vd.needsParameters()){
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
return executeActions(vd).willCancel();
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Reward the player by lowering their violation level.
|
||||
data.angleVL *= 0.98D;
|
||||
}
|
||||
|
||||
return cancel;
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.ViolationData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.LiftOffEnvelope;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveInfo;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.util.AuxMoving;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.util.MovingUtil;
|
||||
@@ -64,52 +64,110 @@ public class Critical extends Check {
|
||||
boolean cancel = false;
|
||||
|
||||
final double mcFallDistance = (double) player.getFallDistance();
|
||||
final MovingData mData = pData.getGenericInstance(MovingData.class);
|
||||
|
||||
// Check if the hit was a critical hit (very small fall-distance, not on ladder,
|
||||
// not in liquid, not in vehicle, and without blindness effect).
|
||||
if (mcFallDistance > 0.0 && !player.isInsideVehicle()
|
||||
&& !player.hasPotionEffect(PotionEffectType.BLINDNESS)) {
|
||||
if (mcFallDistance > 0.0 && !player.isInsideVehicle() && !player.hasPotionEffect(PotionEffectType.BLINDNESS)) {
|
||||
|
||||
// Might be a violation.
|
||||
final MovingConfig mcc = pData.getGenericInstance(MovingConfig.class);
|
||||
final PlayerMoveData thisMove = mData.playerMoves.getCurrentMove();
|
||||
|
||||
if (pData.isDebugActive(type)) {
|
||||
debug(player, "y=" + loc.getY() + " mcfalldist=" + mcFallDistance);
|
||||
debug(player, "y=" + loc.getY() + " mcfalldist=" + mcFallDistance + " jumpphase: " + mData.sfJumpPhase + " noFallDist: " + mData.noFallFallDistance + " lowjump: " + mData.sfLowJump + " toGround: " + thisMove.to.onGround + " fromGround: " + thisMove.from.onGround);
|
||||
}
|
||||
|
||||
// Might be a violation.
|
||||
final MovingConfig mcc = pData.getGenericInstance(MovingConfig.class);
|
||||
final MovingData dataM = pData.getGenericInstance(MovingData.class);
|
||||
/*
|
||||
* TODO: NoFall data max y. (past moves too perhaps - low jump,
|
||||
* number split moves without reason)
|
||||
*/
|
||||
|
||||
// TODO: Skip near the highest jump height (needs check if head collided with something solid, which also detects low jump).
|
||||
if (!dataM.isVelocityJumpPhase() &&
|
||||
(dataM.sfLowJump && !dataM.sfNoLowJump && dataM.liftOffEnvelope == LiftOffEnvelope.NORMAL
|
||||
|| mcFallDistance < cc.criticalFallDistance && !BlockProperties.isResetCond(player, loc, mcc.yOnGround))) {
|
||||
// TODO: Use past move tracking to check for SurvivalFly and the like?
|
||||
|
||||
/*
|
||||
* Attempt to look for silent jumps by comparing the players fallDistance and the fallDistance calculated by NoFall.
|
||||
* Only check if that fall distance is below/equal to the fall disatnce set in the config.
|
||||
* Use the jumpPhase to help determine if it was a silent jump as well
|
||||
*
|
||||
* This method should reduce the false positives from the old check, by now focusing on silent jumps rather than just crit hits within a fall distance.
|
||||
*
|
||||
*/
|
||||
// 0.0009 is just a random number for leniency that works fine, maybe add a config option?
|
||||
if (Math.abs(mData.noFallFallDistance - mcFallDistance) > 0.0009 && mcFallDistance <= cc.criticalFallDistance && mData.sfJumpPhase <= 1 && !BlockProperties.isResetCond(player, loc, mcc.yOnGround) || mData.sfLowJump || mData.noFallFallDistance != mcFallDistance && thisMove.from.onGround && thisMove.to.onGround) {
|
||||
|
||||
// TODO: Use past move tracking to check for SurvivalFly and the like?
|
||||
final PlayerMoveInfo moveInfo = auxMoving.usePlayerMoveInfo();
|
||||
moveInfo.set(player, loc, null, mcc.yOnGround);
|
||||
if (MovingUtil.shouldCheckSurvivalFly(player, moveInfo.from, dataM, mcc, pData)) {
|
||||
data.criticalVL += 1.0;
|
||||
// Execute whatever actions are associated with this check and
|
||||
// the violation level and find out if we should cancel the event.
|
||||
final ViolationData vd = new ViolationData(this, player, data.criticalVL, 1.0, cc.criticalActions);
|
||||
if (vd.needsParameters()) {
|
||||
final List<String> tags = new ArrayList<String>();
|
||||
if (dataM.sfLowJump) {
|
||||
tags.add("lowjump");
|
||||
}
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
|
||||
if (MovingUtil.shouldCheckSurvivalFly(player, moveInfo.from, mData, mcc, pData)) {
|
||||
moveInfo.from.collectBlockFlags(0.4);
|
||||
|
||||
// TODO: maybe these require a fix/modification with NoFall? For now, exempt the player.
|
||||
// Don't think its possible to fake a crit in these situations either (except for being onGround in a web/water, which is checked for before being exempt) ... or at least from my testing?
|
||||
if (thisMove.from.onClimbable || thisMove.to.onClimbable) {
|
||||
|
||||
} else if ((thisMove.from.inLiquid | thisMove.to.inLiquid) && thisMove.from.onGround && thisMove.to.onGround) {
|
||||
|
||||
} else if ((thisMove.from.inWeb | thisMove.to.inWeb) & !thisMove.to.onGround) {
|
||||
|
||||
} else if ((moveInfo.from.getBlockFlags() & BlockProperties.F_BOUNCE25) != 0 && !thisMove.from.onGround && !thisMove.to.onGround) {
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
boolean exemptLowJump = false;
|
||||
// False positives with lowJump when the player jumps on/off a block while attacking an entity
|
||||
if (mData.sfLowJump) {
|
||||
|
||||
if (Math.abs(mData.noFallFallDistance - mcFallDistance) < 0.0009) {
|
||||
|
||||
if (mcFallDistance > cc.criticalFallDistance) {
|
||||
|
||||
if (!thisMove.to.onGround || !thisMove.from.onGround) {
|
||||
exemptLowJump = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else if (!thisMove.to.onGround || !thisMove.from.onGround) {
|
||||
|
||||
if (Math.abs(mData.noFallFallDistance - mcFallDistance) > 0.0009) {
|
||||
exemptLowJump = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!exemptLowJump) {
|
||||
data.criticalVL += 1.0;
|
||||
// Execute whatever actions are associated with this check and
|
||||
// the violation level and find out if we should cancel the event.
|
||||
final ViolationData vd = new ViolationData(this, player, data.criticalVL, 1.0, cc.criticalActions);
|
||||
if (vd.needsParameters()) {
|
||||
final List<String> tags = new ArrayList<String>();
|
||||
if (mData.sfLowJump) {
|
||||
tags.add("lowjump");
|
||||
}
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
cancel = executeActions(vd).willCancel();
|
||||
// TODO: Introduce penalty instead of cancel.
|
||||
}
|
||||
|
||||
}
|
||||
cancel = executeActions(vd).willCancel();
|
||||
// TODO: Introduce penalty instead of cancel.
|
||||
|
||||
}
|
||||
auxMoving.returnPlayerMoveInfo(moveInfo);
|
||||
auxMoving.returnPlayerMoveInfo(moveInfo);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!cancel) {
|
||||
data.criticalVL *= 0.96D;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return cancel;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,8 @@ public class Direction extends Check {
|
||||
|
||||
// entity.height is broken and will always be 0, therefore. Calculate height instead based on boundingBox.
|
||||
final double height = damagedIsFake ? (damaged instanceof LivingEntity ? ((LivingEntity) damaged).getEyeHeight() : 1.75) : mcAccess.getHeight(damaged);
|
||||
|
||||
final boolean isPlayer = damaged instanceof Player ? true : false;
|
||||
|
||||
// TODO: allow any hit on the y axis (might just adapt interface to use foot position + height)!
|
||||
|
||||
@@ -74,13 +76,14 @@ public class Direction extends Check {
|
||||
final Vector direction = loc.getDirection();
|
||||
|
||||
final double off;
|
||||
if (cc.directionStrict){
|
||||
off = CollisionUtil.combinedDirectionCheck(loc, player.getEyeHeight(), direction, dLoc.getX(), dLoc.getY() + height / 2D, dLoc.getZ(), width, height, TrigUtil.DIRECTION_PRECISION, 80.0);
|
||||
off = CollisionUtil.directionCheck(loc, player.getEyeHeight(), direction, dLoc.getX(), dLoc.getY() + height / 2D, dLoc.getZ(), width, height, TrigUtil.DIRECTION_PRECISION);
|
||||
/*if (cc.directionStrict){
|
||||
off = CollisionUtil.combinedDirectionCheck(loc, player.getEyeHeight(), direction, dLoc.getX(), dLoc.getY() + height / 2D, dLoc.getZ(), width, height, TrigUtil.DIRECTION_PRECISION, 80.0, isPlayer);
|
||||
}
|
||||
else{
|
||||
// Also take into account the angle.
|
||||
off = CollisionUtil.directionCheck(loc, player.getEyeHeight(), direction, dLoc.getX(), dLoc.getY() + height / 2D, dLoc.getZ(), width, height, TrigUtil.DIRECTION_PRECISION);
|
||||
}
|
||||
} */
|
||||
|
||||
if (off > 0.1) {
|
||||
// Player failed the check. Let's try to guess how far they were from looking directly to the entity...
|
||||
@@ -156,6 +159,7 @@ public class Direction extends Check {
|
||||
return false;
|
||||
}
|
||||
boolean cancel = false;
|
||||
boolean isPlayer = damaged instanceof Player ? true : false;
|
||||
|
||||
// TODO: allow any hit on the y axis (might just adapt interface to use foot position + height)!
|
||||
|
||||
@@ -165,7 +169,7 @@ public class Direction extends Check {
|
||||
final double damagedBoxMarginVertical = dLoc.getBoxMarginVertical();
|
||||
final double off;
|
||||
if (cc.directionStrict){
|
||||
off = CollisionUtil.combinedDirectionCheck(loc, player.getEyeHeight(), context.direction, dLoc.getX(), dLoc.getY() + damagedBoxMarginVertical / 2D, dLoc.getZ(), damagedBoxMarginHorizontal * 2.0, damagedBoxMarginVertical, TrigUtil.DIRECTION_LOOP_PRECISION, 80.0);
|
||||
off = CollisionUtil.combinedDirectionCheck(loc, player.getEyeHeight(), context.direction, dLoc.getX(), dLoc.getY() + damagedBoxMarginVertical / 2D, dLoc.getZ(), damagedBoxMarginHorizontal * 2.0, damagedBoxMarginVertical, cc.directionloopprecision, cc.directionangleprecision, isPlayer);
|
||||
}
|
||||
else{
|
||||
// Also take into account the angle.
|
||||
@@ -173,7 +177,7 @@ public class Direction extends Check {
|
||||
context.direction, dLoc.getX(),
|
||||
dLoc.getY() + damagedBoxMarginVertical / 2D, dLoc.getZ(),
|
||||
damagedBoxMarginHorizontal * 2.0, damagedBoxMarginVertical,
|
||||
TrigUtil.DIRECTION_LOOP_PRECISION);
|
||||
cc.directionloopprecision);
|
||||
}
|
||||
|
||||
if (off > 0.0) {
|
||||
@@ -191,7 +195,7 @@ public class Direction extends Check {
|
||||
}
|
||||
context.minResult = Math.min(context.minResult, off);
|
||||
}
|
||||
}
|
||||
} else if (cc.directionFailAll) context.minResult = 0.0;
|
||||
|
||||
return cancel;
|
||||
}
|
||||
@@ -234,4 +238,4 @@ public class Direction extends Check {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.permissions.Permissions;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.TickTask;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.ServerVersion;
|
||||
|
||||
/**
|
||||
* Legacy check (client side health regeneration).
|
||||
@@ -35,6 +36,9 @@ public class FastHeal extends Check {
|
||||
}
|
||||
|
||||
public boolean check(final Player player, final IPlayerData pData){
|
||||
if (ServerVersion.compareMinecraftVersion("1.9") >= 0) {
|
||||
return false;
|
||||
}
|
||||
final long time = System.currentTimeMillis();
|
||||
|
||||
final FightConfig cc = pData.getGenericInstance(FightConfig.class);
|
||||
|
||||
@@ -43,7 +43,10 @@ public class FightConfig extends ACheckConfig {
|
||||
public final double criticalFallDistance;
|
||||
public final ActionList criticalActions;
|
||||
|
||||
public final boolean directionStrict;
|
||||
public final boolean directionStrict;
|
||||
public final boolean directionFailAll;
|
||||
public final double directionloopprecision;
|
||||
public final double directionangleprecision;
|
||||
public final long directionPenalty;
|
||||
public final ActionList directionActions;
|
||||
|
||||
@@ -63,10 +66,13 @@ public class FightConfig extends ACheckConfig {
|
||||
public final double reachSurvivalDistance;
|
||||
public final double reachReduceDistance;
|
||||
public final double reachReduceStep;
|
||||
public final boolean reachImprobableFeedOnly;
|
||||
public final float reachImprobableWeight;
|
||||
|
||||
public final ActionList reachActions;
|
||||
|
||||
public final ActionList selfHitActions;
|
||||
public final boolean selfHitExcludeprojectile;
|
||||
|
||||
public final int speedLimit;
|
||||
public final int speedBuckets;
|
||||
@@ -75,16 +81,16 @@ public class FightConfig extends ACheckConfig {
|
||||
|
||||
public final int speedShortTermLimit;
|
||||
public final int speedShortTermTicks;
|
||||
public final boolean speedImprobableFeedOnly;
|
||||
public final float speedImprobableWeight;
|
||||
public final ActionList speedActions;
|
||||
|
||||
public final ActionList wrongTurnActions;
|
||||
|
||||
// Special flags:
|
||||
public final boolean cancelDead;
|
||||
public final boolean knockBackVelocityPvP;
|
||||
|
||||
/** Maximum latency counted in ticks for the loop checks (reach, direction). */
|
||||
public final long loopMaxLatencyTicks = 15; // TODO: Configurable, sections for players and entities.
|
||||
public final long loopMaxLatencyTicks; // TODO: Configurable, sections for players and entities.
|
||||
|
||||
/**
|
||||
* Instantiates a new fight configuration.
|
||||
@@ -107,6 +113,9 @@ public class FightConfig extends ACheckConfig {
|
||||
criticalActions = config.getOptimizedActionList(ConfPaths.FIGHT_CRITICAL_ACTIONS, Permissions.FIGHT_CRITICAL);
|
||||
|
||||
directionStrict = config.getBoolean(ConfPaths.FIGHT_DIRECTION_STRICT);
|
||||
directionFailAll = config.getBoolean(ConfPaths.FIGHT_DIRECTION_FAILALL);
|
||||
directionangleprecision = config.getDouble(ConfPaths.FIGHT_DIRECTION_STRICTANGLEPRECISION, 50.0, 100.0, 80.0);
|
||||
directionloopprecision = config.getDouble(ConfPaths.FIGHT_DIRECTION_LOOPPRECISION, 0.0, 2.0, 0.5);
|
||||
directionPenalty = config.getLong(ConfPaths.FIGHT_DIRECTION_PENALTY);
|
||||
directionActions = config.getOptimizedActionList(ConfPaths.FIGHT_DIRECTION_ACTIONS, Permissions.FIGHT_DIRECTION);
|
||||
|
||||
@@ -131,9 +140,12 @@ public class FightConfig extends ACheckConfig {
|
||||
reachReduce = config.getBoolean(ConfPaths.FIGHT_REACH_REDUCE);
|
||||
reachReduceDistance = config.getDouble(ConfPaths.FIGHT_REACH_REDUCEDISTANCE, 0, reachSurvivalDistance, 0.9);
|
||||
reachReduceStep = config.getDouble(ConfPaths.FIGHT_REACH_REDUCESTEP, 0, reachReduceDistance, 0.15);
|
||||
reachImprobableFeedOnly = config.getBoolean(ConfPaths.FIGHT_REACH_IMPROBABLE_FEEDONLY);
|
||||
reachImprobableWeight = (float) config.getDouble(ConfPaths.FIGHT_REACH_IMPROBABLE_WEIGHT);
|
||||
reachActions = config.getOptimizedActionList(ConfPaths.FIGHT_REACH_ACTIONS, Permissions.FIGHT_REACH);
|
||||
|
||||
selfHitActions = config.getOptimizedActionList(ConfPaths.FIGHT_SELFHIT_ACTIONS, Permissions.FIGHT_SELFHIT);
|
||||
selfHitExcludeprojectile = config.getBoolean(ConfPaths.FIGHT_SELFHIT_EXCLUDEPROJECTILE);
|
||||
|
||||
speedLimit = config.getInt(ConfPaths.FIGHT_SPEED_LIMIT);
|
||||
speedBuckets = config.getInt(ConfPaths.FIGHT_SPEED_BUCKETS_N, 6);
|
||||
@@ -141,13 +153,12 @@ public class FightConfig extends ACheckConfig {
|
||||
speedBucketFactor = (float) config.getDouble(ConfPaths.FIGHT_SPEED_BUCKETS_FACTOR, 1f);
|
||||
speedShortTermLimit = config.getInt(ConfPaths.FIGHT_SPEED_SHORTTERM_LIMIT);
|
||||
speedShortTermTicks = config.getInt(ConfPaths.FIGHT_SPEED_SHORTTERM_TICKS);
|
||||
speedImprobableFeedOnly = config.getBoolean(ConfPaths.FIGHT_SPEED_IMPROBABLE_FEEDONLY);
|
||||
speedImprobableWeight = (float) config.getDouble(ConfPaths.FIGHT_SPEED_IMPROBABLE_WEIGHT);
|
||||
speedActions = config.getOptimizedActionList(ConfPaths.FIGHT_SPEED_ACTIONS, Permissions.FIGHT_SPEED);
|
||||
|
||||
wrongTurnActions = config.getOptimizedActionList(ConfPaths.FIGHT_WRONGTURN_ACTIONS,
|
||||
CheckType.FIGHT_WRONGTURN.getPermission());
|
||||
|
||||
|
||||
cancelDead = config.getBoolean(ConfPaths.FIGHT_CANCELDEAD);
|
||||
loopMaxLatencyTicks = config.getInt(ConfPaths.FIGHT_MAXLOOPLETENCYTICKS, 1, 15, 8);
|
||||
AlmostBoolean ref = config.getAlmostBoolean(ConfPaths.FIGHT_PVP_KNOCKBACKVELOCITY, AlmostBoolean.MAYBE);
|
||||
knockBackVelocityPvP = ref == AlmostBoolean.MAYBE ? Bugs.shouldPvpKnockBackVelocity() : ref.decide();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ public class FightData extends ACheckData implements IDataOnRemoveSubCheckData,
|
||||
public double noSwingVL;
|
||||
public double reachVL;
|
||||
public double speedVL;
|
||||
public double wrongTurnVL;
|
||||
|
||||
// Shared
|
||||
public String lastWorld = "";
|
||||
@@ -53,6 +52,7 @@ public class FightData extends ACheckData implements IDataOnRemoveSubCheckData,
|
||||
|
||||
/** Attack penalty (close combat, ENTITY_ATTACK). */
|
||||
public final PenaltyTime attackPenalty = new PenaltyTime();
|
||||
public final PenaltyTime clicPatPenalty = new PenaltyTime();
|
||||
|
||||
/** The entity id which might get counter-attacked. */
|
||||
public int thornsId = Integer.MIN_VALUE;
|
||||
@@ -94,7 +94,8 @@ public class FightData extends ACheckData implements IDataOnRemoveSubCheckData,
|
||||
|
||||
// Data of the no swing check.
|
||||
public boolean noSwingArmSwung = true; // TODO: First is free for now, 1.12.2, other?
|
||||
public boolean exemptArmSwing = true;
|
||||
public boolean exemptArmSwing = false;
|
||||
public boolean noSwingPacket = false;
|
||||
|
||||
// Data of the reach check.
|
||||
public double reachMod = 1.0;
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.util.Iterator;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Parrot;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.TNTPrimed;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@@ -52,6 +51,8 @@ import fr.neatmonster.nocheatplus.checks.moving.player.UnusedVelocity;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.util.AuxMoving;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.util.MovingUtil;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.velocity.VelocityFlags;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetData;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeEnchant;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeHealth;
|
||||
@@ -111,9 +112,6 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
/** The speed check. */
|
||||
private final Speed speed = addCheck(new Speed());
|
||||
|
||||
/** WrongTurn: clearly invalid data on Bukkit side. */
|
||||
private final WrongTurn wrongTurn = addCheck(new WrongTurn());
|
||||
|
||||
/** For temporary use: LocUtil.clone before passing deeply, call setWorld(null) after use. */
|
||||
private final Location useLoc1 = new Location(null, 0, 0, 0);
|
||||
|
||||
@@ -314,32 +312,36 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
data.thornsId = Integer.MIN_VALUE;
|
||||
}
|
||||
|
||||
// TODO: Add as real check.
|
||||
// TODO: Add something on packet level already.
|
||||
if (pData.isCheckActive(CheckType.FIGHT_WRONGTURN, player)
|
||||
&& wrongTurn.check(player, loc, data, cc)) {
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
// Run through the main checks.
|
||||
if (!cancelled && speed.isEnabled(player, pData)) {
|
||||
if (speed.check(player, now, data, cc, pData)) {
|
||||
cancelled = true;
|
||||
// Still feed the improbable.
|
||||
if (data.speedVL > 50) {
|
||||
Improbable.check(player, 2f, now, "fight.speed", pData);
|
||||
if (cc.speedImprobableWeight > 0.0f) {
|
||||
if (!cc.speedImprobableFeedOnly) {
|
||||
Improbable.check(player, cc.speedImprobableWeight, now, "fight.speed", pData);
|
||||
}
|
||||
}
|
||||
// Improbable.check(player, 2f, now, "fight.speed", pData);
|
||||
}
|
||||
else {
|
||||
Improbable.feed(player, 2f, now);
|
||||
if (cc.speedImprobableWeight > 0.0f) {
|
||||
Improbable.feed(player, cc.speedImprobableWeight, now);
|
||||
}
|
||||
}
|
||||
// Improbable.feed(player, 2f, now);
|
||||
}
|
||||
}
|
||||
else if (normalizedMove > 2.0 && Improbable.check(player, 1f, now,
|
||||
"fight.speed", pData)) {
|
||||
else if (normalizedMove > 2.0) { // && Improbable.check(player, 1f, now, "fight.speed", pData)) {
|
||||
if (cc.speedImprobableWeight > 0.0f) {
|
||||
if (!cc.speedImprobableFeedOnly && Improbable.check(player, cc.speedImprobableWeight, now, "fight.speed", pData)) {
|
||||
cancelled = true;
|
||||
}
|
||||
}
|
||||
// Feed improbable in case of ok-moves too.
|
||||
// TODO: consider only feeding if attacking with higher average speed (!)
|
||||
cancelled = true;
|
||||
}
|
||||
}
|
||||
// TODO: Consider to always check improbable (first?). At least if config.always or speed or net.attackfrequency are enabled.
|
||||
|
||||
if (!cancelled && critical.isEnabled(player, pData)
|
||||
@@ -665,6 +667,14 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
if (source instanceof Player) {
|
||||
attacker = (Player) source;
|
||||
}
|
||||
}
|
||||
if (damagedPlayer != null && !damagedIsDead && (damageCause == DamageCause.BLOCK_EXPLOSION
|
||||
|| damageCause == DamageCause.ENTITY_EXPLOSION)) {
|
||||
final IPlayerData dpdata = DataManager.getPlayerData(damagedPlayer);
|
||||
if (dpdata != null) {
|
||||
MovingData data = dpdata.getGenericInstance(MovingData.class);
|
||||
data.applyexplosionvel = true;
|
||||
}
|
||||
}
|
||||
final FightData attackerData;
|
||||
final IPlayerData attackerPData = attacker == null ? null : DataManager.getPlayerData(attacker);
|
||||
@@ -760,8 +770,9 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
final MovingConfig mcc = pData.getGenericInstance(MovingConfig.class);
|
||||
// TODO: How is the direction really calculated?
|
||||
// Aim at sqrt(vx * vx + vz * vz, 2), not the exact direction.
|
||||
final double vx = level / Math.sqrt(8.0);
|
||||
final double vz = vx;
|
||||
final double[] vel2Dvec = calculateHorizontalVelocity(attacker, damagedPlayer);
|
||||
final double vx = vel2Dvec[0];
|
||||
final double vz = vel2Dvec[1];
|
||||
final double vy = 0.462; // TODO: (0.365) Needs other workarounds, to allow more when moving off ground (vel + GRAVITY_MAX or max jump gain + little?).
|
||||
useLoc1.setWorld(null); // Cleanup.
|
||||
if (pData.isDebugActive(checkType) || pData.isDebugActive(CheckType.MOVING)) {
|
||||
@@ -793,6 +804,54 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
// Cap the level to something reasonable. TODO: Config / cap the velocity anyway.
|
||||
return Math.min(20.0, level);
|
||||
}
|
||||
|
||||
/**
|
||||
* Better method to calculate horizontal velocity including direction!
|
||||
*
|
||||
* @param attacker
|
||||
* @param damagedPlayer
|
||||
* @return velocityX, velocityZ
|
||||
*/
|
||||
private double[] calculateHorizontalVelocity(final Player attacker, final Player damagedPlayer) {
|
||||
final Location aloc = attacker.getLocation();
|
||||
final Location dloc = damagedPlayer.getLocation();
|
||||
final double Xdiff = dloc.getX() - aloc.getX();
|
||||
final double Zdiff = dloc.getZ() - aloc.getZ();
|
||||
final double diffdist = Math.sqrt(Xdiff * Xdiff + Zdiff * Zdiff);
|
||||
double vx = 0.0;
|
||||
double vz = 0.0;
|
||||
int incknockbacklevel = 0;
|
||||
// TODO: Get the RELEVANT item (...).
|
||||
final ItemStack stack = Bridge1_9.getItemInMainHand(attacker);
|
||||
if (!BlockProperties.isAir(stack)) {
|
||||
incknockbacklevel = stack.getEnchantmentLevel(Enchantment.KNOCKBACK);
|
||||
}
|
||||
if (attacker.isSprinting()) {
|
||||
// TODO: Lost sprint?
|
||||
incknockbacklevel++;
|
||||
}
|
||||
// Cap the level to something reasonable. TODO: Config / cap the velocity anyway.
|
||||
incknockbacklevel = Math.min(20, incknockbacklevel);
|
||||
|
||||
if (Math.sqrt(Xdiff * Xdiff + Zdiff * Zdiff) < 1.0E-4D) {
|
||||
if (incknockbacklevel <= 0) incknockbacklevel = -~0;
|
||||
vx = vz = incknockbacklevel / Math.sqrt(8.0);
|
||||
return new double[] {vx, vz};
|
||||
} else {
|
||||
vx = Xdiff / diffdist * 0.4;
|
||||
vz = Zdiff / diffdist * 0.4;
|
||||
}
|
||||
|
||||
if (incknockbacklevel > 0) {
|
||||
vx *= 1.0 + 1.25 * incknockbacklevel;
|
||||
vz *= 1.0 + 1.25 * incknockbacklevel;
|
||||
// Still not exact direction since yaw difference between packet and Location#getYaw();
|
||||
// with incknockbacklevel = 0, it still the precise direction
|
||||
//vx -= Math.sin(aloc.getYaw() * Math.PI / 180.0F) * incknockbacklevel * 0.5F;
|
||||
//vz += Math.cos(aloc.getYaw() * Math.PI / 180.0F) * incknockbacklevel * 0.5F;
|
||||
}
|
||||
return new double[] {vx, vz};
|
||||
}
|
||||
|
||||
/**
|
||||
* We listen to death events to prevent a very specific method of doing godmode.
|
||||
@@ -825,8 +884,10 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
* TODO: First one always fails: Packet inversion on 1.12.2? This could
|
||||
* be moved to packet level (register either).
|
||||
*/
|
||||
DataManager.getGenericInstance(event.getPlayer(),
|
||||
FightData.class).noSwingArmSwung = true;
|
||||
final FightData data = DataManager.getGenericInstance(event.getPlayer(), FightData.class);
|
||||
if (data.noSwingPacket) return;
|
||||
data.noSwingArmSwung = true;
|
||||
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
@@ -871,20 +932,15 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
final double health = Math.min(BridgeHealth.getHealth(player) + BridgeHealth.getAmount(event), BridgeHealth.getMaxHealth(player));
|
||||
data.godModeHealth = Math.max(data.godModeHealth, health);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = false)
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = false)
|
||||
public void entityInteract(PlayerInteractEntityEvent e) {
|
||||
|
||||
Entity entity = e.getRightClicked();
|
||||
final Player player = e.getPlayer();
|
||||
final FightData data = DataManager.getGenericInstance(player, FightData.class);
|
||||
|
||||
if (entity instanceof Parrot) {
|
||||
data.exemptArmSwing = true;
|
||||
} else {
|
||||
data.exemptArmSwing = false;
|
||||
}
|
||||
}
|
||||
data.exemptArmSwing = entity != null && entity.getType().name().equals("PARROT") ? true : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playerJoins(final Player player) {
|
||||
|
||||
@@ -254,9 +254,15 @@ public class Reach extends Check {
|
||||
// Execute whatever actions are associated with this check and the violation level and find out if we should
|
||||
// cancel the event.
|
||||
cancel = executeActions(player, data.reachVL, violation, cc.reachActions).willCancel();
|
||||
if (Improbable.check(player, (float) violation / 2f, System.currentTimeMillis(),
|
||||
"fight.reach", pData)){
|
||||
cancel = true;
|
||||
//if (Improbable.check(player, (float) violation / 2f, System.currentTimeMillis(),
|
||||
// "fight.reach", pData)){
|
||||
// cancel = true;
|
||||
//}
|
||||
// TODO: New improbable weight calculations so that weight is not inverse to config weight
|
||||
if (cc.reachImprobableWeight > 0.0f) {
|
||||
if (!cc.reachImprobableFeedOnly && Improbable.check(player, (float) violation / cc.reachImprobableWeight, System.currentTimeMillis(), "fight.reach", pData)) {
|
||||
cancel = true;
|
||||
}
|
||||
}
|
||||
if (cancel && cc.reachPenalty > 0){
|
||||
// Apply an attack penalty time.
|
||||
@@ -269,7 +275,10 @@ public class Reach extends Check {
|
||||
data.attackPenalty.applyPenalty(cc.reachPenalty / 2);
|
||||
}
|
||||
cancel = true;
|
||||
Improbable.feed(player, (float) (lenpRel - context.distanceLimit * data.reachMod) / 4f, System.currentTimeMillis());
|
||||
if (cc.reachImprobableWeight > 0.0f) {
|
||||
Improbable.feed(player, (float) (lenpRel - context.distanceLimit * data.reachMod) / cc.reachImprobableWeight, System.currentTimeMillis());
|
||||
}
|
||||
// Improbable.feed(player, (float) (lenpRel - context.distanceLimit * data.reachMod) / 4f, System.currentTimeMillis());
|
||||
}
|
||||
else{
|
||||
// Player passed the check, reward them.
|
||||
|
||||
@@ -1,62 +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.fight;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
|
||||
/**
|
||||
* First WrongTurn variant (pitch, possibly other).
|
||||
*
|
||||
* @author asofold
|
||||
*
|
||||
*/
|
||||
public class WrongTurn extends Check {
|
||||
|
||||
public WrongTurn() {
|
||||
super(CheckType.FIGHT_WRONGTURN);
|
||||
}
|
||||
|
||||
public boolean check (final Player player, final Location loc,
|
||||
final FightData data, final FightConfig cc) {
|
||||
|
||||
final float pitch = loc.getPitch();
|
||||
|
||||
// Invalid Pitch
|
||||
// TODO: Does invalid pitch arrive here at all?
|
||||
// TODO: Prefer to detect on packet level already.
|
||||
if (Math.abs(pitch) > 90.0f) {
|
||||
data.wrongTurnVL += 1; // (Never cooldown.)
|
||||
if (executeActions(player, data.wrongTurnVL, 1.0, cc.wrongTurnActions).willCancel()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Better have the following in a check not resulting in banning 100% of the time.
|
||||
// TODO: Suspicious yaw + pitch combination (static).
|
||||
/*
|
||||
* TODO: Past moves: detect fast turning towards opponent for an easier
|
||||
* thing (re-use for difficulty). Better have an extra spot for relating
|
||||
* moves of the attacker vs. moves of the attacked.
|
||||
*/
|
||||
// TODO: Past moves: detect optimizing look/position in general.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+2
-1
@@ -24,6 +24,7 @@ import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.net.FlyingQueueHandle;
|
||||
import fr.neatmonster.nocheatplus.checks.net.FlyingQueueLookBlockChecker;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.components.config.ICheckConfig;
|
||||
import fr.neatmonster.nocheatplus.components.data.ICheckData;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
@@ -198,7 +199,7 @@ public abstract class AbstractBlockDirectionCheck<D extends ICheckData, C extend
|
||||
// Initialize fully each time.
|
||||
boulder.setFindNearestPointIfNotCollide(true)
|
||||
.setRay(x, y, z, dirX, dirY, dirZ)
|
||||
.setAABB(blockX, blockY, blockZ, 0.1)
|
||||
.setAABB(blockX, blockY, blockZ, Bridge1_13.hasIsSwimming() ? 0.9 : 0.1)
|
||||
.loop();
|
||||
// Interpret result.
|
||||
if (boulder.collides()) {
|
||||
|
||||
@@ -125,6 +125,10 @@ public class FastClick extends Check {
|
||||
amount = 1f;
|
||||
}
|
||||
|
||||
if (isShiftClick && inventoryAction.equals("MOVE_TO_OTHER_INVENTORY") && (cursorMat != null && cursorMat != Material.AIR) && clickedMat != Material.AIR) {
|
||||
return false;
|
||||
}
|
||||
|
||||
data.fastClickFreq.add(now, amount);
|
||||
|
||||
float shortTerm = data.fastClickFreq.bucketScore(0);
|
||||
@@ -161,7 +165,10 @@ public class FastClick extends Check {
|
||||
data.fastClickLastCursorAmount = cursorAmount;
|
||||
|
||||
// Feed the improbable.
|
||||
Improbable.feed(player, 0.7f * amount, System.currentTimeMillis());
|
||||
if (cc.fastClickImprobableWeight > 0.0f) {
|
||||
Improbable.feed(player, cc.fastClickImprobableWeight * amount, now);
|
||||
}
|
||||
// Improbable.feed(player, 0.7f * amount, System.currentTimeMillis());
|
||||
|
||||
return cancel;
|
||||
}
|
||||
|
||||
+5
-1
@@ -43,6 +43,7 @@ public class InventoryConfig extends ACheckConfig {
|
||||
public final float fastClickNormalLimit;
|
||||
public final int chestOpenLimit;
|
||||
public final Set<String> inventoryExemptions = new HashSet<String>();
|
||||
public final float fastClickImprobableWeight;
|
||||
public final ActionList fastClickActions;
|
||||
|
||||
public final long fastConsumeDuration;
|
||||
@@ -64,6 +65,7 @@ public class InventoryConfig extends ACheckConfig {
|
||||
public final boolean openClose;
|
||||
public final boolean openCancelOther;
|
||||
|
||||
public final boolean invMoveDisableCreative;
|
||||
public final ActionList invMoveActionList;
|
||||
|
||||
// Hot fixes.
|
||||
@@ -88,6 +90,7 @@ public class InventoryConfig extends ACheckConfig {
|
||||
fastClickNormalLimit = (float) data.getDouble(ConfPaths.INVENTORY_FASTCLICK_LIMIT_NORMAL);
|
||||
chestOpenLimit = data.getInt(ConfPaths.INVENTORY_FASTCLICK_LIMIT_CHEST);
|
||||
data.readStringlFromList(ConfPaths.INVENTORY_FASTCLICK_EXCLUDE, inventoryExemptions);
|
||||
fastClickImprobableWeight = (float) data.getDouble(ConfPaths.INVENTORY_FASTCLICK_IMPROBABLE_WEIGHT);
|
||||
fastClickActions = data.getOptimizedActionList(ConfPaths.INVENTORY_FASTCLICK_ACTIONS, Permissions.INVENTORY_FASTCLICK);
|
||||
|
||||
fastConsumeDuration = (long) (1000.0 * data.getDouble(ConfPaths.INVENTORY_FASTCONSUME_DURATION));
|
||||
@@ -109,7 +112,8 @@ public class InventoryConfig extends ACheckConfig {
|
||||
openClose = data.getBoolean(ConfPaths.INVENTORY_OPEN_CLOSE);
|
||||
openCancelOther = data.getBoolean(ConfPaths.INVENTORY_OPEN_CANCELOTHER);
|
||||
|
||||
invMoveActionList = data.getOptimizedActionList(ConfPaths.INVENTORY_INVENTORYMOVE_ACTIONS, Permissions.INVENTORY_MOVE);
|
||||
invMoveDisableCreative = data.getBoolean(ConfPaths.INVENTORY_INVENTORYMOVE_DISABLECREATIVE);
|
||||
invMoveActionList = data.getOptimizedActionList(ConfPaths.INVENTORY_INVENTORYMOVE_ACTIONS, Permissions.INVENTORY_INVENTORYMOVE);
|
||||
|
||||
hotFixFallingBlockEndPortalActive = data.getBoolean(ConfPaths.INVENTORY_HOTFIX_DUPE_FALLINGBLOCKENDPORTAL);
|
||||
}
|
||||
|
||||
+43
-17
@@ -14,9 +14,6 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.checks.inventory;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
@@ -38,24 +35,26 @@ import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryEvent;
|
||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.inventory.InventoryType.SlotType;
|
||||
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerItemHeldEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerPortalEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.block.Chest;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckListener;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.combined.Combined;
|
||||
import fr.neatmonster.nocheatplus.checks.combined.Improbable;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.util.MovingUtil;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeHealth;
|
||||
@@ -87,6 +86,9 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
|
||||
/** Inventory Move check */
|
||||
private final InventoryMove invMove = addCheck(new InventoryMove());
|
||||
|
||||
/** More Inventory check */
|
||||
private final MoreInventory moreInv = addCheck(new MoreInventory());
|
||||
|
||||
/** The fast click check. */
|
||||
private final FastClick fastClick = addCheck(new FastClick());
|
||||
@@ -170,7 +172,7 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
}
|
||||
final InventoryConfig cc = pData.getGenericInstance(InventoryConfig.class);
|
||||
// Still check instantBow, whatever yawrate says.
|
||||
if (instantBow.check(player, event.getForce(), now)) {
|
||||
if (!event.getBow().getType().toString().equals("CROSSBOW") && instantBow.check(player, event.getForce(), now)) {
|
||||
// The check requested the event to be cancelled.
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@@ -268,7 +270,7 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
// Fast inventory manipulation check.
|
||||
if (fastClick.isEnabled(player, pData)) {
|
||||
final InventoryConfig cc = pData.getGenericInstance(InventoryConfig.class);
|
||||
if (player.getGameMode() != GameMode.CREATIVE || !cc.fastClickSpareCreative || !cc.inventoryExemptions.contains(ChatColor.stripColor(event.getInventory().getName()))) {
|
||||
if (!((event.getView().getType().equals(InventoryType.CREATIVE) || player.getGameMode() == GameMode.CREATIVE) && cc.fastClickSpareCreative) && !cc.inventoryExemptions.contains(ChatColor.stripColor(event.getView().getTitle()))) {
|
||||
if (fastClick.check(player, now,
|
||||
event.getView(), slot, cursor, clicked, event.isShiftClick(),
|
||||
inventoryAction, data, cc, pData)) {
|
||||
@@ -276,7 +278,7 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
cancel = true;
|
||||
}
|
||||
// Listen for more than just a chest?
|
||||
if (event.getInventory().getType().equals(InventoryType.CHEST) || event.getInventory().getType().equals(InventoryType.ENDER_CHEST)) {
|
||||
if (event.getInventory().getType().equals(InventoryType.CHEST) || event.getInventory().getType().equals(InventoryType.ENDER_CHEST) || event.getInventory().getType().toString().equals("BARREL") || event.getInventory().getType().toString().equals("SHULKER_BOX")) {
|
||||
if (fastClick.fastClickChest(player, data, cc)) {
|
||||
cancel = true;
|
||||
keepCancel = true;
|
||||
@@ -286,9 +288,11 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
}
|
||||
|
||||
// Inventory Move check
|
||||
final SlotType type = event.getSlotType();
|
||||
if (invMove.isEnabled(player, pData)) {
|
||||
if (invMove.check(player, data, pData)) {
|
||||
cancel = true;
|
||||
final InventoryConfig cc = pData.getGenericInstance(InventoryConfig.class);
|
||||
if (invMove.check(player, data, pData, cc, type)) {
|
||||
cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,7 +326,7 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
|
||||
// Check left click too to prevent any bypasses
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock() != null || event.getAction() == Action.LEFT_CLICK_BLOCK && event.getClickedBlock() != null) {
|
||||
if (event.getClickedBlock().getType() == Material.CHEST || event.getClickedBlock().getType() == Material.ENDER_CHEST) {
|
||||
if (event.getClickedBlock().getType().toString().endsWith("CHEST") || event.getClickedBlock().getType().toString().equals("BARREL") || event.getClickedBlock().getType().toString().endsWith("SHULKER_BOX")) {
|
||||
data.chestOpenTime = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
@@ -362,10 +366,10 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
builder.append(view.getClass().getName());
|
||||
|
||||
// Bottom inventory.
|
||||
addInventory(player, view.getBottomInventory(), " , Bottom: ", builder);
|
||||
addInventory(player, view.getBottomInventory(), view, " , Bottom: ", builder);
|
||||
|
||||
// Top inventory.
|
||||
addInventory(player, view.getBottomInventory(), " , Top: ", builder);
|
||||
addInventory(player, view.getBottomInventory(), view, " , Top: ", builder);
|
||||
|
||||
if (action != null) {
|
||||
builder.append(" , Action: ");
|
||||
@@ -380,17 +384,15 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
debug(player, builder.toString());
|
||||
}
|
||||
|
||||
private void addInventory(final Player player, final Inventory inventory, final String prefix,
|
||||
private void addInventory(final Player player, final Inventory inventory, final InventoryView view, final String prefix,
|
||||
final StringBuilder builder) {
|
||||
builder.append(prefix);
|
||||
if (inventory == null) {
|
||||
builder.append("(none)");
|
||||
}
|
||||
else {
|
||||
final String name = inventory.getName();
|
||||
final String title = inventory.getTitle();
|
||||
final boolean same = name == null && title == null || name != null && name.equals(title);
|
||||
builder.append((same ? name : (name + "/" + title)));
|
||||
String name = view.getTitle();
|
||||
builder.append(name);
|
||||
builder.append("/");
|
||||
builder.append(inventory.getClass().getName());
|
||||
}
|
||||
@@ -579,6 +581,30 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onMove(final PlayerMoveEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
final Location from = event.getFrom();
|
||||
final Location to = event.getTo();
|
||||
final boolean PoYdiff = from.getPitch() != to.getPitch() || from.getYaw() != to.getYaw();
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
if (pData == null) return;
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
final Inventory inv = player.getOpenInventory().getTopInventory();
|
||||
if (moreInv.isEnabled(player, pData)
|
||||
&& moreInv.check(player, data, pData, inv.getType(), inv, PoYdiff)) {
|
||||
for (int i =1; i<=4 ;i++) {
|
||||
final ItemStack item = inv.getItem(i);
|
||||
if (item != null && item.getType() != Material.AIR) {
|
||||
player.getWorld().dropItemNaturally(player.getLocation(), item);
|
||||
inv.setItem(i, null);
|
||||
if (pData.isDebugActive(CheckType.INVENTORY_MOREINVENTORY))
|
||||
debug(player , "Drop items from crafting slot:" + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerTeleport(final PlayerTeleportEvent event) {
|
||||
|
||||
+90
-13
@@ -1,30 +1,107 @@
|
||||
package fr.neatmonster.nocheatplus.checks.inventory;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.inventory.InventoryType.SlotType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
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.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
|
||||
/**
|
||||
* A simple check to prevent players from interacting with their inventory if they shouldn't be allowed to.
|
||||
*/
|
||||
|
||||
public class InventoryMove extends Check {
|
||||
|
||||
private final List<String> tags = new LinkedList<String>();
|
||||
|
||||
public InventoryMove() {
|
||||
super(CheckType.INVENTORY_MOVE);
|
||||
super(CheckType.INVENTORY_INVENTORYMOVE);
|
||||
}
|
||||
|
||||
public boolean check(final Player player, final InventoryData data, final IPlayerData pData) {
|
||||
public boolean check(final Player player, final InventoryData data, final IPlayerData pData, final InventoryConfig cc, final SlotType type) {
|
||||
|
||||
boolean cancel = false;
|
||||
|
||||
if (player.isBlocking() || player.isSprinting() || player.isSneaking() || player.isSwimming()) {
|
||||
data.invMoveVL += 1D;
|
||||
|
||||
cancel = executeActions(player, data.invMoveVL, 1D, pData.getGenericInstance(InventoryConfig.class).invMoveActionList).willCancel();
|
||||
}
|
||||
return cancel;
|
||||
}
|
||||
|
||||
}
|
||||
boolean cancel = false;
|
||||
|
||||
final MovingData Mdata = pData.getGenericInstance(MovingData.class);
|
||||
final PlayerMoveData lastMove = Mdata.playerMoves.getCurrentMove();
|
||||
final boolean isOnGround = lastMove.touchedGround || lastMove.from.onGround || lastMove.to.onGround;
|
||||
|
||||
// Dummy way to fix bug when interacting shopkeeper trader
|
||||
final boolean a = player.getOpenInventory().getTopInventory().getType() == InventoryType.MERCHANT;
|
||||
|
||||
// Tags
|
||||
if (player.isBlocking()) {
|
||||
tags.add("isBlocking");
|
||||
}
|
||||
else if (player.isSneaking()) {
|
||||
tags.add("isSneaking");
|
||||
}
|
||||
else if (Bridge1_13.isSwimming(player)) {
|
||||
if (!isOnGround) tags.add("isSwimming");
|
||||
}
|
||||
else if (player.isSprinting()) {
|
||||
tags.add("isSprinting");
|
||||
}
|
||||
else if (player.isDead()) {
|
||||
tags.add("isDead");
|
||||
}
|
||||
|
||||
// Do the actual check
|
||||
if (player.isSneaking() || (player.isSprinting() && !Bridge1_13.isSwimming(player))
|
||||
|| (player.isBlocking() && !a) || player.isDead() || (Bridge1_13.isSwimming(player) && !isOnGround)) {
|
||||
// Check if the player is in creative
|
||||
if (player.getGameMode() == GameMode.CREATIVE) {
|
||||
// (Skip hotbar interactions)
|
||||
if (type == SlotType.QUICKBAR) {
|
||||
// Prevent tag addition/spam
|
||||
tags.clear();
|
||||
return false;
|
||||
}
|
||||
// Check if the Disable_Creative option is not enabled
|
||||
else if (!cc.invMoveDisableCreative) {
|
||||
// Violation
|
||||
data.invMoveVL += 1.0D;
|
||||
final ViolationData vd = new ViolationData(this, player, data.invMoveVL, 1, pData.getGenericInstance(InventoryConfig.class).invMoveActionList);
|
||||
if (vd.needsParameters()){
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
// Clear tags
|
||||
tags.clear();
|
||||
return executeActions(vd).willCancel();
|
||||
}
|
||||
// Disable_Creative is enabled, skip
|
||||
else {
|
||||
// Prevent tag addition/spam
|
||||
tags.clear();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Player is not in creative
|
||||
else {
|
||||
// Violation
|
||||
data.invMoveVL += 1.0D;
|
||||
final ViolationData vd = new ViolationData(this, player, data.invMoveVL, 1, pData.getGenericInstance(InventoryConfig.class).invMoveActionList);
|
||||
if (vd.needsParameters()){
|
||||
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
|
||||
}
|
||||
// Clear tags
|
||||
tags.clear();
|
||||
return executeActions(vd).willCancel();
|
||||
}
|
||||
}
|
||||
return cancel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package fr.neatmonster.nocheatplus.checks.inventory;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
|
||||
public class MoreInventory extends Check{
|
||||
public MoreInventory() {
|
||||
super(CheckType.INVENTORY_MOREINVENTORY);
|
||||
}
|
||||
|
||||
public boolean check(final Player player, final MovingData movingdata, final IPlayerData pData, final InventoryType type, final Inventory inv, final boolean PoYdiff) {
|
||||
if (type == InventoryType.CRAFTING
|
||||
&& (player.isSprinting() || PoYdiff || player.isBlocking() || player.isSneaking() || movingdata.isusingitem)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,7 @@ import fr.neatmonster.nocheatplus.checks.moving.player.PlayerSetBackMethod;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.util.MovingUtil;
|
||||
import fr.neatmonster.nocheatplus.command.CommandUtil;
|
||||
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.Bugs;
|
||||
import fr.neatmonster.nocheatplus.compat.versions.ServerVersion;
|
||||
@@ -56,6 +57,7 @@ public class MovingConfig extends ACheckConfig {
|
||||
// Model flying ids.
|
||||
public static final String ID_JETPACK_ELYTRA = "jetpack.elytra";
|
||||
public static final String ID_POTION_LEVITATION = "potion.levitation";
|
||||
public static final String ID_POTION_SLOWFALLING = "potion.slowfalling";
|
||||
|
||||
// INSTANCE
|
||||
|
||||
@@ -65,6 +67,7 @@ public class MovingConfig extends ACheckConfig {
|
||||
private final Map<GameMode, ModelFlying> flyingModelGameMode = new HashMap<GameMode, ModelFlying>();
|
||||
private final ModelFlying flyingModelElytra;
|
||||
private final ModelFlying flyingModelLevitation;
|
||||
private final ModelFlying flyingModelSlowfalling;
|
||||
public final ActionList creativeFlyActions;
|
||||
|
||||
/** Assumed number of packets per second under ideal conditions. */
|
||||
@@ -166,6 +169,8 @@ public class MovingConfig extends ACheckConfig {
|
||||
public final boolean enforceLocation;
|
||||
public final boolean trackBlockMove;
|
||||
public final PlayerSetBackMethod playerSetBackMethod;
|
||||
public final boolean resetFwOnground;
|
||||
public final boolean elytraStrict;
|
||||
|
||||
// Vehicles
|
||||
public final boolean vehicleEnforceLocation;
|
||||
@@ -209,9 +214,14 @@ public class MovingConfig extends ACheckConfig {
|
||||
flyingModelLevitation = new ModelFlying(ID_POTION_LEVITATION, config,
|
||||
ConfPaths.MOVING_CREATIVEFLY_MODEL + "levitation.",
|
||||
new ModelFlying(null, defaultModel).scaleLevitationEffect(true).lock());
|
||||
flyingModelSlowfalling = new ModelFlying(ID_POTION_SLOWFALLING, config,
|
||||
ConfPaths.MOVING_CREATIVEFLY_MODEL + "slowfalling.",
|
||||
new ModelFlying(null, defaultModel).scaleSlowfallingEffect(true).lock());
|
||||
flyingModelElytra = new ModelFlying(ID_JETPACK_ELYTRA, config,
|
||||
ConfPaths.MOVING_CREATIVEFLY_MODEL + "elytra.",
|
||||
new ModelFlying(null, defaultModel).verticalAscendGliding(true).lock());
|
||||
resetFwOnground = config.getBoolean(ConfPaths.MOVING_CREATIVEFLY_EYTRA_FWRESET);
|
||||
elytraStrict = config.getBoolean(ConfPaths.MOVING_CREATIVEFLY_EYTRA_STRICT);
|
||||
creativeFlyActions = config.getOptimizedActionList(ConfPaths.MOVING_CREATIVEFLY_ACTIONS,
|
||||
Permissions.MOVING_CREATIVEFLY);
|
||||
|
||||
@@ -390,8 +400,12 @@ public class MovingConfig extends ACheckConfig {
|
||||
&& !fromLocation.isInLiquid()) {
|
||||
return flyingModelLevitation;
|
||||
}
|
||||
// Slow Falling
|
||||
if (gameMode != GameMode.CREATIVE && !Double.isInfinite(Bridge1_13.getSlowfallingAmplifier(player))) {
|
||||
return flyingModelSlowfalling;
|
||||
}
|
||||
// Default by game mode.
|
||||
return modelGameMode;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+1391
-1371
File diff suppressed because it is too large.
Load diff
+3013
-2857
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -130,8 +130,8 @@ public class LocationTrace {
|
||||
@Override
|
||||
public boolean isInside(final double x, final double y, final double z) {
|
||||
return y >= this.y && y <= this.y + this.boxMarginVertical
|
||||
&& Math.abs(x - this.x) <= this.boxMarginHorizontal
|
||||
&& Math.abs(z - this.z) <= this.boxMarginHorizontal;
|
||||
&& Math.abs(x - this.x) <= this.boxMarginHorizontal * 2.5
|
||||
&& Math.abs(z - this.z) <= this.boxMarginHorizontal * 2.5;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,22 +47,28 @@ public class Magic {
|
||||
// Horizontal speeds/modifiers.
|
||||
public static final double WALK_SPEED = 0.221D;
|
||||
public static final double modSneak = 0.13D / WALK_SPEED;
|
||||
// public static final double modSprint = 0.29 / walkSpeed; // TODO: without bunny 0.29 / practical is 0.35
|
||||
public static final double modBlock = 0.16D / WALK_SPEED;
|
||||
public static final double modSwim = 0.3D / WALK_SPEED;
|
||||
public static final double modRiptide = 10.0D;
|
||||
public static final double modDolphinsGrace = 5.0D; // TODO: Adjust value to be more stricter and closer to actual movement speed, and use different value from in water vs above water
|
||||
public static final double modSprint = 0.27 / WALK_SPEED; // TODO: without bunny 0.29 / practical is 0.35
|
||||
public static final double modBlock = 0.1277D / WALK_SPEED;
|
||||
public static final double[] modSwim = new double[] {0.115D / WALK_SPEED, 0.044D / WALK_SPEED, 0.3D / WALK_SPEED}; // 0.044D for horizontal, 0.3 for vertical swimming
|
||||
public static final double[] modRiptide = new double[] {
|
||||
1.0,
|
||||
4.8, //4.6 ?
|
||||
7.2, //7.0 ?
|
||||
10.0
|
||||
};
|
||||
public static final double modDolphinsGrace = 4.3D; // TODO: Adjust value to be more stricter and closer to actual movement speed, and use different value from in water vs above water
|
||||
public static final double[] modDepthStrider = new double[] {
|
||||
1.0,
|
||||
0.1645 / modSwim / WALK_SPEED,
|
||||
0.1995 / modSwim / WALK_SPEED,
|
||||
1.0 / modSwim, // Results in walkspeed.
|
||||
0.1645 / modSwim[0] / WALK_SPEED,
|
||||
0.1995 / modSwim[0] / WALK_SPEED,
|
||||
1.0 / modSwim[0], // Results in walkspeed.
|
||||
};
|
||||
public static final double modWeb = 0.105D / WALK_SPEED; // TODO: walkingSpeed * 0.15D; <- does not work
|
||||
public static final double modSoulSand = 0.16D / WALK_SPEED;
|
||||
public static final double modIce = 2.5D; //
|
||||
public static final double modWeb = 0.09D / WALK_SPEED; // TODO: walkingSpeed * 0.15D; <- does not work
|
||||
public static final double modSoulSand = 0.16D / WALK_SPEED;
|
||||
public static final double modStairs = 0.27D / WALK_SPEED;
|
||||
public static final double modIce = 2.5D; //
|
||||
/** Faster moving down stream (water mainly). */
|
||||
public static final double modDownStream = 0.19 / (WALK_SPEED * modSwim);
|
||||
public static final double modDownStream = 0.19 / (WALK_SPEED * modSwim[0]);
|
||||
|
||||
/**
|
||||
* Somewhat arbitrary horizontal speed gain maximum for advance glide phase.
|
||||
@@ -125,9 +131,9 @@ public class Magic {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static double swimBaseSpeedV() {
|
||||
public static double swimBaseSpeedV(boolean isSwimming) {
|
||||
// TODO: Does this have to be the dynamic walk speed (refactoring)?
|
||||
return WALK_SPEED * modSwim + 0.1;
|
||||
return isSwimming ? WALK_SPEED * modSwim[2] + 0.1 : WALK_SPEED * modSwim[0] + 0.07; // 0.244
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -379,4 +385,4 @@ public class Magic {
|
||||
&& lastMove.yDistance < maxJumpGain && lastMove.yDistance > maxJumpGain * 0.67
|
||||
&& Magic.fallingEnvelope(yDistance, maxJumpGain, data.lastFrictionVertical, Magic.GRAVITY_SPAN);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,10 @@ import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.LiftOffEnvelope;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.velocity.SimpleEntry;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.velocity.VelocityFlags;
|
||||
import fr.neatmonster.nocheatplus.checks.workaround.WRPT;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.PlayerLocation;
|
||||
|
||||
public class MagicAir {
|
||||
@@ -68,6 +71,22 @@ public class MagicAir {
|
||||
&& data.ws.use(WRPT.W_M_SF_SLIME_JP_2X0)
|
||||
;
|
||||
}
|
||||
|
||||
public static boolean oddBounce(final PlayerLocation to, final double yDistance, final PlayerMoveData lastMove, final MovingData data) {
|
||||
final SimpleEntry entry = data.peekVerticalVelocity(yDistance, 0, 4);
|
||||
if (entry != null && entry.hasFlag(VelocityFlags.ORIGIN_BLOCK_BOUNCE)) {
|
||||
data.setFrictionJumpPhase();
|
||||
return true;
|
||||
} else {
|
||||
// Try to use past yDis
|
||||
final SimpleEntry entry2 = data.peekVerticalVelocity(lastMove.yDistance, 0, 4);
|
||||
if (entry2 != null && entry2.hasFlag(VelocityFlags.ORIGIN_BLOCK_BOUNCE)) {
|
||||
data.setFrictionJumpPhase();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Odd decrease after lift-off.
|
||||
@@ -183,6 +202,7 @@ public class MagicAir {
|
||||
// yDistance >= -GRAVITY_MAX - GRAVITY_SPAN
|
||||
// && (yDistChange < -GRAVITY_MIN && Math.abs(yDistChange) <= 2.0 * GRAVITY_MAX + GRAVITY_SPAN
|
||||
// || from.isHeadObstructed(from.getyOnGround()) || data.fromWasReset && from.isHeadObstructed())
|
||||
final int blockdata = from.getData(from.getBlockX(), from.getBlockY(), from.getBlockZ());
|
||||
return
|
||||
// 0: Any envelope (supposedly normal) near 0 yDistance.
|
||||
yDistance > -2.0 * Magic.GRAVITY_MAX - Magic.GRAVITY_MIN && yDistance < 2.0 * Magic.GRAVITY_MAX + Magic.GRAVITY_MIN
|
||||
@@ -243,7 +263,7 @@ public class MagicAir {
|
||||
// 1: Bounce without velocity set. TODO: wat?
|
||||
//|| lastMove.yDistance == 0.0 && yDistance > -GRAVITY_MIN && yDistance < GRAVITY_SPAN
|
||||
// 1: Bounce with carpet.
|
||||
|| yDistance < 0.006
|
||||
//|| yDistance < 0.006
|
||||
)
|
||||
// 0: Jump-effect-specific
|
||||
// TODO: Jump effect at reduced lift off envelope -> skip this?
|
||||
@@ -259,21 +279,21 @@ public class MagicAir {
|
||||
|| data.liftOffEnvelope != LiftOffEnvelope.NORMAL
|
||||
&& (
|
||||
// 1: Wild-card allow half gravity near 0 yDistance. TODO: Check for removal of included cases elsewhere.
|
||||
lastMove.yDistance > -10.0 * Magic.GRAVITY_ODD / 2.0 && lastMove.yDistance < 10.0 * Magic.GRAVITY_ODD
|
||||
!(data.liftOffEnvelope.name().startsWith("LIMIT") && (Math.abs(yDistance) > 0.1 || blockdata > 3)) && lastMove.yDistance > -10.0 * Magic.GRAVITY_ODD / 2.0 && lastMove.yDistance < 10.0 * Magic.GRAVITY_ODD
|
||||
&& yDistance < lastMove.yDistance - Magic.GRAVITY_MIN / 2.0 && yDistance > lastMove.yDistance - Magic.GRAVITY_MAX
|
||||
// 1:
|
||||
|| lastMove.yDistance < Magic.GRAVITY_MAX + Magic.GRAVITY_SPAN && lastMove.yDistance > Magic.GRAVITY_ODD
|
||||
|| !data.liftOffEnvelope.name().startsWith("LIMIT") && lastMove.yDistance < Magic.GRAVITY_MAX + Magic.GRAVITY_SPAN && lastMove.yDistance > Magic.GRAVITY_ODD
|
||||
&& yDistance > 0.4 * Magic.GRAVITY_ODD && yDistance - lastMove.yDistance < -Magic.GRAVITY_ODD / 2.0
|
||||
// 1:
|
||||
|| lastMove.yDistance < 0.2 && lastMove.yDistance >= 0.0 && yDistance > -0.2 && yDistance < 2.0 * Magic.GRAVITY_MAX
|
||||
// 1:
|
||||
// 1: (damaged in liquid) ?
|
||||
|| lastMove.yDistance < 0.2 && lastMove.yDistance >= 0.0 && yDistance > -0.2 && yDistance < 2.0 * Magic.GRAVITY_MIN
|
||||
// 1: Reset condition?
|
||||
|| lastMove.yDistance > 0.4 * Magic.GRAVITY_ODD && lastMove.yDistance < Magic.GRAVITY_MIN && yDistance == 0.0
|
||||
// 1: Too small decrease, right after lift off.
|
||||
|| data.sfJumpPhase == 1 && lastMove.yDistance > -Magic.GRAVITY_ODD && lastMove.yDistance <= Magic.GRAVITY_MAX + Magic.GRAVITY_SPAN
|
||||
&& yDistance - lastMove.yDistance < 0.0114
|
||||
&& Math.abs(yDistance - lastMove.yDistance) < 0.0114
|
||||
// 1: Any leaving liquid and keeping distance once.
|
||||
|| data.sfJumpPhase == 1
|
||||
&& Math.abs(yDistance) <= Magic.swimBaseSpeedV() && yDistance == lastMove.yDistance
|
||||
&& Math.abs(yDistance) <= Magic.swimBaseSpeedV(Bridge1_13.isSwimming(from.getPlayer())) && yDistance == lastMove.yDistance
|
||||
)
|
||||
;
|
||||
}
|
||||
@@ -446,4 +466,4 @@ public class MagicAir {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+7
-4
@@ -15,7 +15,9 @@
|
||||
package fr.neatmonster.nocheatplus.checks.moving.magic;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.LiftOffEnvelope;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.PlayerLocation;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
@@ -49,17 +51,18 @@ public class MagicLiquid {
|
||||
// TODO: liftOffEnvelope: refine conditions (general) , should be near water level.
|
||||
// TODO: 1.5 high blocks ?
|
||||
// TODO: Conditions seem warped.
|
||||
final int blockdata = from.getData(from.getBlockX(), from.getBlockY(), from.getBlockZ());
|
||||
if (yDistance <= 0.5) {
|
||||
if (lastMove.toIsValid && yDistance < lastMove.yDistance
|
||||
&& lastMove.yDistance - yDistance > Math.max(0.001, yDistance - baseSpeed)) {
|
||||
// Decrease more than difference to baseSpeed.
|
||||
return yDistance;
|
||||
}
|
||||
if (yDistance <= data.liftOffEnvelope.getMaxJumpGain(data.jumpAmplifier) && !BlockProperties.isLiquid(from.getTypeIdAbove())
|
||||
if (!(data.liftOffEnvelope == LiftOffEnvelope.LIMIT_LIQUID && Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(from.getPlayer())) && blockdata < 4) && (yDistance <= data.liftOffEnvelope.getMaxJumpGain(data.jumpAmplifier) && !BlockProperties.isLiquid(from.getTypeIdAbove())
|
||||
// TODO: What now !?
|
||||
|| !to.isInLiquid() // TODO: impossible !?
|
||||
|| (thisMove.to.onGround || lastMove.toIsValid && lastMove.yDistance - yDistance >= 0.010 || to.isAboveStairs())) {
|
||||
double vAllowedDistance = baseSpeed + 0.5;
|
||||
|| (thisMove.to.onGround || lastMove.toIsValid && lastMove.yDistance - yDistance >= 0.010 || to.isAboveStairs()))) {
|
||||
double vAllowedDistance = baseSpeed + (blockdata > 3 || data.liftOffEnvelope == LiftOffEnvelope.NORMAL ? 0.397 : 0.197); // asc by water level
|
||||
double vDistanceAboveLimit = yDistance - vAllowedDistance;
|
||||
if (vDistanceAboveLimit <= 0.0) {
|
||||
return vAllowedDistance;
|
||||
@@ -161,4 +164,4 @@ public class MagicLiquid {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -62,6 +62,12 @@ public class ModelFlying {
|
||||
* level.
|
||||
*/
|
||||
private boolean scaleLevitationEffect = false;
|
||||
|
||||
/**
|
||||
* Allow an extra amount to ascend speed, scaling with the slowfalling effect
|
||||
* level.
|
||||
*/
|
||||
private boolean scaleSlowfallingEffect = false;
|
||||
|
||||
// TODO: vertical ascend/descend, limit gain a/d/v, limit abs. distance a/d/v
|
||||
// TODO: possibly other friction based envelope constraints.
|
||||
@@ -104,6 +110,7 @@ public class ModelFlying {
|
||||
gravity(config.getBoolean(prefix + ConfPaths.SUB_VERTICAL_GRAVITY, defaults.getGravity()));
|
||||
ground(config.getBoolean(prefix + ConfPaths.SUB_GROUND, defaults.getGround()));
|
||||
scaleLevitationEffect(defaults.getScaleLevitationEffect()); // Config?
|
||||
scaleSlowfallingEffect(defaults.getScaleSlowfallingEffect());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,6 +131,7 @@ public class ModelFlying {
|
||||
gravity(defaults.getGravity());
|
||||
ground(defaults.getGround());
|
||||
scaleLevitationEffect(defaults.getScaleLevitationEffect());
|
||||
scaleSlowfallingEffect(defaults.getScaleSlowfallingEffect());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -191,6 +199,10 @@ public class ModelFlying {
|
||||
public boolean getScaleLevitationEffect() {
|
||||
return scaleLevitationEffect;
|
||||
}
|
||||
|
||||
public boolean getScaleSlowfallingEffect() {
|
||||
return scaleSlowfallingEffect;
|
||||
}
|
||||
|
||||
public ModelFlying horizontalModSpeed(double horizontalModSpeed) {
|
||||
checkLocked();
|
||||
@@ -246,4 +258,9 @@ public class ModelFlying {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ModelFlying scaleSlowfallingEffect(final boolean scaleSlowfallingEffect) {
|
||||
checkLocked();
|
||||
this.scaleSlowfallingEffect = scaleSlowfallingEffect;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
+260
-17
@@ -22,6 +22,8 @@ import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.actions.ParameterName;
|
||||
@@ -36,13 +38,21 @@ import fr.neatmonster.nocheatplus.checks.moving.model.LiftOffEnvelope;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.ModelFlying;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.util.MovingUtil;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.velocity.AccountEntry;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.velocity.SimpleEntry;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeEnchant;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.changetracker.BlockChangeTracker;
|
||||
import fr.neatmonster.nocheatplus.components.modifier.IAttributeAccess;
|
||||
import fr.neatmonster.nocheatplus.components.registry.event.IGenericInstanceHandle;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.PotionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.PlayerLocation;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.TrigUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
/**
|
||||
* A check designed for people that are allowed to fly. The complement to the "SurvivalFly", which is for people that
|
||||
@@ -52,6 +62,7 @@ public class CreativeFly extends Check {
|
||||
|
||||
private final List<String> tags = new LinkedList<String>();
|
||||
private final BlockChangeTracker blockChangeTracker;
|
||||
private IGenericInstanceHandle<IAttributeAccess> attributeAccess = NCPAPIProvider.getNoCheatPlusAPI().getGenericInstanceHandle(IAttributeAccess.class);
|
||||
|
||||
/**
|
||||
* Instantiates a new creative fly check.
|
||||
@@ -92,24 +103,13 @@ public class CreativeFly extends Check {
|
||||
final ModelFlying model = thisMove.modelFlying;
|
||||
// TODO: Other set back policy for elytra, e.g. not set in narrow spaces?
|
||||
|
||||
// Proactive reset of elytraBoost (MC 1.11.2).
|
||||
if (data.fireworksBoostDuration > 0) {
|
||||
if (!lastMove.valid || lastMove.flyCheck != CheckType.MOVING_CREATIVEFLY
|
||||
|| lastMove.modelFlying != model
|
||||
|| data.fireworksBoostTickExpire < tick ) {
|
||||
data.fireworksBoostDuration = 0;
|
||||
}
|
||||
else {
|
||||
data.fireworksBoostDuration --;
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate some distances.
|
||||
final double yDistance = thisMove.yDistance;
|
||||
final double hDistance = thisMove.hDistance;
|
||||
|
||||
final boolean flying = gameMode == BridgeMisc.GAME_MODE_SPECTATOR || player.isFlying();
|
||||
final boolean sprinting = time <= data.timeSprinting + cc.sprintingGrace;
|
||||
boolean lostground = false;
|
||||
|
||||
// Lost ground, if set so.
|
||||
if (model.getGround()) {
|
||||
@@ -118,21 +118,34 @@ public class CreativeFly extends Check {
|
||||
if (from.isSamePos(to)) {
|
||||
if (lastMove.toIsValid && lastMove.hDistance > 0.0 && lastMove.yDistance < -0.3 // Copy and paste from sf.
|
||||
&& LostGround.lostGroundStill(player, from, to, hDistance, yDistance, sprinting, lastMove, data, cc, tags)) {
|
||||
// Nothing to do.
|
||||
lostground = true;
|
||||
}
|
||||
}
|
||||
else if (LostGround.lostGround(player, from, to, hDistance, yDistance, sprinting, lastMove,
|
||||
data, cc, useBlockChangeTracker ? blockChangeTracker : null, tags)) {
|
||||
// Nothing to do.
|
||||
lostground = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Since still check NoFall on CreativeFly, need to exempt who has slow falling effect
|
||||
if (Bridge1_13.hasSlowfalling() && model.getScaleSlowfallingEffect()) {
|
||||
data.clearNoFallData();
|
||||
} else
|
||||
// Accounting for elytra fall damage
|
||||
if (Bridge1_9.isGlidingWithElytra(player) && thisMove.yDistance > -0.5) {
|
||||
data.clearNoFallData();
|
||||
}
|
||||
|
||||
workaroundSwitchingModel(player, thisMove, lastMove, model, data, cc);
|
||||
|
||||
// Horizontal distance check.
|
||||
double[] resH = hDist(player, from, to, hDistance, yDistance, sprinting, flying, lastMove, time, model, data, cc);
|
||||
double limitH = resH[0];
|
||||
double resultH = resH[1];
|
||||
|
||||
double[] rese = hackElytraH(player, from, to, hDistance, yDistance, thisMove, lastMove, lostground, data, cc);
|
||||
resultH = Math.max(resultH, rese[1]);
|
||||
// Check velocity.
|
||||
if (resultH > 0) {
|
||||
double hFreedom = data.getHorizontalFreedom();
|
||||
@@ -153,13 +166,21 @@ public class CreativeFly extends Check {
|
||||
}
|
||||
|
||||
resultH *= 100.0; // Normalize to % of a block.
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
// Sometimes resultH can be up to 18
|
||||
if (Bridge1_9.isGliding(player) && (Bridge1_13.isRiptiding(player) || data.timeRiptiding + 4000 > now) && resultH<14.0) {
|
||||
resultH = 0.0;
|
||||
}
|
||||
|
||||
if (resultH > 0.0) {
|
||||
tags.add("hdist");
|
||||
}
|
||||
|
||||
// Vertical move.
|
||||
double limitV = 0.0; // Limit.
|
||||
double resultV = 0.0; // Violation (normalized to 100 * 1 block, applies if > 0.0).
|
||||
double resultV = rese[0]; // Violation (normalized to 100 * 1 block, applies if > 0.0).
|
||||
|
||||
// Distinguish checking method by y-direction of the move.
|
||||
if (yDistance > 0.0) {
|
||||
@@ -195,9 +216,28 @@ public class CreativeFly extends Check {
|
||||
}
|
||||
|
||||
resultV *= 100.0; // Normalize to % of a block.
|
||||
// Sometimes resultV can be up to 78
|
||||
if (Bridge1_9.isGliding(player) && (Bridge1_13.isRiptiding(player) || data.timeRiptiding + 4000 > now) && resultV<60.0) {
|
||||
resultV = 0.0;
|
||||
}
|
||||
if (resultV > 0.0) {
|
||||
tags.add("vdist");
|
||||
}
|
||||
if (lastMove.toIsValid && !player.isFlying() && !Double.isInfinite(Bridge1_9.getLevitationAmplifier(player)) && !Bridge1_9.isGlidingWithElytra(player)
|
||||
&& thisMove.modelFlying == lastMove.modelFlying
|
||||
&& !from.isHeadObstructed() && !to.isHeadObstructed()
|
||||
//Exempt check for 20 seconds after joined
|
||||
&& !(now > pData.getLastJoinTime() && pData.getLastJoinTime() + 20000 > now)
|
||||
&& !from.isInLiquid() && !(thisMove.yDistance < 0.0 && lastMove.yDistance - thisMove.yDistance < 0.0001)) {
|
||||
double allowY = (lastMove.yDistance + (0.05D * (Bridge1_9.getLevitationAmplifier(player) + 1) - lastMove.yDistance) * 0.2D) * 0.98;
|
||||
if (lastMove.yDistance < 0.0 && thisMove.yDistance < allowY) {
|
||||
resultV = Math.max(resultV,1.0);
|
||||
tags.add("antilevitate");
|
||||
} else if (from.getY() >= to.getY() && !(thisMove.yDistance == 0.0 && allowY < 0.0)) {
|
||||
resultV = Math.max(resultV,1.0);
|
||||
tags.add("antilevitate");
|
||||
}
|
||||
}
|
||||
|
||||
final double result = Math.max(0.0, resultH) + Math.max(0.0, resultV);
|
||||
|
||||
@@ -312,6 +352,8 @@ public class CreativeFly extends Check {
|
||||
}
|
||||
else {
|
||||
// (Ignore sprinting here).
|
||||
final double attrMod = attributeAccess.getHandle().getSpeedAttributeMultiplier(player);
|
||||
if (attrMod != Double.MAX_VALUE) fSpeed *= attrMod;
|
||||
fSpeed *= data.walkSpeed / Magic.DEFAULT_WALKSPEED;
|
||||
}
|
||||
}
|
||||
@@ -321,6 +363,17 @@ public class CreativeFly extends Check {
|
||||
|
||||
double limitH = model.getHorizontalModSpeed() / 100.0 * ModelFlying.HORIZONTAL_SPEED * fSpeed;
|
||||
|
||||
if (from.isInWater() || to.isInWater()) {
|
||||
if (!Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(player))) {
|
||||
limitH *= Magic.modDolphinsGrace;
|
||||
}
|
||||
}
|
||||
|
||||
if (model.getScaleSlowfallingEffect() && Bridge1_13.hasSlowfalling()) {
|
||||
Double Amplifier = PotionUtil.getPotionEffectAmplifier(from.getPlayer(), PotionEffectType.SPEED);
|
||||
limitH = Double.isInfinite(Amplifier) ? limitH : limitH + 0.1*(Amplifier +1);
|
||||
}
|
||||
|
||||
if (lastMove.toIsValid) {
|
||||
// TODO: Use last friction (as well)?
|
||||
// TODO: Test/adjust more.
|
||||
@@ -379,6 +432,9 @@ public class CreativeFly extends Check {
|
||||
limitV += 0.046 * levitation; // (It ends up like 0.5 added extra for some levels of levitation, roughly.)
|
||||
tags.add("levitation:" + levitation);
|
||||
}
|
||||
} else if (model.getScaleSlowfallingEffect() && Bridge1_13.hasSlowfalling()) {
|
||||
Double Amplifier = PotionUtil.getPotionEffectAmplifier(from.getPlayer(), PotionEffectType.JUMP);
|
||||
limitV += Double.isInfinite(Amplifier) ? 0.5 : 0.5 + 0.1*(Amplifier +1);
|
||||
}
|
||||
|
||||
// Related to elytra.
|
||||
@@ -386,6 +442,9 @@ public class CreativeFly extends Check {
|
||||
// TODO: Better detection of an elytra model (extra flags?).
|
||||
limitV = Math.max(limitV, limitV = hackLytra(yDistance, limitV, thisMove, lastMove, data));
|
||||
}
|
||||
if (Bridge1_9.isGlidingWithElytra(from.getPlayer()) &&
|
||||
(from.isInLiquid() || to.isInLiquid() || data.liqtick > 10)) // recently left water
|
||||
limitV = Math.max(limitV, 0.35);
|
||||
|
||||
if (model.getGravity()) {
|
||||
// Friction with gravity.
|
||||
@@ -394,7 +453,7 @@ public class CreativeFly extends Check {
|
||||
// TODO: Use last friction (as well)?
|
||||
double frictionDist = lastMove.yDistance * Magic.FRICTION_MEDIUM_AIR;
|
||||
if (!flying) {
|
||||
frictionDist -= Magic.GRAVITY_MIN;
|
||||
frictionDist -= 0.019;
|
||||
}
|
||||
if (frictionDist > limitV) {
|
||||
limitV = frictionDist;
|
||||
@@ -442,6 +501,129 @@ public class CreativeFly extends Check {
|
||||
return new double[] {limitV, resultV};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param from
|
||||
* @param to
|
||||
* @param hDistance
|
||||
* @param yDistance
|
||||
* @param thisMove
|
||||
* @param lastMove
|
||||
* @param lostground
|
||||
* @param data
|
||||
* @param player
|
||||
* @return resultH, resultV.
|
||||
*/
|
||||
private double[] hackElytraH(final Player player, final PlayerLocation from, final PlayerLocation to, final double hDistance, final double yDistance, final PlayerMoveData thisMove,
|
||||
final PlayerMoveData lastMove, final boolean lostground, final MovingData data, final MovingConfig cc) {
|
||||
/* Known false positives:
|
||||
* Still have setback with taking off ?
|
||||
* Fall into water
|
||||
* Some random falses with quick rotation ?
|
||||
*/
|
||||
if (!cc.elytraStrict || !Bridge1_9.isGlidingWithElytra(player)) return new double[] {0.0, 0.0};
|
||||
// Gliding in air
|
||||
if (lastMove.toIsValid && lastMove.modelFlying == thisMove.modelFlying && !from.isInLiquid()) {
|
||||
final Vector lookvec = to.getLocation().getDirection();
|
||||
final float f = to.getPitch() * 0.017453292F;
|
||||
final float lastf = lastMove.to.getPitch() * 0.017453292F;
|
||||
final float diff = Math.abs(f - lastf);
|
||||
double allwyDistance = lastMove.yDistance;
|
||||
double allwHDistance = 0.0;
|
||||
final double xzlength = Math.sqrt(lookvec.getX() * lookvec.getX() + lookvec.getZ() * lookvec.getZ());
|
||||
double f4 = Math.cos(f);
|
||||
f4 = f4 * f4;
|
||||
allwyDistance += -0.08D + f4 * 0.06D;
|
||||
double x = 0.0;
|
||||
double z = 0.0;
|
||||
if (allwyDistance < 0.0D) {
|
||||
final double d = allwyDistance * -0.1 * f4;
|
||||
x += lookvec.getX() * d / xzlength;
|
||||
z += lookvec.getZ() * d / xzlength;
|
||||
allwyDistance += d;
|
||||
}
|
||||
|
||||
// Look up
|
||||
if (f < 0.0F) {
|
||||
final double d = lastMove.hDistance * -Math.sin(f) * 0.04;
|
||||
x -= lookvec.getX() * d / xzlength;
|
||||
z -= lookvec.getZ() * d / xzlength;
|
||||
allwyDistance += d * 3.2;
|
||||
}
|
||||
x += lookvec.getX() / (xzlength*0.995) * lastMove.hDistance;
|
||||
z += lookvec.getZ() / (xzlength*0.995) * lastMove.hDistance;
|
||||
|
||||
// Fireworks
|
||||
// Can't be more precise due to some problems, still have ~15% faster bypasses :(
|
||||
if (data.fireworksBoostDuration > 0) {
|
||||
x += lookvec.getX() * 0.1D + (lookvec.getX() * 1.5D - x) * 0.5D;
|
||||
z += lookvec.getZ() * 0.1D + (lookvec.getZ() * 1.5D - z) * 0.5D;
|
||||
// Quick rotation problems
|
||||
if (Math.abs(f) > Math.abs(lastf)) if (diff > 1.9) allwHDistance += (diff - 0.6)/1.4; else allwHDistance += diff/1.4;
|
||||
// Problem with calculating fireworks duration and it end sooner. Speed after boost might be faster a little bit!
|
||||
if (f > 0.0 && f < 1.4 && Math.round(data.fireworksBoostTickNeedCheck / 4) > data.fireworksBoostDuration) allwHDistance += 0.24;
|
||||
allwHDistance += 0.12;
|
||||
// Speed isn't affected by fireworks in first tick
|
||||
if (data.fireworksBoostDuration >= data.fireworksBoostTickNeedCheck) allwHDistance += 0.65;
|
||||
tags.add("fw_speed");
|
||||
}
|
||||
|
||||
//System.out.println(allwyDistance + " " + yDistance + " diff:" + Math.abs(yDistance - allwyDistance * Magic.FRICTION_MEDIUM_AIR) + " diffl:" + diff);
|
||||
if (f > -0.11 && Math.abs(yDistance - allwyDistance * Magic.FRICTION_MEDIUM_AIR) > 0.005
|
||||
// Ignore fireworks, in water, lostground, slow_falling effect, velocity, honey block
|
||||
&& data.fireworksBoostDuration <= 0 && data.liqtick == 0 && !lostground && !data.isVelocityJumpPhase()
|
||||
&& Double.isInfinite(Bridge1_13.getSlowfallingAmplifier(player)) && !isCollideWithHB(from, to)
|
||||
) {
|
||||
tags.add("elytra_v_keep");
|
||||
return new double[] {yDistance == 0.0 ? 0.1 : Math.abs(yDistance), 0.0};
|
||||
}
|
||||
|
||||
// Adjust false
|
||||
allwHDistance += Math.sqrt(x*x +z*z) + (f < -1.37 ? 0.15 : 0.0);
|
||||
allwyDistance += allwyDistance > 0.0 ? 0.002 : (f < -1.37 ? (f < -1.5 ? -0.394 : -0.18) : -0.04);
|
||||
allwyDistance *= Magic.FRICTION_MEDIUM_AIR;
|
||||
|
||||
//System.out.println("f:" + f + " Hdist:" + hDistance + " allow:" + allwHDistance + " yDist:" + yDistance + " allowy:" + allwyDistance + " fwb:" + data.fireworksBoostDuration);
|
||||
if (data.fireworksBoostDuration <= 0) {
|
||||
if (yDistance > 0.0) {
|
||||
if (allwyDistance < yDistance
|
||||
// Inversion (neg -> pos).
|
||||
&& !(yDistance < Magic.GRAVITY_MIN && lastMove.yDistance > -Magic.GRAVITY_MAX - Magic.GRAVITY_MIN && lastMove.yDistance < 0.5 * Magic.GRAVITY_SPAN)) {
|
||||
tags.add("elytra_v_asc");
|
||||
return new double[] {yDistance, 0.0};
|
||||
}
|
||||
} else if (allwyDistance > yDistance
|
||||
// Inversion (neg -> pos , pos -> neg).
|
||||
&& !(allwyDistance > 0.0 && yDistance > -0.25)) {
|
||||
tags.add("elytra_v_desc");
|
||||
return new double[] {Math.abs(yDistance), 0.0};
|
||||
}
|
||||
}
|
||||
if (allwHDistance < hDistance) {
|
||||
tags.add("elytra_h_asc");
|
||||
return new double[] {0.0, hDistance - allwHDistance};
|
||||
}
|
||||
// Gliding in water
|
||||
// TODO: Will add later, look unstable
|
||||
} //else if(from.isInLiquid() && data.liqtick > 35) {
|
||||
// if (data.timeRiptiding + 4000 > System.currentTimeMillis()) return new double[] {0.0, 0.0};
|
||||
// double allwHDistance = Magic.DEFAULT_WALKSPEED * cc.survivalFlyWalkingSpeed / 100D;
|
||||
// if (data.fireworksBoostDuration > 0) allwHDistance = 1.6;
|
||||
// final int level = BridgeEnchant.getDepthStriderLevel(player);
|
||||
// if (level > 0) {
|
||||
// allwHDistance *= Magic.modDepthStrider[level];
|
||||
// }
|
||||
// if (!Double.isInfinite(Bridge1_13.getDolphinGraceAmplifier(player))) allwHDistance *= 4.9;
|
||||
// if (data.fireworksBoostDuration > 0) allwHDistance = Math.max(allwHDistance, 1.8);
|
||||
// System.out.println(thisMove.hDistance + " " + allwHDistance);
|
||||
// if (thisMove.hDistance > allwHDistance) {
|
||||
// tags.add("elytra_hspeed(water)");
|
||||
// return new double[] {0.0, hDistance - allwHDistance};
|
||||
// }
|
||||
// }
|
||||
return new double[] {0.0, 0.0};
|
||||
}
|
||||
|
||||
private double hackLytra(final double yDistance, final double limitV, final PlayerMoveData thisMove, final PlayerMoveData lastMove, final MovingData data) {
|
||||
// TODO: Hack, move / config / something.
|
||||
// TODO: Confine more. hdist change relates to ydist change
|
||||
@@ -559,6 +741,67 @@ public class CreativeFly extends Check {
|
||||
return Math.max(maximumHeight - 10.0, world.getMaxHeight());
|
||||
}
|
||||
|
||||
private void workaroundSwitchingModel(final Player player, final PlayerMoveData thisMove, final PlayerMoveData lastMove, final ModelFlying model, final MovingData data, final MovingConfig cc) {
|
||||
if (lastMove.toIsValid) {
|
||||
// Other modelflying -> levitation
|
||||
// TODO: Better horizontal workaround
|
||||
if (data.bunnyhopTick > 0) data.bunnyhopTick--;
|
||||
if (lastMove.modelFlying != thisMove.modelFlying && thisMove.modelFlying.getScaleLevitationEffect()) {
|
||||
data.addVerticalVelocity(new SimpleEntry(0.0, 2));
|
||||
final double amount = guessFlyNoFlyVelocity(player, data.playerMoves.getCurrentMove(), lastMove, data);
|
||||
data.addHorizontalVelocity(new AccountEntry(amount, 2, MovingData.getHorVelValCount(amount)));
|
||||
data.bunnyhopTick = 20;
|
||||
if (thisMove.yDistance > 0.0) {
|
||||
data.yDis = thisMove.yDistance;
|
||||
data.addVerticalVelocity(new SimpleEntry(data.yDis, 1));
|
||||
} else {
|
||||
data.bunnyhopTick = 21;
|
||||
final double jumpamplifier = PotionUtil.getPotionEffectAmplifier(player, PotionEffectType.JUMP);
|
||||
data.yDis = 0.42 * (1 + 0.24*(Double.isInfinite(jumpamplifier) ? 0.0 : jumpamplifier + 1));
|
||||
data.addVerticalVelocity(new SimpleEntry(data.yDis, 2));
|
||||
}
|
||||
return;
|
||||
} else if (thisMove.modelFlying.getScaleLevitationEffect() && data.bunnyhopTick > 0 && thisMove.yDistance > 0.0 && thisMove.yDistance < data.yDis * 0.95) {
|
||||
if (data.bunnyhopTick == 20) return;
|
||||
data.yDis = (data.yDis + (0.05D * (Bridge1_9.getLevitationAmplifier(player) + 1) - data.yDis) * 0.2D) * Magic.FRICTION_MEDIUM_AIR;
|
||||
data.addVerticalVelocity(new SimpleEntry(thisMove.yDistance, 1));
|
||||
final double levitation = Bridge1_9.getLevitationAmplifier(player);
|
||||
if (thisMove.yDistance < 0.1 + 0.046 * (levitation > 0.0 ? levitation : 0.0)) data.bunnyhopTick = 0;
|
||||
return;
|
||||
} else if (thisMove.yDistance < 0.0) data.bunnyhopTick = 0;
|
||||
|
||||
//Gliding -> Creative
|
||||
if (lastMove.modelFlying != null && lastMove.modelFlying.getVerticalAscendGliding() && thisMove.modelFlying.getId().equals("gamemode.creative")) {
|
||||
final double amount = guessFlyNoFlyVelocity(player, data.playerMoves.getCurrentMove(), lastMove, data);
|
||||
data.addHorizontalVelocity(new AccountEntry(amount, 2, MovingData.getHorVelValCount(amount)));
|
||||
data.addVerticalVelocity(new SimpleEntry(0.0, 2));
|
||||
return;
|
||||
}
|
||||
// TODO: Levitation -> Slow_falling
|
||||
}
|
||||
}
|
||||
private static double guessFlyNoFlyVelocity(final Player player,
|
||||
final PlayerMoveData thisMove, final PlayerMoveData lastMove, final MovingData data) {
|
||||
// Default margin: Allow slightly less than the previous speed.
|
||||
final double defaultAmount = lastMove.hDistance * (1.0 + Magic.FRICTION_MEDIUM_AIR) / 2.0;
|
||||
// Test for exceptions.
|
||||
if (thisMove.hDistance > defaultAmount && Bridge1_9.isWearingElytra(player) && lastMove.modelFlying != null && lastMove.modelFlying.getId().equals(MovingConfig.ID_JETPACK_ELYTRA)) {
|
||||
// Allowing the same speed won't always work on elytra (still increasing, differing modeling on client side with motXYZ).
|
||||
// (Doesn't seem to be overly effective.)
|
||||
final PlayerMoveData secondPastMove = data.playerMoves.getSecondPastMove();
|
||||
if (secondPastMove.modelFlying != null && Magic.glideEnvelopeWithHorizontalGain(thisMove, lastMove, secondPastMove)) {
|
||||
return thisMove.hDistance + Magic.GLIDE_HORIZONTAL_GAIN_MAX;
|
||||
}
|
||||
}
|
||||
return defaultAmount;
|
||||
}
|
||||
|
||||
private boolean isCollideWithHB(PlayerLocation from ,PlayerLocation to) {
|
||||
final boolean a = BlockProperties.collides(to.getBlockCache(), to.getMinX() - 0.1, to.getMinY(), to.getMinZ() - 0.1, to.getMaxX() + 0.1, to.getMaxY(), to.getMaxZ() + 0.1, BlockProperties.F_STICKY) ||
|
||||
BlockProperties.collides(from.getBlockCache(), from.getMinX() - 0.1, from.getMinY(), from.getMinZ() - 0.1, from.getMaxX() + 0.1, from.getMaxY(), from.getMaxZ() + 0.1, BlockProperties.F_STICKY);
|
||||
return a;
|
||||
}
|
||||
|
||||
private void outpuDebugMove(final Player player, final double hDistance, final double limitH,
|
||||
final double yDistance, final double limitV, final ModelFlying model, final List<String> tags,
|
||||
final MovingData data) {
|
||||
@@ -587,4 +830,4 @@ public class CreativeFly extends Check {
|
||||
debug(player, builder.toString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,12 +14,19 @@
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.checks.moving.player;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
@@ -28,9 +35,13 @@ import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.magic.Magic;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.LocationData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeEnchant;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeHealth;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMaterial;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.PlayerLocation;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
/**
|
||||
* A check to see if people cheat by tricking the server to not deal them fall damage.
|
||||
@@ -50,6 +61,7 @@ public class NoFall extends Check {
|
||||
|
||||
/** For temporary use: LocUtil.clone before passing deeply, call setWorld(null) after use. */
|
||||
private final Location useLoc = new Location(null, 0, 0, 0);
|
||||
private final Random random = new Random();
|
||||
|
||||
/**
|
||||
* Instantiates a new no fall check.
|
||||
@@ -84,8 +96,9 @@ public class NoFall extends Check {
|
||||
final IPlayerData pData) {
|
||||
// Damage to be dealt.
|
||||
final float fallDist = (float) getApplicableFallHeight(player, y, previousSetBackY, data);
|
||||
final double maxD = getDamage(fallDist);
|
||||
|
||||
double maxD = getDamage(fallDist);
|
||||
maxD = calcDamagewithfeatherfalling(player, calcReducedDamageByHB(player, maxD));
|
||||
fallOn(player, fallDist);
|
||||
if (maxD >= Magic.FALL_DAMAGE_MINIMUM) {
|
||||
// Check skipping conditions.
|
||||
if (cc.noFallSkipAllowFlight && player.getAllowFlight()) {
|
||||
@@ -109,6 +122,39 @@ public class NoFall extends Check {
|
||||
player.setFallDistance(0);
|
||||
}
|
||||
}
|
||||
|
||||
private void fallOn(final Player player, final double fallDist) {
|
||||
Block block = player.getLocation().subtract(0, 1, 0).getBlock();
|
||||
if (block.getType() == BridgeMaterial.FARMLAND && fallDist > 0.5 && random.nextFloat() < fallDist - 0.5) {
|
||||
final PlayerInteractEvent event = new PlayerInteractEvent(player, Action.PHYSICAL, null, block, BlockFace.SELF);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
//Move up a little bit in order not to stuck in a block
|
||||
player.setVelocity(player.getLocation().getDirection().clone().setY(0.0626).setX(-0.004).setZ(-0.004));
|
||||
block.setType(Material.DIRT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static double calcDamagewithfeatherfalling(Player player, double damage) {
|
||||
if (!Bridge1_13.hasIsSwimming()) return damage;
|
||||
if (BridgeEnchant.hasFeatherFalling() && damage > 0.0) {
|
||||
int levelench = BridgeEnchant.getFeatherFallingLevel(player);
|
||||
if (levelench > 0) {
|
||||
int tmp = levelench * 3;
|
||||
if (tmp > 20) tmp = 20;
|
||||
return damage * (1.0 - tmp / 25.0);
|
||||
}
|
||||
}
|
||||
return damage;
|
||||
}
|
||||
|
||||
/** Calculate the damage was reduced by HoneyBlock */
|
||||
public static double calcReducedDamageByHB(final Player player ,final double damage) {
|
||||
final Material blockmat = player.getLocation().subtract(0, 0.5, 0).getBlock().getType();
|
||||
if ((BlockProperties.getBlockFlags(blockmat) & BlockProperties.F_STICKY) != 0) return Math.round(damage / 5);
|
||||
return damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Estimate the applicable fall height for the given data.
|
||||
|
||||
@@ -27,6 +27,8 @@ import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.ViolationData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.changetracker.BlockChangeTracker;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.collision.Axis;
|
||||
@@ -164,7 +166,8 @@ public class Passable extends Check {
|
||||
rayTracing.loop();
|
||||
rayTracing.setIgnoreInitiallyColliding(false);
|
||||
//rayTracing.setCutOppositeDirectionMargin(false);
|
||||
if (rayTracing.collides() && !player.isSwimming() && !player.isGliding()) {
|
||||
//getEyeHeight() is a way to check isSwimming but not in water
|
||||
if (rayTracing.collides() && !Bridge1_13.isSwimming(player) && !Bridge1_9.isGliding(player) && !(player.getEyeHeight()<0.45)) {
|
||||
tags = "raytracing_collide_";
|
||||
}
|
||||
else if (rayTracing.getStepsDone() >= rayTracing.getMaxSteps()) {
|
||||
|
||||
+635
-112
File diff suppressed because it is too large.
Load diff
@@ -35,6 +35,7 @@ import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.player.PlayerSetBackMethod;
|
||||
import fr.neatmonster.nocheatplus.checks.net.NetData;
|
||||
import fr.neatmonster.nocheatplus.checks.net.model.CountableLocation;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
||||
import fr.neatmonster.nocheatplus.compat.MCAccess;
|
||||
@@ -96,6 +97,7 @@ public class MovingUtil {
|
||||
Double.isInfinite(Bridge1_9.getLevitationAmplifier(player))
|
||||
|| fromLocation.isInLiquid()
|
||||
)
|
||||
&& (Double.isInfinite(Bridge1_13.getSlowfallingAmplifier(player)))
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
+6
-2
@@ -219,6 +219,7 @@ public class VehicleChecks extends CheckListener {
|
||||
debug(player, "onPlayerMoveVehicle: vehicle: " + vehicle);
|
||||
}
|
||||
data.wasInVehicle = true;
|
||||
data.waspreInVehicle = true;
|
||||
data.sfHoverTicks = -1;
|
||||
data.removeAllVelocity();
|
||||
data.sfLowJump = false;
|
||||
@@ -552,7 +553,7 @@ public class VehicleChecks extends CheckListener {
|
||||
vehicleEnvelope.prepareCheckDetails(vehicle, moveInfo, thisMove);
|
||||
// Check.
|
||||
final SetBackEntry tempNewTo = vehicleEnvelope.check(player, vehicle,
|
||||
thisMove, fake, data, cc, pData);
|
||||
thisMove, fake, data, cc, pData, moveInfo);
|
||||
if (tempNewTo != null) {
|
||||
newTo = tempNewTo;
|
||||
}
|
||||
@@ -727,6 +728,9 @@ public class VehicleChecks extends CheckListener {
|
||||
if (debug) {
|
||||
debug(player, "Vehicle enter: first vehicle: " + vehicle.getClass().getName());
|
||||
}
|
||||
|
||||
data.waspreInVehicle = true;
|
||||
|
||||
// Check for nested vehicles.
|
||||
final Entity lastVehicle = passengerUtil.getLastNonPlayerVehicle(vehicle, true);
|
||||
if (lastVehicle == null) {
|
||||
@@ -982,4 +986,4 @@ public class VehicleChecks extends CheckListener {
|
||||
NCPAPIProvider.getNoCheatPlusAPI().getLogManager().debug(Streams.TRACE_FILE, builder.toString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+120
-11
@@ -17,12 +17,18 @@ package fr.neatmonster.nocheatplus.checks.moving.vehicle;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Boat;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Minecart;
|
||||
import org.bukkit.entity.Pig;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import fr.neatmonster.nocheatplus.actions.ParameterName;
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
@@ -36,9 +42,14 @@ import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.VehicleMoveData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.model.VehicleMoveInfo;
|
||||
import fr.neatmonster.nocheatplus.checks.workaround.WRPT;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.PotionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.location.RichEntityLocation;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
/**
|
||||
* Vehicle moving envelope check, for Minecraft 1.9 and higher.
|
||||
@@ -107,7 +118,7 @@ public class VehicleEnvelope extends Check {
|
||||
public SetBackEntry check(final Player player, final Entity vehicle,
|
||||
final VehicleMoveData thisMove, final boolean isFake,
|
||||
final MovingData data, final MovingConfig cc,
|
||||
final IPlayerData pData) {
|
||||
final IPlayerData pData, final VehicleMoveInfo moveInfo) {
|
||||
final boolean debug = pData.isDebugActive(type);
|
||||
// Delegate to a sub-check.
|
||||
tags.clear();
|
||||
@@ -117,7 +128,7 @@ public class VehicleEnvelope extends Check {
|
||||
data.ws.setJustUsedIds(debugDetails); // Add just used workaround ids to this list directly, for now.
|
||||
}
|
||||
final boolean violation = checkEntity(player, vehicle, thisMove, isFake,
|
||||
data, cc, debug);
|
||||
data, cc, debug, moveInfo);
|
||||
if (debug && !debugDetails.isEmpty()) {
|
||||
debugDetails(player);
|
||||
debugDetails.clear();
|
||||
@@ -153,12 +164,14 @@ public class VehicleEnvelope extends Check {
|
||||
debugDetails.clear();
|
||||
}
|
||||
|
||||
private double getHDistCap(final EntityType type, final MovingConfig cc) {
|
||||
private double getHDistCap(final EntityType type, final MovingConfig cc, final VehicleMoveData thisMove) {
|
||||
final Double v = cc.vehicleEnvelopeHorizontalSpeedCap.get(type);
|
||||
if (v == null) {
|
||||
if (type == EntityType.BOAT && (thisMove.from.onIce || thisMove.to.onIce)) return 4.1;
|
||||
return cc.vehicleEnvelopeHorizontalSpeedCap.get(null);
|
||||
}
|
||||
else {
|
||||
if (type == EntityType.BOAT && (thisMove.from.onIce || thisMove.to.onIce)) return v * 2.5;
|
||||
return v;
|
||||
}
|
||||
}
|
||||
@@ -166,11 +179,16 @@ public class VehicleEnvelope extends Check {
|
||||
private boolean checkEntity(final Player player, final Entity vehicle,
|
||||
final VehicleMoveData thisMove, final boolean isFake,
|
||||
final MovingData data, final MovingConfig cc,
|
||||
final boolean debug) {
|
||||
final boolean debug, final VehicleMoveInfo moveInfo) {
|
||||
boolean violation = false;
|
||||
long now = System.currentTimeMillis();
|
||||
if (debug) {
|
||||
debugDetails.add("inair: " + data.sfJumpPhase);
|
||||
}
|
||||
if (isBubbleColumn(moveInfo.from)
|
||||
|| (isBouncingBlock(moveInfo.from) && thisMove.yDistance >= 0.0 && thisMove.yDistance <= 1.0)) {
|
||||
data.timeVehicletoss = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
// Medium dependent checking.
|
||||
|
||||
@@ -178,7 +196,13 @@ public class VehicleEnvelope extends Check {
|
||||
|
||||
// Maximum thinkable horizontal speed.
|
||||
// TODO: Further distinguish, best set in CheckDetails.
|
||||
if (maxDistHorizontal(thisMove, getHDistCap(checkDetails.simplifiedType, cc))) { // Override type for now.
|
||||
if (vehicle instanceof LivingEntity) {
|
||||
Double speed = PotionUtil.getPotionEffectAmplifier((LivingEntity)vehicle, PotionEffectType.SPEED);
|
||||
if (!Double.isInfinite(speed)) {
|
||||
if (maxDistHorizontal(thisMove, getHDistCap(checkDetails.simplifiedType, cc, thisMove) * (1 + 0.2 * (speed+1)))) return true;
|
||||
} else if (maxDistHorizontal(thisMove, getHDistCap(checkDetails.simplifiedType, cc, thisMove) + (checkDetails.canJump ? 0.18 : 0.0))) return true;
|
||||
} else
|
||||
if (maxDistHorizontal(thisMove, getHDistCap(checkDetails.simplifiedType, cc, thisMove))) { // Override type for now.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -252,7 +276,7 @@ public class VehicleEnvelope extends Check {
|
||||
}
|
||||
else if (checkDetails.inAir) {
|
||||
// In-air move.
|
||||
if (checkInAir(thisMove, data, debug)) {
|
||||
if (checkInAir(thisMove, data, debug, vehicle, moveInfo)) {
|
||||
violation = true;
|
||||
}
|
||||
}
|
||||
@@ -268,11 +292,23 @@ public class VehicleEnvelope extends Check {
|
||||
// TODO: At least do something here?
|
||||
}
|
||||
}
|
||||
if (vehicle instanceof LivingEntity) {
|
||||
Double levitation = Bridge1_9.getLevitationAmplifier((LivingEntity)vehicle);
|
||||
if (!Double.isInfinite(levitation)) {
|
||||
checkDetails.maxAscend += 0.046 * (levitation + 1);
|
||||
violation = false;
|
||||
}
|
||||
}
|
||||
// Maximum ascend speed.
|
||||
if (checkDetails.checkAscendMuch && thisMove.yDistance > checkDetails.maxAscend) {
|
||||
tags.add("ascend_much");
|
||||
violation = true;
|
||||
}
|
||||
|
||||
if (data.timeVehicletoss + 2000 > now && thisMove.yDistance < 4.0) {
|
||||
violation = false;
|
||||
}
|
||||
|
||||
// Maximum descend speed.
|
||||
if (checkDetails.checkDescendMuch && thisMove.yDistance < -MagicVehicle.maxDescend) {
|
||||
// TODO: At times it looks like one move is skipped, resulting in double distance ~ -5 and at the same time 'vehicle moved too quickly'.
|
||||
@@ -280,6 +316,61 @@ public class VehicleEnvelope extends Check {
|
||||
tags.add("descend_much");
|
||||
violation = true;
|
||||
}
|
||||
|
||||
if (vehicle instanceof LivingEntity) {
|
||||
final VehicleMoveData firstPastMove = data.vehicleMoves.getFirstPastMove();
|
||||
if (thisMove.hDistance > 0.1D && thisMove.yDistance == 0D && !thisMove.to.onGround && !thisMove.from.onGround
|
||||
&& firstPastMove.valid && firstPastMove.yDistance == 0D
|
||||
&& thisMove.to.inWater && thisMove.from.inWater
|
||||
&& !thisMove.headObstructed // TODO: Might decrease margin here.
|
||||
) {
|
||||
// TODO: Relative hdistance.
|
||||
// TODO: Might check actual bounds (collidesBlock). Might implement + use BlockProperties.getCorrectedBounds or getSomeHeight.
|
||||
violation = true;
|
||||
tags.add("waterwalk");
|
||||
}
|
||||
Block blockUnder = vehicle.getLocation().subtract(0, 0.3, 0).getBlock();
|
||||
Material blockAbove = vehicle.getLocation().add(0, 0.10, 0).getBlock().getType();
|
||||
if (blockUnder != null && blockAbove != null && blockUnder.getType().toString().endsWith("WATER")) {
|
||||
if (blockAbove == Material.AIR) {
|
||||
// hDist and vDist checks, simply checks for horizontal movement with little y distance
|
||||
if (thisMove.hDistance > 0.11D && thisMove.yDistance <= 0.1D && !thisMove.to.onGround && !thisMove.from.onGround
|
||||
&& firstPastMove.valid && firstPastMove.yDistance == thisMove.yDistance || firstPastMove.yDistance == thisMove.yDistance * -1 && firstPastMove.yDistance != 0D
|
||||
&& !thisMove.headObstructed) {
|
||||
// Prevent being flagged if a vehicle transitions from a block to water and the player falls into the water.
|
||||
if (!(thisMove.yDistance < 0 && thisMove.yDistance != 0 && firstPastMove.yDistance < 0 && firstPastMove.yDistance != 0)) {
|
||||
violation = true;
|
||||
tags.add("watermove");
|
||||
}
|
||||
}
|
||||
//Bouncing on water
|
||||
//if (!violation && firstPastMove.valid && !thisMove.to.onGround && !thisMove.from.onGround
|
||||
//&& (thisMove.from.getY() < thisMove.to.getY()) && !(firstPastMove.from.inLiquid && !thisMove.to.inLiquid)
|
||||
//&& !firstPastMove.from.onGround && !thisMove.headObstructed) {
|
||||
// boolean tag = false;
|
||||
// if (Bridge1_13.hasIsSwimming()) {
|
||||
// if (((Levelled)blockUnder.getBlockData()).getLevel() == 0) tag = true;
|
||||
// } else if (blockUnder.getData() == 0) tag = true;
|
||||
// Block blockUnder2 = blockUnder.getRelative(BlockFace.DOWN);
|
||||
// if (checkDetails.canJump) {
|
||||
// if (BlockProperties.isGround(blockUnder2.getType()))
|
||||
// tag = false;
|
||||
// else {
|
||||
// if (BlockProperties.isGround(blockUnder2.getRelative(BlockFace.EAST).getType())
|
||||
// || BlockProperties.isGround(blockUnder2.getRelative(BlockFace.WEST).getType())
|
||||
// || BlockProperties.isGround(blockUnder2.getRelative(BlockFace.NORTH).getType())
|
||||
// || BlockProperties.isGround(blockUnder2.getRelative(BlockFace.SOUTH).getType())
|
||||
// ) tag = false;
|
||||
// }
|
||||
// }
|
||||
// if (tag) {
|
||||
// violation = true;
|
||||
// tags.add("waterjump");
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!violation) {
|
||||
// No violation.
|
||||
@@ -305,6 +396,15 @@ public class VehicleEnvelope extends Check {
|
||||
|
||||
return violation;
|
||||
}
|
||||
|
||||
private boolean isBouncingBlock(RichEntityLocation from) {
|
||||
return BlockProperties.collides(from.getBlockCache(), from.getMinX(), from.getMinY() - 1.0, from.getMinZ(), from.getMaxX(), from.getMaxY(), from.getMaxZ(), BlockProperties.F_BOUNCE25);
|
||||
}
|
||||
|
||||
private boolean isBubbleColumn(RichEntityLocation from) {
|
||||
if (!Bridge1_13.hasIsSwimming()) return false;
|
||||
return BlockProperties.collidesId(from.getBlockCache(), from.getMinX(), from.getMinY(), from.getMinZ(), from.getMaxX(), from.getMaxY(), from.getMaxZ(), Material.BUBBLE_COLUMN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare checkDetails according to vehicle-specific interpretation of side
|
||||
@@ -359,7 +459,7 @@ public class VehicleEnvelope extends Check {
|
||||
// Generic settings.
|
||||
// (maxAscend is not checked for stepping up blocks)
|
||||
if (checkDetails.canJump) {
|
||||
checkDetails.maxAscend = 1.0; // Coarse envelope. Actual lift off gain should be checked on demand.
|
||||
checkDetails.maxAscend = 1.2; // Coarse envelope. Actual lift off gain should be checked on demand.
|
||||
}
|
||||
// Climbable
|
||||
if (checkDetails.canClimb) {
|
||||
@@ -381,7 +481,9 @@ public class VehicleEnvelope extends Check {
|
||||
* @return
|
||||
*/
|
||||
private boolean checkInAir(final VehicleMoveData thisMove, final MovingData data,
|
||||
final boolean debug) {
|
||||
final boolean debug, final Entity vehicle, final VehicleMoveInfo moveInfo) {
|
||||
final RichEntityLocation from = moveInfo.from;
|
||||
final RichEntityLocation to = moveInfo.to;
|
||||
|
||||
// TODO: Distinguish sfJumpPhase and inAirDescendCount (after reaching the highest point).
|
||||
|
||||
@@ -417,8 +519,11 @@ public class VehicleEnvelope extends Check {
|
||||
final double maxDescend = getInAirMaxDescend(thisMove, data);
|
||||
if (data.sfJumpPhase > (checkDetails.canJump ? MagicVehicle.maxJumpPhaseAscend : 1)
|
||||
&& thisMove.yDistance > Math.max(minDescend, -checkDetails.gravityTargetSpeed)) {
|
||||
tags.add("slow_fall_vdist");
|
||||
violation = true;
|
||||
if (ColliesHoneyBlock(from)) data.sfJumpPhase = 5; else
|
||||
if (!(vehicle instanceof LivingEntity && !Double.isInfinite(Bridge1_13.getSlowfallingAmplifier((LivingEntity)vehicle)))) {
|
||||
tags.add("slow_fall_vdist");
|
||||
violation = true;
|
||||
}
|
||||
}
|
||||
// Fast falling (vdist).
|
||||
else if (data.sfJumpPhase > 1 && thisMove.yDistance < maxDescend) {
|
||||
@@ -466,5 +571,9 @@ public class VehicleEnvelope extends Check {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean ColliesHoneyBlock(RichEntityLocation from) {
|
||||
return BlockProperties.collides(from.getBlockCache(), from.getMinX() - 0.1, from.getMinY(), from.getMinZ() - 0.1, from.getMaxX() + 0.1, from.getMaxY() + 0.3, from.getMaxZ() + 0.1, BlockProperties.F_STICKY);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ 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.checks.combined.Improbable;
|
||||
import fr.neatmonster.nocheatplus.players.IPlayerData;
|
||||
import fr.neatmonster.nocheatplus.utilities.TickTask;
|
||||
|
||||
@@ -95,7 +96,10 @@ public class AttackFrequency extends Check {
|
||||
cancel = true;
|
||||
}
|
||||
// Feed Improbable.
|
||||
TickTask.requestImprobableUpdate(player.getUniqueId(), 2f);
|
||||
if (cc.attackFrequencyImprobableWeight > 0.0f) {
|
||||
TickTask.requestImprobableUpdate(player.getUniqueId(), cc.attackFrequencyImprobableWeight);
|
||||
}
|
||||
// TickTask.requestImprobableUpdate(player.getUniqueId(), 2f);
|
||||
}
|
||||
|
||||
return cancel;
|
||||
|
||||
@@ -39,6 +39,7 @@ public class NetConfig extends ACheckConfig {
|
||||
Permissions.NET_FLYINGFREQUENCY,
|
||||
Permissions.NET_KEEPALIVEFREQUENCY,
|
||||
Permissions.NET_PACKETFREQUENCY,
|
||||
Permissions.NET_WRONGTURN,
|
||||
};
|
||||
|
||||
public static RegisteredPermission[] getPreferKeepUpdatedPermissions() {
|
||||
@@ -55,6 +56,7 @@ public class NetConfig extends ACheckConfig {
|
||||
public final float attackFrequencyLimitSecondsTwo;
|
||||
public final float attackFrequencyLimitSecondsFour;
|
||||
public final float attackFrequencyLimitSecondsEight;
|
||||
public final float attackFrequencyImprobableWeight;
|
||||
public final ActionList attackFrequencyActions;
|
||||
|
||||
public final int flyingFrequencySeconds;
|
||||
@@ -65,11 +67,13 @@ public class NetConfig extends ACheckConfig {
|
||||
public final ActionList flyingFrequencyRedundantActions;
|
||||
|
||||
public final ActionList keepAliveFrequencyActions;
|
||||
public final int keepAliveFrequencyStartupDelay;
|
||||
public final int keepAliveFrequencyStartupDelay;
|
||||
|
||||
public final float packetFrequencyPacketsPerSecond;
|
||||
public final int packetFrequencySeconds;
|
||||
public final ActionList packetFrequencyActions;
|
||||
|
||||
public final ActionList wrongTurnActions;
|
||||
|
||||
/** Maximum distance for lightning effects (squared). */
|
||||
public final double soundDistanceSq;
|
||||
@@ -88,8 +92,9 @@ public class NetConfig extends ACheckConfig {
|
||||
attackFrequencyLimitSecondsTwo = config.getInt(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_TWO);
|
||||
attackFrequencyLimitSecondsFour= config.getInt(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_FOUR);
|
||||
attackFrequencyLimitSecondsEight = config.getInt(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_EIGHT);
|
||||
attackFrequencyImprobableWeight = (float) config.getDouble(ConfPaths.NET_ATTACKFREQUENCY_IMPROBABLE_WEIGHT);
|
||||
attackFrequencyActions = config.getOptimizedActionList(ConfPaths.NET_ATTACKFREQUENCY_ACTIONS, Permissions.NET_ATTACKFREQUENCY);
|
||||
|
||||
|
||||
flyingFrequencySeconds = Math.max(1, globalConfig.getInt(ConfPaths.NET_FLYINGFREQUENCY_SECONDS));
|
||||
flyingFrequencyPPS = Math.max(1.0, globalConfig.getDouble(ConfPaths.NET_FLYINGFREQUENCY_PACKETSPERSECOND));
|
||||
flyingFrequencyActions = config.getOptimizedActionList(ConfPaths.NET_FLYINGFREQUENCY_ACTIONS, Permissions.NET_FLYINGFREQUENCY);
|
||||
@@ -99,7 +104,7 @@ public class NetConfig extends ACheckConfig {
|
||||
flyingFrequencyRedundantActions = config.getOptimizedActionList(ConfPaths.NET_FLYINGFREQUENCY_REDUNDANT_ACTIONS, Permissions.NET_FLYINGFREQUENCY);
|
||||
|
||||
keepAliveFrequencyActions = config.getOptimizedActionList(ConfPaths.NET_KEEPALIVEFREQUENCY_ACTIONS, Permissions.NET_KEEPALIVEFREQUENCY);
|
||||
keepAliveFrequencyStartupDelay = config.getInt(ConfPaths.NET_KEEPALIVEFREQUENCY_SECONDS) * 1000;
|
||||
keepAliveFrequencyStartupDelay = config.getInt(ConfPaths.NET_KEEPALIVEFREQUENCY_SECONDS) * 1000;
|
||||
|
||||
if (ServerVersion.compareMinecraftVersion("1.9") >= 0) {
|
||||
// TODO: Disable packet frequency or activate 'pessimistically'.
|
||||
@@ -109,6 +114,8 @@ public class NetConfig extends ACheckConfig {
|
||||
packetFrequencyPacketsPerSecond = config.getInt(ConfPaths.NET_PACKETFREQUENCY_PPS);
|
||||
packetFrequencySeconds = config.getInt(ConfPaths.NET_PACKETFREQUENCY_SECONDS);
|
||||
packetFrequencyActions = config.getOptimizedActionList(ConfPaths.NET_PACKETFREQUENCY_ACTIONS, Permissions.NET_PACKETFREQUENCY);
|
||||
|
||||
wrongTurnActions = config.getOptimizedActionList(ConfPaths.NET_WRONGTURN_ACTIONS, Permissions.NET_WRONGTURN);
|
||||
|
||||
double dist = config.getDouble(ConfPaths.NET_SOUNDDISTANCE_MAXDISTANCE);
|
||||
soundDistanceSq = dist * dist;
|
||||
|
||||
@@ -47,6 +47,7 @@ public class NetData extends ACheckData {
|
||||
public boolean flyingFrequencyOnGround = false;
|
||||
public long flyingFrequencyTimeOnGround = 0L;
|
||||
public long flyingFrequencyTimeNotOnGround = 0L;
|
||||
public double diffpacketVLs = 0;
|
||||
/**
|
||||
* Monitors redundant packets, when more than 20 packets per second are
|
||||
* sent. Use System.currentTimeMillis() for time.
|
||||
@@ -59,6 +60,9 @@ public class NetData extends ACheckData {
|
||||
* time of the last event. System.currentTimeMillis() is used.
|
||||
*/
|
||||
public ActionFrequency keepAliveFreq = new ActionFrequency(20, 1000);
|
||||
|
||||
// Wrong Turn
|
||||
public double wrongTurnVL = 0;
|
||||
|
||||
// Shared.
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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.net;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
|
||||
public class WrongTurn extends Check {
|
||||
|
||||
public WrongTurn() {
|
||||
super(CheckType.NET_WRONGTURN);
|
||||
}
|
||||
|
||||
public boolean check(final Player player, final float pitch, final NetData data, final NetConfig cc) {
|
||||
boolean cancel = false;
|
||||
|
||||
if (Math.abs(pitch) > 90.0 || pitch < -90.0) {
|
||||
data.wrongTurnVL++;
|
||||
|
||||
if (executeActions(player, data.wrongTurnVL, 1, cc.wrongTurnActions).willCancel()) {
|
||||
cancel = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return cancel;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.PotionUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
|
||||
public class Bridge1_13 {
|
||||
private static final PotionEffectType SLOWFALLING = PotionEffectType.getByName("SLOW_FALLING");
|
||||
private static final PotionEffectType DOLPHINSGRACE = PotionEffectType.getByName("DOLPHINS_GRACE");
|
||||
private static final boolean hasIsRiptiding = ReflectionUtil.getMethodNoArgs(Player.class, "isRiptiding", boolean.class) != null;
|
||||
private static final boolean hasIsSwimming = ReflectionUtil.getMethodNoArgs(Player.class, "isSwimming", boolean.class) != null;
|
||||
|
||||
public static boolean hasSlowfalling() {
|
||||
return SLOWFALLING != null;
|
||||
}
|
||||
|
||||
public static boolean hasDolphinGrace() {
|
||||
return DOLPHINSGRACE != null;
|
||||
}
|
||||
|
||||
public static boolean hasIsRiptiding() {
|
||||
return hasIsRiptiding;
|
||||
}
|
||||
|
||||
public static boolean hasIsSwimming() {
|
||||
return hasIsSwimming;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for the 'slowfalling' potion effect.
|
||||
*
|
||||
* @param player
|
||||
* @return Double.NEGATIVE_INFINITY if not present.
|
||||
*/
|
||||
public static double getSlowfallingAmplifier(final Player player) {
|
||||
if (SLOWFALLING == null) {
|
||||
return Double.NEGATIVE_INFINITY;
|
||||
}
|
||||
return PotionUtil.getPotionEffectAmplifier(player, SLOWFALLING);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for the 'slowfalling' potion effect.
|
||||
*
|
||||
* @param LivingEntity
|
||||
* @return Double.NEGATIVE_INFINITY if not present.
|
||||
*/
|
||||
public static double getSlowfallingAmplifier(final LivingEntity entity) {
|
||||
if (SLOWFALLING == null) {
|
||||
return Double.NEGATIVE_INFINITY;
|
||||
}
|
||||
return PotionUtil.getPotionEffectAmplifier(entity, SLOWFALLING);
|
||||
}
|
||||
|
||||
public static double getDolphinGraceAmplifier(final Player player) {
|
||||
if (DOLPHINSGRACE == null) {
|
||||
return Double.NEGATIVE_INFINITY;
|
||||
}
|
||||
return PotionUtil.getPotionEffectAmplifier(player, DOLPHINSGRACE);
|
||||
}
|
||||
|
||||
public static boolean isRiptiding(final Player player) {
|
||||
return hasIsRiptiding ? player.isRiptiding() : false;
|
||||
}
|
||||
|
||||
public static boolean isSwimming(final Player player) {
|
||||
return hasIsSwimming ? player.isSwimming() : false;
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
package fr.neatmonster.nocheatplus.compat;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
@@ -83,6 +84,19 @@ public class Bridge1_9 {
|
||||
}
|
||||
return PotionUtil.getPotionEffectAmplifier(player, LEVITATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for the 'levitation' potion effect.
|
||||
*
|
||||
* @param player
|
||||
* @return Double.NEGATIVE_INFINITY if not present.
|
||||
*/
|
||||
public static double getLevitationAmplifier(final LivingEntity entity) {
|
||||
if (LEVITATION == null) {
|
||||
return Double.NEGATIVE_INFINITY;
|
||||
}
|
||||
return PotionUtil.getPotionEffectAmplifier(entity, LEVITATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gliding + wearing elytra.
|
||||
|
||||
@@ -35,6 +35,10 @@ public final class BridgeEnchant {
|
||||
private final static Enchantment DEPTH_STRIDER = parseEnchantment("DEPTH_STRIDER");
|
||||
|
||||
private final static Enchantment THORNS = parseEnchantment("THORNS");
|
||||
|
||||
private final static Enchantment RIPTIDE = parseEnchantment("RIPTIDE");
|
||||
|
||||
private final static Enchantment FEATHER_FALLING = parseEnchantment("PROTECTION_FALL");
|
||||
|
||||
/**
|
||||
* Retrieve the maximum level for an enchantment, present in armor slots.
|
||||
@@ -90,6 +94,10 @@ public final class BridgeEnchant {
|
||||
public static boolean hasDepthStrider() {
|
||||
return DEPTH_STRIDER != null;
|
||||
}
|
||||
|
||||
public static boolean hasFeatherFalling() {
|
||||
return FEATHER_FALLING != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the player might return some damage due to the "thorns"
|
||||
@@ -102,6 +110,17 @@ public final class BridgeEnchant {
|
||||
return hasArmor(player, THORNS);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return Maximum level of FEATHER_FALLING found on armor items, capped at 4.
|
||||
* Will return 0 if not available.
|
||||
*/
|
||||
public static int getFeatherFallingLevel(final Player player) {
|
||||
// Cap at three.
|
||||
return Math.min(4, getMaxLevelArmor(player, FEATHER_FALLING));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
@@ -112,5 +131,34 @@ public final class BridgeEnchant {
|
||||
// Cap at three.
|
||||
return Math.min(3, getMaxLevelArmor(player, DEPTH_STRIDER));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the maximum level for an enchantment, present in main and off hand slot.
|
||||
*
|
||||
* @param player
|
||||
* @param enchantment
|
||||
* If null, 0 will be returned.
|
||||
* @return 0 if none found, or the maximum found.
|
||||
*/
|
||||
private static int getTrident(final Player player, final Enchantment enchantment) {
|
||||
if (enchantment == null) {
|
||||
return 0;
|
||||
}
|
||||
int level = 0;
|
||||
// Find the maximum level for the given enchantment.
|
||||
final ItemStack mainhand = player.getInventory().getItemInMainHand();
|
||||
final ItemStack offhand = player.getInventory().getItemInOffHand();
|
||||
if (mainhand.getType().toString().equals("TRIDENT")) {
|
||||
return Math.max(mainhand.getEnchantmentLevel(enchantment), level);
|
||||
}
|
||||
if (offhand.getType().toString().equals("TRIDENT")) {
|
||||
level = Math.max(offhand.getEnchantmentLevel(enchantment), level);
|
||||
}
|
||||
return level;
|
||||
}
|
||||
|
||||
public static int getRiptideLevel(final Player player) {
|
||||
return Math.min(3, getTrident(player, RIPTIDE));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -276,7 +276,7 @@ public class BridgeMaterial {
|
||||
"repeating_command_block", "command_repeating");
|
||||
|
||||
/** Sign block. */
|
||||
public static final Material SIGN = getFirstNotNull("sign_post", "sign");
|
||||
public static final Material SIGN = getFirstNotNull("acacia_sign", "birch_sign", "dark_oak_sign", "jungle_sign", "oak_sign", "spruce_sign", "acacia_wall_sign", "birch_wall_sign", "dark_oak_wall_sign", "jungle_wall_sign", "oak_wall_sign", "spruce_wall_sign", "sign_post", "sign", "wall_sign");
|
||||
|
||||
/** Some skull for reference. */
|
||||
public static final Material SKELETON_SKULL = getFirst("skeleton_skull", "skull");
|
||||
@@ -291,6 +291,8 @@ public class BridgeMaterial {
|
||||
"stone_brick_stairs", "smooth_stairs");
|
||||
public static final Material STONE_PRESSURE_PLATE = getFirstNotNull(
|
||||
"stone_pressure_plate", "stone_plate");
|
||||
public static final Material WOODEN_PRESSURE_PLATE = getFirstNotNull(
|
||||
"wooden_pressure_plate", "wood_plate", "acacia_pressure_plate", "birch_pressure_plate", "dark_oak_pressure_plate", "jungle_pressure_plate", "oak_pressure_plate", "spruce_pressure_plate");
|
||||
public static final Material STONE_SLAB = getFirstNotNull("stone_slab", "step");
|
||||
|
||||
public static final Material SUGAR_CANE = getFirstNotNull("sugar_cane_block", "sugar_cane"); // Reversed
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class BlocksMC1_10 implements BlockPropertiesSetup {
|
||||
@Override
|
||||
public void setupBlockProperties(WorldConfigProvider<?> worldConfigProvider) {
|
||||
// 213 MAGMA
|
||||
BlockInit.setAs(BridgeMaterial.MAGMA_BLOCK, BridgeMaterial.STONE_PRESSURE_PLATE);
|
||||
BlockInit.setAs(BridgeMaterial.MAGMA_BLOCK, BridgeMaterial.MAGMA_BLOCK);
|
||||
// 214 NETHER_WART_BLOCK
|
||||
BlockInit.setAs("NETHER_WART_BLOCK", BridgeMaterial.SKELETON_SKULL);
|
||||
// 215 RED_NETHER_BRICK
|
||||
|
||||
+19
-1
@@ -36,7 +36,11 @@ public class BlocksMC1_13 implements BlockPropertiesSetup {
|
||||
|
||||
@Override
|
||||
public void setupBlockProperties(WorldConfigProvider<?> worldConfigProvider) {
|
||||
|
||||
// Add flag for anvil
|
||||
BlockFlags.addFlags("ANVIL", BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_GROUND);
|
||||
// Change flag for walls
|
||||
BlockFlags.addFlags("COBBLESTONE_WALL", BlockProperties.F_THICK_FENCE2);
|
||||
BlockFlags.removeFlags("COBBLESTONE_WALL", BlockProperties.F_THICK_FENCE);
|
||||
// Void air.
|
||||
BlockInit.setAs("VOID_AIR", Material.AIR);
|
||||
// Cave air.
|
||||
@@ -75,6 +79,12 @@ public class BlocksMC1_13 implements BlockPropertiesSetup {
|
||||
// Shulker boxes.
|
||||
for (Material mat : MaterialUtil.SHULKER_BOXES) {
|
||||
BlockFlags.addFlags(mat, BlockProperties.F_XZ100 | BlockFlags.SOLID_GROUND);
|
||||
BlockProperties.setBlockProps(mat, new BlockProps(BlockProperties.woodPickaxe, 2,
|
||||
BlockProperties.secToMs(3.0, 1.45, 0.7, 0.45, 0.35, 0.2)));
|
||||
}
|
||||
|
||||
for (Material mat : MaterialUtil.INFESTED_BLOCKS) {
|
||||
BlockProperties.setBlockProps(mat, BlockProperties.instantType);
|
||||
}
|
||||
|
||||
// Stone types.
|
||||
@@ -97,6 +107,10 @@ public class BlocksMC1_13 implements BlockPropertiesSetup {
|
||||
|
||||
// Red sand.
|
||||
BlockInit.setAs("RED_SAND", Material.SAND);
|
||||
|
||||
// Sea Grass.
|
||||
BlockInit.setAs("SEAGRASS", Material.SEAGRASS);
|
||||
BlockInit.setAs("TALL_SEAGRASS", Material.TALL_SEAGRASS);
|
||||
|
||||
// Sandstone slabs.
|
||||
BlockInit.setPropsAs("SANDSTONE_SLAB", Material.SANDSTONE);
|
||||
@@ -163,6 +177,10 @@ public class BlocksMC1_13 implements BlockPropertiesSetup {
|
||||
|
||||
// Conduit.
|
||||
BlockProperties.setBlockProps("CONDUIT", BlockProperties.woodDoorType);
|
||||
|
||||
// Sea Pickle.
|
||||
BlockProperties.setBlockProps("SEA_PICKLE", BlockProperties.instantType);
|
||||
BlockFlags.addFlags("SEA_PICKLE", BlockProperties.F_GROUND | BlockProperties.F_GROUND_HEIGHT);
|
||||
|
||||
// Turtle egg.
|
||||
BlockProperties.setBlockProps("TURTLE_EGG", new BlockProps(
|
||||
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
package fr.neatmonster.nocheatplus.compat.blocks.init.vanilla;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMaterial;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.BlockPropertiesSetup;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.init.BlockInit;
|
||||
import fr.neatmonster.nocheatplus.config.WorldConfigProvider;
|
||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockFlags;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
public class BlocksMC1_14 implements BlockPropertiesSetup{
|
||||
|
||||
public BlocksMC1_14() {
|
||||
BlockInit.assertMaterialExists("LECTERN");
|
||||
BlockInit.assertMaterialExists("STONECUTTER");
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void setupBlockProperties(WorldConfigProvider<?> worldConfigProvider) {
|
||||
// TODO Auto-generated method stub
|
||||
BlockFlags.addFlags("VINE", BlockProperties.F_CLIMBUPABLE);
|
||||
final long stepFlags = BlockProperties.F_GROUND | BlockProperties.F_XZ100 | BlockProperties.F_GROUND_HEIGHT;
|
||||
final long wall = BlockProperties.F_VARIABLE | BlockProperties.F_GROUND | BlockProperties.F_HEIGHT150 | BlockProperties.F_THICK_FENCE2;
|
||||
final BlockProperties.BlockProps instant = BlockProperties.instantType;
|
||||
BlockInit.setPropsAs("END_STONE_BRICK_WALL", BridgeMaterial.END_STONE_BRICKS);
|
||||
BlockFlags.addFlags("END_STONE_BRICK_WALL", wall);
|
||||
BlockInit.setPropsAs("END_STONE_BRICK_STAIRS", BridgeMaterial.END_STONE_BRICKS);
|
||||
BlockFlags.setFlagsAs("END_STONE_BRICK_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setPropsAs("END_STONE_BRICK_SLAB", BridgeMaterial.END_STONE_BRICKS);
|
||||
BlockFlags.addFlags("END_STONE_BRICK_SLAB", stepFlags);
|
||||
|
||||
BlockInit.setPropsAs("SANDSTONE_WALL", Material.SANDSTONE);
|
||||
BlockFlags.addFlags("SANDSTONE_WALL", wall);
|
||||
BlockInit.setPropsAs("SANDSTONE_STAIRS", Material.SANDSTONE);
|
||||
BlockFlags.setFlagsAs("SANDSTONE_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setPropsAs("SMOOTH_SANDSTONE_SLAB", Material.SANDSTONE);
|
||||
BlockFlags.addFlags("SMOOTH_SANDSTONE_SLAB", stepFlags);
|
||||
BlockInit.setPropsAs("CUT_SANDSTONE_SLAB", Material.SANDSTONE);
|
||||
BlockFlags.addFlags("CUT_SANDSTONE_SLAB", stepFlags);
|
||||
BlockInit.setPropsAs("SMOOTH_SANDSTONE_STAIRS", Material.SANDSTONE);
|
||||
BlockFlags.setFlagsAs("SMOOTH_SANDSTONE_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setPropsAs("RED_SANDSTONE_WALL", Material.SANDSTONE);
|
||||
BlockFlags.addFlags("RED_SANDSTONE_WALL", wall);
|
||||
BlockInit.setPropsAs("RED_SANDSTONE_STAIRS", Material.SANDSTONE);
|
||||
BlockFlags.setFlagsAs("RED_SANDSTONE_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setPropsAs("SMOOTH_RED_SANDSTONE_STAIRS", Material.SANDSTONE);
|
||||
BlockFlags.setFlagsAs("SMOOTH_RED_SANDSTONE_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setPropsAs("SMOOTH_RED_SANDSTONE_SLAB", Material.SANDSTONE);
|
||||
BlockFlags.addFlags("SMOOTH_RED_SANDSTONE_SLAB", stepFlags);
|
||||
BlockInit.setPropsAs("CUT_RED_SANDSTONE_SLAB", Material.SANDSTONE);
|
||||
BlockFlags.addFlags("CUT_RED_SANDSTONE_SLAB", stepFlags);
|
||||
|
||||
BlockInit.setAs("RED_NETHER_BRICK_WALL", BridgeMaterial.COBBLESTONE_WALL);
|
||||
BlockInit.setAs("RED_NETHER_BRICK_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setAs("RED_NETHER_BRICK_SLAB", BridgeMaterial.STONE_SLAB);
|
||||
BlockFlags.addFlags("RED_NETHER_BRICK_SLAB", stepFlags);
|
||||
BlockInit.setAs("NETHER_BRICK_WALL", BridgeMaterial.COBBLESTONE_WALL);
|
||||
BlockInit.setAs("MOSSY_STONE_BRICK_WALL", BridgeMaterial.COBBLESTONE_WALL);
|
||||
BlockInit.setAs("MOSSY_STONE_BRICK_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setAs("MOSSY_STONE_BRICK_SLAB", BridgeMaterial.STONE_SLAB);
|
||||
BlockFlags.addFlags("MOSSY_STONE_BRICK_SLAB", stepFlags);
|
||||
BlockInit.setAs("STONE_BRICK_WALL", BridgeMaterial.COBBLESTONE_WALL);
|
||||
BlockInit.setAs("MOSSY_COBBLESTONE_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setAs("MOSSY_COBBLESTONE_SLAB", BridgeMaterial.STONE_SLAB);
|
||||
BlockFlags.addFlags("MOSSY_COBBLESTONE_SLAB", stepFlags);
|
||||
BlockInit.setAs("PRISMARINE_WALL", BridgeMaterial.COBBLESTONE_WALL);
|
||||
BlockInit.setAs("GRANITE_WALL", BridgeMaterial.COBBLESTONE_WALL);
|
||||
BlockInit.setAs("GRANITE_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setAs("POLISHED_GRANITE_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setAs("GRANITE_SLAB", BridgeMaterial.STONE_SLAB);
|
||||
BlockInit.setAs("POLISHED_GRANITE_SLAB", BridgeMaterial.STONE_SLAB);
|
||||
BlockFlags.addFlags("GRANITE_SLAB", stepFlags);
|
||||
BlockFlags.addFlags("POLISHED_GRANITE_SLAB", stepFlags);
|
||||
BlockInit.setAs("DIORITE_WALL", BridgeMaterial.COBBLESTONE_WALL);
|
||||
BlockInit.setAs("DIORITE_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setAs("POLISHED_DIORITE_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setAs("DIORITE_SLAB", BridgeMaterial.STONE_SLAB);
|
||||
BlockInit.setAs("POLISHED_DIORITE_SLAB", BridgeMaterial.STONE_SLAB);
|
||||
BlockFlags.addFlags("DIORITE_SLAB", stepFlags);
|
||||
BlockFlags.addFlags("POLISHED_DIORITE_SLAB", stepFlags);
|
||||
BlockInit.setAs("ANDESITE_WALL", BridgeMaterial.COBBLESTONE_WALL);
|
||||
BlockInit.setAs("ANDESITE_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setAs("POLISHED_ANDESITE_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setAs("ANDESITE_SLAB", BridgeMaterial.STONE_SLAB);
|
||||
BlockInit.setAs("POLISHED_ANDESITE_SLAB", BridgeMaterial.STONE_SLAB);
|
||||
BlockFlags.addFlags("ANDESITE_SLAB", stepFlags);
|
||||
BlockFlags.addFlags("POLISHED_ANDESITE_SLAB", stepFlags);
|
||||
BlockInit.setAs("BRICK_WALL", BridgeMaterial.COBBLESTONE_WALL);
|
||||
BlockInit.setAs("STONE_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setAs("SMOOTH_QUARTZ_STAIRS", BridgeMaterial.STONE_BRICK_STAIRS);
|
||||
BlockInit.setAs("SMOOTH_STONE_SLAB", BridgeMaterial.STONE_SLAB);
|
||||
BlockInit.setAs("SMOOTH_QUARTZ_SLAB", BridgeMaterial.STONE_SLAB);
|
||||
BlockFlags.addFlags("SMOOTH_STONE_SLAB", stepFlags);
|
||||
BlockFlags.addFlags("SMOOTH_QUARTZ_SLAB", stepFlags);
|
||||
|
||||
BlockInit.setAs("LOOM", BridgeMaterial.CRAFTING_TABLE);
|
||||
BlockInit.setAs("FLETCHING_TABLE", BridgeMaterial.CRAFTING_TABLE);
|
||||
BlockInit.setAs("SMITHING_TABLE", BridgeMaterial.CRAFTING_TABLE);
|
||||
BlockInit.setAs("CARTOGRAPHY_TABLE", BridgeMaterial.CRAFTING_TABLE);
|
||||
BlockInit.setAs("JIGSAW", BridgeMaterial.COMMAND_BLOCK);
|
||||
BlockInit.setAs("BLAST_FURNACE", Material.FURNACE);
|
||||
BlockInit.setAs("SMOKER", Material.FURNACE);
|
||||
BlockProperties.setBlockProps("COMPOSTER", new BlockProperties.BlockProps(BlockProperties.woodAxe, 0.7f, BlockProperties.secToMs(1.1, 0.5, 0.2, 0.15, 0.1, 0.05)));
|
||||
BlockFlags.addFlags("COMPOSTER", BlockFlags.SOLID_GROUND | BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_MIN_HEIGHT8_1);
|
||||
BlockInit.setAs("LECTERN", Material.OAK_PLANKS);
|
||||
BlockFlags.addFlags("LECTERN", BlockProperties.F_MIN_HEIGHT8_1 | BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_GROUND);
|
||||
BlockInit.setAs("BARREL", Material.OAK_PLANKS);
|
||||
BlockProperties.setBlockProps("SCAFFOLDING", instant);
|
||||
BlockFlags.addFlags("SCAFFOLDING", BlockProperties.F_IGN_PASSABLE);
|
||||
BlockFlags.addFlags("SCAFFOLDING", BlockProperties.F_GROUND | BlockProperties.F_GROUND_HEIGHT);
|
||||
BlockFlags.addFlags("SCAFFOLDING", BlockProperties.F_CLIMBABLE);
|
||||
BlockProperties.setBlockProps("STONECUTTER", new BlockProperties.BlockProps(BlockProperties.woodPickaxe, 6.0f, BlockProperties.secToMs(17.0, 2.8, 1.8, 0.7, 0.8, 0.5)));
|
||||
BlockFlags.addFlags("STONECUTTER", BlockProperties.F_MIN_HEIGHT16_9 | BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_GROUND);
|
||||
BlockProperties.setBlockProps("BAMBOO", new BlockProperties.BlockProps(BlockProperties.woodAxe, 0.7f, BlockProperties.secToMs(1.2, 0.5, 0.2, 0.15, 0.1, 0.05)));
|
||||
BlockProperties.setBlockProps("BAMBOO_SAPLING", new BlockProperties.BlockProps(BlockProperties.noTool, 0.7f, BlockProperties.secToMs(1.25)));
|
||||
BlockFlags.addFlags("BAMBOO", BlockProperties.F_GROUND | BlockProperties.F_GROUND_HEIGHT);
|
||||
BlockFlags.addFlags("BAMBOO_SAPLING", BlockProperties.F_IGN_PASSABLE);
|
||||
BlockFlags.addFlags("WITHER_ROSE", BlockProperties.F_IGN_PASSABLE);
|
||||
BlockProperties.setBlockProps("WITHER_ROSE", instant);
|
||||
BlockFlags.addFlags("CORNFLOWER", BlockProperties.F_IGN_PASSABLE);
|
||||
BlockProperties.setBlockProps("CORNFLOWER", instant);
|
||||
BlockFlags.addFlags("LILY_OF_THE_VALLEY", BlockProperties.F_IGN_PASSABLE);
|
||||
BlockProperties.setBlockProps("LILY_OF_THE_VALLEY", instant);
|
||||
BlockInit.setAs("ACACIA_WALL_SIGN", BridgeMaterial.SIGN);
|
||||
BlockInit.setAs("BIRCH_SIGN", BridgeMaterial.SIGN);
|
||||
BlockInit.setAs("BIRCH_WALL_SIGN", BridgeMaterial.SIGN);
|
||||
BlockInit.setAs("DARK_OAK_SIGN", BridgeMaterial.SIGN);
|
||||
BlockInit.setAs("DARK_OAK_WALL_SIGN", BridgeMaterial.SIGN);
|
||||
BlockInit.setAs("JUNGLE_SIGN", BridgeMaterial.SIGN);
|
||||
BlockInit.setAs("JUNGLE_WALL_SIGN", BridgeMaterial.SIGN);
|
||||
BlockInit.setAs("OAK_SIGN", BridgeMaterial.SIGN);
|
||||
BlockInit.setAs("OAK_WALL_SIGN", BridgeMaterial.SIGN);
|
||||
BlockInit.setAs("SPRUCE_SIGN", BridgeMaterial.SIGN);
|
||||
BlockInit.setAs("SPRUCE_WALL_SIGN", BridgeMaterial.SIGN);
|
||||
BlockInit.setAs("GRINDSTONE", Material.COBBLESTONE);
|
||||
BlockFlags.addFlags("GRINDSTONE", BlockProperties.F_GROUND | BlockProperties.F_GROUND_HEIGHT);
|
||||
BlockInit.setAs("CAMPFIRE", Material.OAK_PLANKS);
|
||||
BlockFlags.addFlags("CAMPFIRE", BlockProperties.F_MIN_HEIGHT16_7);
|
||||
BlockFlags.addFlags("CAMPFIRE", BlockProperties.F_GROUND_HEIGHT);
|
||||
BlockFlags.addFlags("BELL", BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_GROUND);
|
||||
BlockProperties.setBlockProps("BELL", new BlockProperties.BlockProps(BlockProperties.woodPickaxe, 7f, BlockProperties.secToMs(23.0, 3.8, 2.2, 1, 1.5, 0.8)));
|
||||
BlockProperties.setBlockProps("LANTERN", new BlockProperties.BlockProps(BlockProperties.woodPickaxe, 6.0f, BlockProperties.secToMs(17.0, 2.8, 1.8, 0.7, 0.8, 0.5)));
|
||||
BlockFlags.addFlags("LANTERN", BlockProperties.F_GROUND | BlockProperties.F_GROUND_HEIGHT);
|
||||
BlockFlags.addFlags("SWEET_BERRY_BUSH", BlockProperties.F_COBWEB | BlockProperties.F_COBWEB2);
|
||||
StaticLog.logInfo("Added block-info for Minecraft 1.14 blocks.");
|
||||
}
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package fr.neatmonster.nocheatplus.compat.blocks.init.vanilla;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.BlockPropertiesSetup;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.init.BlockInit;
|
||||
import fr.neatmonster.nocheatplus.config.WorldConfigProvider;
|
||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockFlags;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
public class BlocksMC1_15 implements BlockPropertiesSetup{
|
||||
public BlocksMC1_15() {
|
||||
BlockInit.assertMaterialExists("BEEHIVE");
|
||||
BlockInit.assertMaterialExists("BEE_NEST");
|
||||
BlockInit.assertMaterialExists("HONEY_BLOCK");
|
||||
BlockInit.assertMaterialExists("HONEYCOMB_BLOCK");
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void setupBlockProperties(WorldConfigProvider<?> worldConfigProvider) {
|
||||
BlockFlags.addFlags("BEEHIVE", BlockFlags.FULLY_SOLID_BOUNDS);
|
||||
BlockFlags.addFlags("BEE_NEST", BlockFlags.FULLY_SOLID_BOUNDS);
|
||||
BlockFlags.addFlags("HONEYCOMB_BLOCK", BlockFlags.FULLY_SOLID_BOUNDS);
|
||||
BlockFlags.addFlags("HONEY_BLOCK", BlockFlags.SOLID_GROUND | BlockProperties.F_STICKY);
|
||||
|
||||
BlockProperties.setBlockProps("BEEHIVE", new BlockProperties.BlockProps(BlockProperties.woodAxe, 0.6f, BlockProperties.secToMs(0.85, 0.425, 0.225, 0.13, 0.11, 0.7)));
|
||||
BlockProperties.setBlockProps("BEE_NEST", new BlockProperties.BlockProps(BlockProperties.woodAxe, 0.3f, BlockProperties.secToMs(0.4, 0.225, 0.11, 0.05, 0.042, 0.0)));
|
||||
BlockProperties.setBlockProps("HONEYCOMB_BLOCK", new BlockProperties.BlockProps(BlockProperties.noTool, 0.6f));
|
||||
BlockProperties.setBlockProps("HONEY_BLOCK", BlockProperties.instantType);
|
||||
StaticLog.logInfo("Added block-info for Minecraft 1.15 blocks.");
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -113,7 +113,7 @@ public class BlocksMC1_5 implements BlockPropertiesSetup {
|
||||
////////////////////
|
||||
|
||||
// 78 Snow
|
||||
BlockFlags.addFlags("SNOW", BlockProperties.F_HEIGHT_8_INC);
|
||||
BlockFlags.addFlags("SNOW", BlockProperties.F_HEIGHT_8_INC | BlockProperties.F_XZ100 | BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_GROUND);
|
||||
BlockFlags.removeFlags("SNOW", BlockProperties.F_HEIGHT_8SIM_INC);
|
||||
|
||||
StaticLog.logInfo("Added block-info for Minecraft 1.5 blocks.");
|
||||
|
||||
+3
@@ -16,6 +16,7 @@ package fr.neatmonster.nocheatplus.compat.blocks.init.vanilla;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMaterial;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.BlockPropertiesSetup;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.init.BlockInit;
|
||||
import fr.neatmonster.nocheatplus.config.WorldConfigProvider;
|
||||
@@ -40,6 +41,8 @@ public class BlocksMC1_6_1 implements BlockPropertiesSetup{
|
||||
// Hay Bale
|
||||
BlockInit.setPropsAs("HAY_BLOCK", Material.STONE_BUTTON);
|
||||
BlockFlags.setFlagsAs("HAY_BLOCK", Material.STONE); // TODO: Assumption (!).
|
||||
|
||||
if (BridgeMaterial.getBlock("wall_sign") != null) BlockInit.setAs("WALL_SIGN", BridgeMaterial.SIGN);
|
||||
|
||||
// (Carpet via generic setup.)
|
||||
|
||||
|
||||
+1
-2
@@ -48,12 +48,11 @@ public class BlocksMC1_8 implements BlockPropertiesSetup {
|
||||
Material.PUMPKIN,
|
||||
Material.JACK_O_LANTERN,
|
||||
// Same core breaking times, but behave different on efficiency + other tool (?):
|
||||
Material.WALL_SIGN,
|
||||
BridgeMaterial.SIGN,
|
||||
}) {
|
||||
BlockProperties.setBlockProps(mat, props);
|
||||
}
|
||||
|
||||
|
||||
// Ladder.
|
||||
props = new BlockProps(BlockProperties.woodAxe, 0.4f, BlockProperties.secToMs(0.6, 0.3, 0.15, 0.1, 0.075, 0.05));
|
||||
BlockProperties.setBlockProps(Material.LADDER, props);
|
||||
|
||||
+2
@@ -40,6 +40,8 @@ public class VanillaBlocksFactory {
|
||||
setups.add(new BlocksMC1_11());
|
||||
setups.add(new BlocksMC1_12());
|
||||
setups.add(new BlocksMC1_13());
|
||||
setups.add(new BlocksMC1_14());
|
||||
setups.add(new BlocksMC1_15());
|
||||
}
|
||||
catch(Throwable t){}
|
||||
for (final BlockPropertiesSetup setup : setups){
|
||||
|
||||
+3
-2
@@ -29,7 +29,7 @@ import fr.neatmonster.nocheatplus.utilities.map.BlockFlags;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
|
||||
|
||||
/**
|
||||
* Multi client protocol support between 1.7.x - 1.13.x.
|
||||
* Multi client protocol support between 1.7.x - 1.14.x.
|
||||
*
|
||||
* @author asofold
|
||||
*
|
||||
@@ -39,7 +39,7 @@ public class MultiClientProtocolBlockShapePatch extends AbstractBlockPropertiesP
|
||||
|
||||
public MultiClientProtocolBlockShapePatch() {
|
||||
activation
|
||||
.neutralDescription("Block shape patch for multi client protocol support around 1.7.x - 1.13.x.")
|
||||
.neutralDescription("Block shape patch for multi client protocol support around 1.7.x - 1.14.x.")
|
||||
.advertise(true)
|
||||
.setConditionsAND()
|
||||
.notUnitTest()
|
||||
@@ -53,6 +53,7 @@ public class MultiClientProtocolBlockShapePatch extends AbstractBlockPropertiesP
|
||||
|
||||
final List<String> done = new LinkedList<String>();
|
||||
|
||||
//This freaks out with 1.8 using viaversion
|
||||
BlockFlags.addFlags(BridgeMaterial.LILY_PAD,
|
||||
BlockProperties.F_GROUND
|
||||
| BlockProperties.F_HEIGHT8_1
|
||||
|
||||
@@ -223,6 +223,9 @@ public abstract class ConfPaths {
|
||||
private static final String BLOCKBREAK_WRONGBLOCK = BLOCKBREAK + "wrongblock.";
|
||||
public static final String BLOCKBREAK_WRONGBLOCK_CHECK = BLOCKBREAK_WRONGBLOCK + SUB_ACTIVE;
|
||||
public static final String BLOCKBREAK_WRONGBLOCK_LEVEL = BLOCKBREAK_WRONGBLOCK + "level";
|
||||
private static final String BLOCKBREAK_WRONGBLOCK_IMPROBABLE = BLOCKBREAK_WRONGBLOCK + "improbable.";
|
||||
public static final String BLOCKBREAK_WRONGBLOCK_IMPROBABLE_FEEDONLY = BLOCKBREAK_WRONGBLOCK_IMPROBABLE + "feedonly";
|
||||
public static final String BLOCKBREAK_WRONGBLOCK_IMPROBABLE_WEIGHT = BLOCKBREAK_WRONGBLOCK_IMPROBABLE + "weight";
|
||||
public static final String BLOCKBREAK_WRONGBLOCK_ACTIONS = BLOCKBREAK_WRONGBLOCK + "actions";
|
||||
|
||||
public static final String BLOCKINTERACT = CHECKS + "blockinteract.";
|
||||
@@ -269,6 +272,9 @@ public abstract class ConfPaths {
|
||||
private static final String BLOCKPLACE_FASTPLACE_SHORTTERM = BLOCKPLACE_FASTPLACE + "shortterm.";
|
||||
public static final String BLOCKPLACE_FASTPLACE_SHORTTERM_TICKS = BLOCKPLACE_FASTPLACE_SHORTTERM + "ticks";
|
||||
public static final String BLOCKPLACE_FASTPLACE_SHORTTERM_LIMIT = BLOCKPLACE_FASTPLACE_SHORTTERM + "limit";
|
||||
private static final String BLOCKPLACE_FASTPLACE_IMPROBABLE = BLOCKPLACE_FASTPLACE + "improbable.";
|
||||
public static final String BLOCKPLACE_FASTPLACE_IMPROBABLE_FEEDONLY = BLOCKPLACE_FASTPLACE_IMPROBABLE + "feedonly";
|
||||
public static final String BLOCKPLACE_FASTPLACE_IMPROBABLE_WEIGHT = BLOCKPLACE_FASTPLACE_IMPROBABLE + "weight";
|
||||
public static final String BLOCKPLACE_FASTPLACE_ACTIONS = BLOCKPLACE_FASTPLACE + "actions";
|
||||
|
||||
private static final String BLOCKPLACE_NOSWING = BLOCKPLACE + "noswing.";
|
||||
@@ -279,10 +285,20 @@ public abstract class ConfPaths {
|
||||
private static final String BLOCKPLACE_REACH = BLOCKPLACE + "reach.";
|
||||
public static final String BLOCKPLACE_REACH_CHECK = BLOCKPLACE_REACH + SUB_ACTIVE;
|
||||
public static final String BLOCKPLACE_REACH_ACTIONS = BLOCKPLACE_REACH + "actions";
|
||||
|
||||
private static final String BLOCKPLACE_SCAFFOLD = BLOCKPLACE + "scaffold.";
|
||||
public static final String BLOCKPLACE_SCAFFOLD_CHECK = BLOCKPLACE_SCAFFOLD + SUB_ACTIVE;
|
||||
public static final String BLOCKPLACE_SCAFFOLD_ANGLE = BLOCKPLACE_SCAFFOLD + "angle";
|
||||
public static final String BLOCKPLACE_SCAFFOLD_TIME = BLOCKPLACE_SCAFFOLD + "time";
|
||||
public static final String BLOCKPLACE_SCAFFOLD_SPRINT = BLOCKPLACE_SCAFFOLD + "sprint";
|
||||
public static final String BLOCKPLACE_SCAFFOLD_ACTIONS = BLOCKPLACE_SCAFFOLD + "actions";
|
||||
|
||||
private static final String BLOCKPLACE_SPEED = BLOCKPLACE + "speed.";
|
||||
public static final String BLOCKPLACE_SPEED_CHECK = BLOCKPLACE_SPEED + SUB_ACTIVE;
|
||||
public static final String BLOCKPLACE_SPEED_INTERVAL = BLOCKPLACE_SPEED + "interval";
|
||||
private static final String BLOCKPLACE_SPEED_IMPROBABLE = BLOCKPLACE_SPEED + "improbable.";
|
||||
public static final String BLOCKPLACE_SPEED_IMPROBABLE_FEEDONLY = BLOCKPLACE_SPEED_IMPROBABLE + "feedonly";
|
||||
public static final String BLOCKPLACE_SPEED_IMPROBABLE_WEIGHT = BLOCKPLACE_SPEED_IMPROBABLE + "weight";
|
||||
public static final String BLOCKPLACE_SPEED_ACTIONS = BLOCKPLACE_SPEED + "actions";
|
||||
|
||||
private static final String BLOCKPLACE_PREVENTMISC = BLOCKPLACE + "preventmisc.";
|
||||
@@ -446,7 +462,9 @@ public abstract class ConfPaths {
|
||||
|
||||
private static final String COMBINED_YAWRATE = COMBINED + "yawrate.";
|
||||
public static final String COMBINED_YAWRATE_RATE = COMBINED_YAWRATE + "rate";
|
||||
public static final String COMBINED_YAWRATE_IMPROBABLE = COMBINED_YAWRATE + "improbable";
|
||||
private static final String COMBINED_YAWRATE_IMPROBABLE = COMBINED_YAWRATE + "improbable.";
|
||||
public static final String COMBINED_YAWRATE_IMPROBABLE_FEEDONLY = COMBINED_YAWRATE_IMPROBABLE + "feedonly";
|
||||
public static final String COMBINED_YAWRATE_IMPROBABLE_WEIGHT = COMBINED_YAWRATE_IMPROBABLE + "weight";
|
||||
private static final String COMBINED_YAWRATE_PENALTY = COMBINED_YAWRATE + "penalty.";
|
||||
public static final String COMBINED_YAWRATE_PENALTY_FACTOR = COMBINED_YAWRATE_PENALTY + "factor";
|
||||
public static final String COMBINED_YAWRATE_PENALTY_MIN = COMBINED_YAWRATE_PENALTY + "minimum";
|
||||
@@ -458,6 +476,7 @@ public abstract class ConfPaths {
|
||||
public static final String FIGHT_CANCELDEAD = FIGHT + "canceldead";
|
||||
public static final String FIGHT_TOOLCHANGEPENALTY = FIGHT + "toolchangepenalty";
|
||||
private static final String FIGHT_PVP = FIGHT + "pvp.";
|
||||
public static final String FIGHT_MAXLOOPLETENCYTICKS = FIGHT + "maxloopletencyticks";
|
||||
public static final String FIGHT_PVP_KNOCKBACKVELOCITY = FIGHT_PVP + "knockbackvelocity";
|
||||
|
||||
private static final String FIGHT_ANGLE = FIGHT + "angle.";
|
||||
@@ -468,7 +487,7 @@ public abstract class ConfPaths {
|
||||
public static final String FIGHT_ANGLE_THRESHOLD_YAW = FIGHT_ANGLE_THRESHOLD + "average_yaw";
|
||||
public static final String FIGHT_ANGLE_THRESHOLD_SWITCH = FIGHT_ANGLE_THRESHOLD + "average_switch";
|
||||
public static final String FIGHT_ANGLE_ACTIONS = FIGHT_ANGLE + "actions";
|
||||
|
||||
|
||||
private static final String FIGHT_CRITICAL = FIGHT + "critical.";
|
||||
public static final String FIGHT_CRITICAL_CHECK = FIGHT_CRITICAL + SUB_ACTIVE;
|
||||
// TODO: Deprecate or rename (->falldistancemin)?
|
||||
@@ -478,6 +497,9 @@ public abstract class ConfPaths {
|
||||
private static final String FIGHT_DIRECTION = FIGHT + "direction.";
|
||||
public static final String FIGHT_DIRECTION_CHECK = FIGHT_DIRECTION + SUB_ACTIVE;
|
||||
public static final String FIGHT_DIRECTION_STRICT = FIGHT_DIRECTION + "strict";
|
||||
public static final String FIGHT_DIRECTION_FAILALL = FIGHT_DIRECTION + "failall";
|
||||
public static final String FIGHT_DIRECTION_LOOPPRECISION = FIGHT_DIRECTION + "loopprecision";
|
||||
public static final String FIGHT_DIRECTION_STRICTANGLEPRECISION = FIGHT_DIRECTION + "strictangleprecision";
|
||||
public static final String FIGHT_DIRECTION_PENALTY = FIGHT_DIRECTION + "penalty";
|
||||
public static final String FIGHT_DIRECTION_ACTIONS = FIGHT_DIRECTION + "actions";
|
||||
|
||||
@@ -505,10 +527,14 @@ public abstract class ConfPaths {
|
||||
public static final String FIGHT_REACH_REDUCE = FIGHT_REACH + "reduce";
|
||||
public static final String FIGHT_REACH_REDUCEDISTANCE = FIGHT_REACH + "reducedistance";
|
||||
public static final String FIGHT_REACH_REDUCESTEP = FIGHT_REACH + "reducestep";
|
||||
private static final String FIGHT_REACH_IMPROBABLE = FIGHT_REACH + "improbable.";
|
||||
public static final String FIGHT_REACH_IMPROBABLE_FEEDONLY = FIGHT_REACH_IMPROBABLE + "feedonly";
|
||||
public static final String FIGHT_REACH_IMPROBABLE_WEIGHT = FIGHT_REACH_IMPROBABLE + "weight";
|
||||
public static final String FIGHT_REACH_ACTIONS = FIGHT_REACH + "actions";
|
||||
|
||||
public static final String FIGHT_SELFHIT = FIGHT + "selfhit.";
|
||||
public static final String FIGHT_SELFHIT_CHECK = FIGHT_SELFHIT + SUB_ACTIVE;
|
||||
public static final String FIGHT_SELFHIT_EXCLUDEPROJECTILE = FIGHT_SELFHIT + "excludeprojectile";
|
||||
public static final String FIGHT_SELFHIT_ACTIONS = FIGHT_SELFHIT + "actions";
|
||||
|
||||
|
||||
@@ -524,12 +550,11 @@ public abstract class ConfPaths {
|
||||
private static final String FIGHT_SPEED_SHORTTERM = FIGHT_SPEED + "shortterm.";
|
||||
public static final String FIGHT_SPEED_SHORTTERM_LIMIT = FIGHT_SPEED_SHORTTERM + "limit";
|
||||
public static final String FIGHT_SPEED_SHORTTERM_TICKS = FIGHT_SPEED_SHORTTERM + "ticks";
|
||||
private static final String FIGHT_SPEED_IMPROBABLE = FIGHT_SPEED + "improbable.";
|
||||
public static final String FIGHT_SPEED_IMPROBABLE_FEEDONLY = FIGHT_SPEED_IMPROBABLE + "feedonly";
|
||||
public static final String FIGHT_SPEED_IMPROBABLE_WEIGHT = FIGHT_SPEED_IMPROBABLE + "weight";
|
||||
public static final String FIGHT_SPEED_ACTIONS = FIGHT_SPEED + "actions";
|
||||
|
||||
private static final String FIGHT_WRONGTURN = FIGHT + "wrongturn.";
|
||||
public static final String FIGHT_WRONGTURN_CHECK = FIGHT_WRONGTURN + SUB_ACTIVE;
|
||||
public static final String FIGHT_WRONGTURN_ACTIONS = FIGHT_WRONGTURN + "actions";
|
||||
|
||||
|
||||
private static final String FIGHT_YAWRATE = FIGHT + "yawrate.";
|
||||
public static final String FIGHT_YAWRATE_CHECK = FIGHT_YAWRATE + SUB_ACTIVE;
|
||||
|
||||
@@ -551,6 +576,8 @@ public abstract class ConfPaths {
|
||||
public static final String INVENTORY_FASTCLICK_LIMIT_SHORTTERM = INVENTORY_FASTCLICK_LIMIT + "shortterm";
|
||||
public static final String INVENTORY_FASTCLICK_LIMIT_NORMAL = INVENTORY_FASTCLICK_LIMIT + "normal";
|
||||
public static final String INVENTORY_FASTCLICK_LIMIT_CHEST = INVENTORY_FASTCLICK_LIMIT + "chest";
|
||||
private static final String INVENTORY_FASTCLICK_IMPROBABLE = INVENTORY_FASTCLICK + "improbable.";
|
||||
public static final String INVENTORY_FASTCLICK_IMPROBABLE_WEIGHT = INVENTORY_FASTCLICK_IMPROBABLE + "weight";
|
||||
public static final String INVENTORY_FASTCLICK_ACTIONS = INVENTORY_FASTCLICK + "actions";
|
||||
|
||||
private static final String INVENTORY_FASTCONSUME = INVENTORY + "fastconsume.";
|
||||
@@ -590,6 +617,7 @@ public abstract class ConfPaths {
|
||||
|
||||
public static final String INVENTORY_INVENTORYMOVE = INVENTORY + "inventorymove.";
|
||||
public static final String INVENTORY_INVENTORYMOVE_CHECK = INVENTORY_INVENTORYMOVE + SUB_ACTIVE;
|
||||
public static final String INVENTORY_INVENTORYMOVE_DISABLECREATIVE = INVENTORY_INVENTORYMOVE + "disable_creative";
|
||||
public static final String INVENTORY_INVENTORYMOVE_ACTIONS = INVENTORY_INVENTORYMOVE + "actions";
|
||||
|
||||
// Inventory hot-fix.
|
||||
@@ -606,6 +634,8 @@ public abstract class ConfPaths {
|
||||
public static final String MOVING_CREATIVEFLY_IGNOREALLOWFLIGHT = MOVING_CREATIVEFLY + "ignoreallowflight";
|
||||
public static final String MOVING_CREATIVEFLY_MODEL = MOVING_CREATIVEFLY + SUB_MODEL + ".";
|
||||
public static final String MOVING_CREATIVEFLY_ACTIONS = MOVING_CREATIVEFLY + "actions";
|
||||
public static final String MOVING_CREATIVEFLY_EYTRA_FWRESET = MOVING_CREATIVEFLY_MODEL + "elytra.resetFwOnground";
|
||||
public static final String MOVING_CREATIVEFLY_EYTRA_STRICT = MOVING_CREATIVEFLY_MODEL + "elytra.strict";
|
||||
|
||||
private static final String MOVING_MOREPACKETS = MOVING + "morepackets.";
|
||||
public static final String MOVING_MOREPACKETS_CHECK = MOVING_MOREPACKETS + SUB_ACTIVE;
|
||||
@@ -665,6 +695,13 @@ public abstract class ConfPaths {
|
||||
public static final String MOVING_SURVIVALFLY_SETBACKPOLICY_FALLDAMAGE = MOVING_SURVIVALFLY_SETBACKPOLICY + "falldamage";
|
||||
public static final String MOVING_SURVIVALFLY_SETBACKPOLICY_VOIDTOVOID = MOVING_SURVIVALFLY_SETBACKPOLICY + "voidtovoid";
|
||||
public static final String MOVING_SURVIVALFLY_ACTIONS = MOVING_SURVIVALFLY + "actions";
|
||||
private static final String MOVING_SURVIVALFLY_VLFREQUENCY = MOVING_SURVIVALFLY_LENIENCY + "violationfrequency.";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREQUENCY_ACTIVE = MOVING_SURVIVALFLY_VLFREQUENCY + "active";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREQUENCY_DEBUG = MOVING_SURVIVALFLY_VLFREQUENCY + "debug";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREQUENCY_MAXTOTALVLS = MOVING_SURVIVALFLY_VLFREQUENCY + "maxleniencyvl";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREQUENCY_MINADDEDVLS = MOVING_SURVIVALFLY_VLFREQUENCY + "mintoadd";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREQUENCY_MOVECOUNT = MOVING_SURVIVALFLY_VLFREQUENCY + "movecount";
|
||||
public static final String MOVING_SURVIVALFLY_VLFREQUENCY_MOREVLS = MOVING_SURVIVALFLY_VLFREQUENCY + "morevls";
|
||||
|
||||
@GlobalConfig
|
||||
public static final String MOVING_SURVIVALFLY_HOVER = MOVING_SURVIVALFLY + "hover.";
|
||||
@@ -737,6 +774,8 @@ public abstract class ConfPaths {
|
||||
public static final String NET_ATTACKFREQUENCY_SECONDS_TWO = NET_ATTACKFREQUENCY_SECONDS + "two";
|
||||
public static final String NET_ATTACKFREQUENCY_SECONDS_FOUR = NET_ATTACKFREQUENCY_SECONDS + "four";
|
||||
public static final String NET_ATTACKFREQUENCY_SECONDS_EIGHT = NET_ATTACKFREQUENCY_SECONDS + "eight";
|
||||
private static final String NET_ATTACKFREQUENCY_IMPROBABLE = NET_ATTACKFREQUENCY + "improbable.";
|
||||
public static final String NET_ATTACKFREQUENCY_IMPROBABLE_WEIGHT = NET_ATTACKFREQUENCY_IMPROBABLE + "weight";
|
||||
public static final String NET_ATTACKFREQUENCY_ACTIONS = NET_ATTACKFREQUENCY + "actions";
|
||||
|
||||
private static final String NET_FLYINGFREQUENCY = NET + "flyingfrequency.";
|
||||
@@ -772,6 +811,10 @@ public abstract class ConfPaths {
|
||||
private static final String NET_SUPERSEDED = NET + "superseded.";
|
||||
private static final String NET_SUPERSEDED_FLYING = NET_SUPERSEDED + "flying.";
|
||||
public static final String NET_SUPERSEDED_FLYING_CANCELWAITING = NET_SUPERSEDED_FLYING + "cancelwaiting";
|
||||
|
||||
private static final String NET_WRONGTURN = NET + "wrongturn.";
|
||||
public static final String NET_WRONGTURN_ACTIVE = NET_WRONGTURN + SUB_ACTIVE;
|
||||
public static final String NET_WRONGTURN_ACTIONS = NET_WRONGTURN + "actions";
|
||||
|
||||
public static final String STRINGS = "strings";
|
||||
|
||||
@@ -910,6 +953,10 @@ public abstract class ConfPaths {
|
||||
public static final String FIGHT_CRITICAL_CANCEL_CANCEL = "checks.fight.critical.cancel.cancel";
|
||||
@Deprecated
|
||||
public static final String FIGHT_CRITICAL_CANCEL_DIVIDEDAMAGE = "checks.fight.critical.cancel.dividedamage";
|
||||
@Deprecated // Does this need to be done?
|
||||
private static final String FIGHT_CLICKPATTERN = "checks.fight.clickpattern";
|
||||
@Deprecated
|
||||
private static final String NET_FIGHTSYNC = "checks.net.fightsync";
|
||||
|
||||
/**
|
||||
* Get moved paths for which an annotation doesn't work.
|
||||
@@ -921,7 +968,7 @@ public abstract class ConfPaths {
|
||||
final List<ManyMoved> multiEntries = new LinkedList<ManyMoved>();
|
||||
|
||||
// Add entries.
|
||||
final List<String> cfModels = Arrays.asList("creative", "spectator", "survival", "adventure", "elytra", "levitation");
|
||||
final List<String> cfModels = Arrays.asList("creative", "spectator", "survival", "adventure", "elytra", "levitation", "slowfalling");
|
||||
multiEntries.add(new ManyMoved(MOVING_CREATIVEFLY_MODEL, cfModels, "horizontalspeed", SUB_HORIZONTAL_SPEED));
|
||||
multiEntries.add(new ManyMoved(MOVING_CREATIVEFLY_MODEL, cfModels, "modsprint", SUB_HORIZONTAL_MODSPRINT));
|
||||
multiEntries.add(new ManyMoved(MOVING_CREATIVEFLY_MODEL, cfModels, "maxheight", SUB_VERTICAL_MAXHEIGHT));
|
||||
@@ -934,4 +981,4 @@ public abstract class ConfPaths {
|
||||
return entries;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,10 @@ import java.util.LinkedList;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMaterial;
|
||||
|
||||
/**
|
||||
* These are the default settings for NoCheatPlus. They will be used in addition to/in replacement of configurations
|
||||
@@ -31,8 +33,8 @@ public class DefaultConfig extends ConfigFile {
|
||||
|
||||
// TODO: Other version details ?
|
||||
|
||||
private static final String unifiedBlockDirectionActions = "cancel vl>10 log:bdirection:0:3:if cancel";
|
||||
private static final String unifiedBlockReachActions = "cancel vl>5 log:breach:0:2:if cancel";
|
||||
private static final String unifiedBlockDirectionActions = "vl>1 cancel vl>15 cancel log:bdirection:4:8:i vl>200 cancel log:bdirection:1:5:if cmdc:kickillegalblockinteract:1:5";
|
||||
private static final String unifiedBlockReachActions = "cancel log:breach:5:6:i";
|
||||
|
||||
/**
|
||||
* Instantiates a new default configuration.
|
||||
@@ -63,7 +65,7 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.LOGGING_BACKEND_FILE_PREFIX, "", 785);
|
||||
set(ConfPaths.LOGGING_BACKEND_FILE_FILENAME, "nocheatplus.log", 785);
|
||||
set(ConfPaths.LOGGING_BACKEND_INGAMECHAT_ACTIVE, true, 785);
|
||||
set(ConfPaths.LOGGING_BACKEND_INGAMECHAT_PREFIX, "&cNCP: &f", 785);
|
||||
set(ConfPaths.LOGGING_BACKEND_INGAMECHAT_PREFIX, "&7&l[&cNC+&7&l]&7 ", 1154);
|
||||
|
||||
// Data settings.
|
||||
// Expired offline players data.
|
||||
@@ -80,7 +82,7 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.PERMISSIONS_POLICY_DEFAULT, "ALWAYS", 1140);
|
||||
set(ConfPaths.PERMISSIONS_POLICY_RULES, Arrays.asList(
|
||||
"nocheatplus.notify :: INTERVAL:60, -world, -offline", // Not sure about this one.
|
||||
"nocheatplus.admin.debug :: INTERVAL:5",
|
||||
"nocheatplus.admin.debug :: INTERVAL:10",
|
||||
"nocheatplus.admin* :: ALWAYS",
|
||||
// TODO: Command permissions are always checked anyway :p. Will be changed...
|
||||
"nocheatplus.command* :: ALWAYS",
|
||||
@@ -92,10 +94,10 @@ public class DefaultConfig extends ConfigFile {
|
||||
*/
|
||||
"nocheatplus.checks.chat.relog :: INTERVAL:10",
|
||||
"nocheatplus.checks.chat.logins :: INTERVAL:10",
|
||||
"nocheatplus.checks.chat.* :: INTERVAL:2",
|
||||
"nocheatplus.checks.net.* :: INTERVAL:2",
|
||||
"nocheatplus.checks.moving.survivalfly.* :: INTERVAL:5" // (Excludes the sf base permission.)
|
||||
), 1142);
|
||||
"nocheatplus.checks.chat.* :: INTERVAL:4",
|
||||
"nocheatplus.checks.net.* :: INTERVAL:4",
|
||||
"nocheatplus.checks.moving.survivalfly.* :: INTERVAL:10" // (Excludes the sf base permission.)
|
||||
), 1154);
|
||||
|
||||
// Protection features.
|
||||
// Hide plugins.
|
||||
@@ -112,42 +114,44 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.PROTECT_CLIENTS_MOTD_ACTIVE, true, 785);
|
||||
set(ConfPaths.PROTECT_CLIENTS_MOTD_ALLOWALL, false, 785);
|
||||
|
||||
|
||||
/* Checks! */
|
||||
set(ConfPaths.CHECKS_ACTIVE, true, 1144);
|
||||
set(ConfPaths.CHECKS_LAG, true, 1144);
|
||||
set(ConfPaths.CHECKS_DEBUG, false, 1144);
|
||||
|
||||
|
||||
/* BlockBreak */
|
||||
set(ConfPaths.BLOCKBREAK_ACTIVE, "default", 1144);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_DIRECTION_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKBREAK_DIRECTION_ACTIONS, unifiedBlockDirectionActions, 1097);
|
||||
set(ConfPaths.BLOCKBREAK_DIRECTION_ACTIONS, "cancel", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_STRICT, true, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY, 100, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY, 95, 785); //100
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_MOD_SURVIVAL, 100, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_GRACE, 2000, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_ACTIONS, "cancel vl>0 log:fastbreak:3:5:cif cancel", 785);
|
||||
set(ConfPaths.BLOCKBREAK_FASTBREAK_ACTIONS, "cancel vl>5 cancel log:fastbreak:4:2:i vl>50 cancel log:fastbreak:0:2:if cmdc:kickfastbreak:2:5", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_MOD_CREATIVE, 95, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_MOD_SURVIVAL, 45, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_SHORTTERM_TICKS, 5, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_SHORTTERM_LIMIT, 7, 785);
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_ACTIONS, "cancel vl>5 log:bbfrequency:3:5:if cancel vl>60 log:bbfrequency:0:5:cif cancel cmd:kickfrequency", 785);
|
||||
set(ConfPaths.BLOCKBREAK_FREQUENCY_ACTIONS, "cancel vl>5 log:bbfrequency:3:5:i cancel vl>40 log:bbfrequency:0:5:if cancel cmdc:kickfrequency:0:5", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_NOSWING_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKBREAK_NOSWING_ACTIONS, "cancel vl>10 log:noswing:0:5:if cancel", 785);
|
||||
set(ConfPaths.BLOCKBREAK_NOSWING_ACTIONS, "cancel vl>10 log:noswing:0:5:i cancel", 785);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_REACH_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKBREAK_REACH_ACTIONS, unifiedBlockReachActions, 785);
|
||||
set(ConfPaths.BLOCKBREAK_REACH_ACTIONS, "cancel", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_LEVEL, 10, 785);
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_ACTIONS, "cancel vl>10 log:bwrong:0:5:if cancel vl>30 log:bwrong:0:5:cif cancel cmd:kickwb", 785);
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_LEVEL, 20, 1154);
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_IMPROBABLE_FEEDONLY, false, 1154);
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_IMPROBABLE_WEIGHT, 2.0, 1154);
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_ACTIONS, "cancel vl>10 log:bwrong:2:5:i cancel vl>30 log:bwrong:0:5:if cancel cmdc:kickwb:0:5", 1154);
|
||||
|
||||
/* BlockInteract */
|
||||
set(ConfPaths.BLOCKINTERACT_ACTIVE, "default", 1144);
|
||||
|
||||
set(ConfPaths.BLOCKINTERACT_DIRECTION_CHECK, "default", 785);
|
||||
@@ -158,70 +162,79 @@ public class DefaultConfig extends ConfigFile {
|
||||
|
||||
set(ConfPaths.BLOCKINTERACT_SPEED_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKINTERACT_SPEED_INTERVAL, 2000, 785);
|
||||
set(ConfPaths.BLOCKINTERACT_SPEED_LIMIT, 60, 785);
|
||||
set(ConfPaths.BLOCKINTERACT_SPEED_ACTIONS, "cancel vl>200 log:bspeed:0:2:if cancel vl>1000 cancel log:bspeed:0:2:icf cmd:kickbspeed", 785);
|
||||
set(ConfPaths.BLOCKINTERACT_SPEED_LIMIT, 55, 1154); // Old limit: 60
|
||||
set(ConfPaths.BLOCKINTERACT_SPEED_ACTIONS, "cancel vl>10 cancel log:bspeed:5:4:i cancel vl>500 cancel log:bspeed:0:5:icf cmdc:kickbspeed:2:5", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKINTERACT_VISIBLE_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKINTERACT_VISIBLE_ACTIONS, "cancel vl>100 log:bvisible:0:10:if cancel", 785);
|
||||
set(ConfPaths.BLOCKINTERACT_VISIBLE_ACTIONS, "cancel vl>30 log:bvisible:8:5:if cancel", 1154); // Visible + stone generators = fps NCP issue #575
|
||||
|
||||
|
||||
// BLOCKPLACE
|
||||
/* BlockPlace */
|
||||
set(ConfPaths.BLOCKPLACE_ACTIVE, "default", 1144);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_AGAINST_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_AGAINST_ACTIONS, "cancel", 785);
|
||||
set(ConfPaths.BLOCKPLACE_AGAINST_ACTIONS, "cancel log:against:1:5:i vl>10 cancel log:against:0:2:if cmdc:kickagainst:0:10", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_AUTOSIGN_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_AUTOSIGN_SKIPEMPTY, false, 785);
|
||||
set(ConfPaths.BLOCKPLACE_AUTOSIGN_ACTIONS, "cancel vl>10 log:bautosign:0:3:if cancel", 785);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_DIRECTION_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_DIRECTION_ACTIONS, unifiedBlockDirectionActions, 785);
|
||||
set(ConfPaths.BLOCKPLACE_DIRECTION_ACTIONS, "cancel", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_LIMIT, 22, 785);
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_LIMIT, 15, 1154); // Old limit: 22
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_SHORTTERM_TICKS, 10, 785);
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_SHORTTERM_LIMIT, 6, 785);
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_ACTIONS, "cancel vl>100 log:fastplace:3:5:cif cancel", 785);
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_IMPROBABLE_FEEDONLY, false, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_IMPROBABLE_WEIGHT, 0.5, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_ACTIONS, "cancel vl>5 cancel log:fastplace:8:3:i vl>20 cancel log:fastplace:2:4:i vl>80 cancel log:fastplace:0:10:if cmdc:kickfastplace:1:10", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_REACH_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_REACH_ACTIONS, unifiedBlockReachActions, 785);
|
||||
set(ConfPaths.BLOCKPLACE_REACH_ACTIONS, "cancel", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_NOSWING_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_NOSWING_EXCEPTIONS, Arrays.asList("LILY_PAD", Material.FLINT_AND_STEEL.toString()), 785);
|
||||
set(ConfPaths.BLOCKPLACE_NOSWING_ACTIONS, "cancel vl>10 log:noswing:0:5:if cancel", 785);
|
||||
set(ConfPaths.BLOCKPLACE_NOSWING_EXCEPTIONS, Arrays.asList(BridgeMaterial.LILY_PAD.toString(), Material.FLINT_AND_STEEL.toString()), 1154);
|
||||
set(ConfPaths.BLOCKPLACE_NOSWING_ACTIONS, "cancel vl>10 log:noswing:2:5:i cancel", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_SCAFFOLD_CHECK, "default", 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SCAFFOLD_ANGLE, true, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SCAFFOLD_SPRINT, true, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SCAFFOLD_TIME, true, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SCAFFOLD_ACTIONS, "vl>1 cancel vl>10 cancel log:scaffold:3:7:if vl>60 cancel log:scaffold:1:2:if cmdc:kickscaffold:2:10 cmd:clearscaffold:0:5", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_INTERVAL, 45L, 785);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_ACTIONS,
|
||||
"cancel vl>150 log:bpspeed:3:5:if cancel vl>1000 log:bpspeed:3:5:cif cancel", 785);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_INTERVAL, 30L, 1154); // Old limit: 45L < FPs with throwable potions.
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_IMPROBABLE_FEEDONLY, true, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_IMPROBABLE_WEIGHT, 0.3, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_ACTIONS, "cancel vl>100 log:bpspeed:6:7:i cancel vl>1000 log:bpspeed:3:5:if cancel", 1154);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_PREVENTMISC_BOATSANYWHERE, true);
|
||||
|
||||
|
||||
/* Chat */
|
||||
set(ConfPaths.CHAT_ACTIVE, "default", 1144);
|
||||
|
||||
// Captcha.
|
||||
set(ConfPaths.CHAT_CAPTCHA_CHECK, "default", 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_CHECK, "false", 1154);
|
||||
set(ConfPaths.CHAT_CAPTCHA_SKIP_COMMANDS, false, 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_CHARACTERS, "abcdefghjkmnpqrtuvwxyzABCDEFGHJKMNPQRTUVWXYZ2346789", 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_CHARACTERS, "abcdefghjkmnpqrtuvwxyzABCDEFGHJKMNPQRTUVWXYZ2346789!?><", 1154);
|
||||
set(ConfPaths.CHAT_CAPTCHA_LENGTH, 6, 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_QUESTION, "&cPlease type '&6[captcha]&c' to continue sending messages/commands.", 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_SUCCESS, "&aOK, it sounds like you're not a spambot.", 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_QUESTION, "&c&l(!)&7 Please type '&6[captcha]&7' to continue using chat.", 1154);
|
||||
set(ConfPaths.CHAT_CAPTCHA_SUCCESS, "&c&l(!)&7 Antispam check passed.", 1154);
|
||||
set(ConfPaths.CHAT_CAPTCHA_TRIES, 3, 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_ACTIONS, "cancel cmd:kickcaptcha vl>4 log:captcha:2:5:cf cancel cmd:kickcaptcha", 785);
|
||||
|
||||
set(ConfPaths.CHAT_COLOR_CHECK, "default", 785);
|
||||
set(ConfPaths.CHAT_COLOR_ACTIONS, "log:color:0:1:if cancel", 785);
|
||||
set(ConfPaths.CHAT_CAPTCHA_ACTIONS, "cancel cmdc:kickcaptcha vl>4 log:captcha:2:5:cf cancel cmdc:kickcaptcha", 785);
|
||||
// This check should be subject to removal
|
||||
set(ConfPaths.CHAT_COLOR_CHECK, "false", 1154);
|
||||
set(ConfPaths.CHAT_COLOR_ACTIONS, "cancel", 1154);
|
||||
|
||||
|
||||
set(ConfPaths.CHAT_COMMANDS_CHECK, "default", 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_EXCLUSIONS, new ArrayList<String>(), 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_HANDLEASCHAT, Arrays.asList("me"), 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_EXCLUSIONS, Arrays.asList("undo", "redo"), 1154);
|
||||
set(ConfPaths.CHAT_COMMANDS_HANDLEASCHAT, Arrays.asList("me", "msg", "emsg", "essentials:msg", "tell", "etell", "essentials:tell", "say", "esay", "essentials:say", "whisper", "ewhisper", "essentials:whisper", "w", "essentials:w", "ew", "r", "er", "essentials:r", "reply", "essentials:reply", "ereply"), 1154);
|
||||
set(ConfPaths.CHAT_COMMANDS_LEVEL, 10, 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_SHORTTERM_TICKS, 18, 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_SHORTTERM_LEVEL, 3, 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_ACTIONS, "log:commands:0:5:cf cancel cmd:kickcommands vl>20 log:commands:0:5:cf cancel cmd:tempkick1", 785);
|
||||
set(ConfPaths.CHAT_COMMANDS_ACTIONS, "log:commands:0:5:cf cancel cmdc:kickcommands vl>20 log:commands:0:5:cf cancel cmdc:tempkick1", 1154);
|
||||
|
||||
// Text (ordering on purpose).
|
||||
set(ConfPaths.CHAT_TEXT_CHECK, "default", 785);
|
||||
@@ -230,57 +243,57 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_NORM_FACTOR, 0.9D, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_NORM_WEIGHT, 6, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_NORM_LEVEL, 160, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_NORM_ACTIONS, "cancel cmd:tellchatnormal vl>7 log:chatnormal:0:5:f cancel cmd:tellchatnormal vl>20 log:chatnormal:0:5:cf cancel cmd:kickchatnormal vl>40 log:chatnormal:0:5:cf cancel cmd:kickchat5", 785);
|
||||
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_NORM_ACTIONS, "cancel cmdc:tellchatnormal vl>7 log:chatnormal:0:5:cif cancel cmdc:tellchatnormal vl>20 log:chatnormal:0:5:cif cancel cmdc:kickchatnormal vl>40 log:chatnormal:0:5:cif cancel cmdc:kickchat5", 1154);
|
||||
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_SHORTTERM_MIN, 2.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_SHORTTERM_FACTOR, 0.7, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_SHORTTERM_WEIGHT, 3.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_SHORTTERM_LEVEL, 20.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_SHORTTERM_ACTIONS, "log:chatfast:0:5:cf cancel cmd:kickchatfast vl>20 log:chatfast:0:5:cf cancel cmd:kickchat1 vl>40 log:chatfast:0:5:cf cancel cmd:kickchat5", 785);
|
||||
set(ConfPaths.CHAT_TEXT_FREQ_SHORTTERM_ACTIONS, "log:chatfast:2:3:icf cancel cmdc:kickchatfast:0:5 vl>20 cancel log:chatfast:0:5:cif cmdc:kickchatfast vl>40 cancel log:chatfast:0:5:cif cmdc:kickchat1", 1154);
|
||||
// Message
|
||||
set(ConfPaths.CHAT_TEXT_MSG_LETTERCOUNT, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_PARTITION, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_UPPERCASE, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_UPPERCASE, 1.2, 1154);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_AFTERJOIN, 1.5, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_NOMOVING, 1.5, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_REPEATCANCEL, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_NOMOVING, 1.1, 1154);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_REPEATCANCEL, 2.0, 1154);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_REPEATGLOBAL, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_REPEATSELF, 1.5, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_WORDS_LENGTHAV, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_WORDS_LENGTHMSG, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_WORDS_NOLETTER, 0.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_MSG_WORDS_NOLETTER, 0.2, 1154);
|
||||
// Global
|
||||
set(ConfPaths.CHAT_TEXT_GL_CHECK, true, 785);
|
||||
set(ConfPaths.CHAT_TEXT_GL_WEIGHT, 0.5, 785);
|
||||
set(ConfPaths.CHAT_TEXT_GL_WORDS_CHECK, false, 785);
|
||||
set(ConfPaths.CHAT_TEXT_GL_WORDS_CHECK, true, 1154);
|
||||
set(ConfPaths.CHAT_TEXT_GL_WEIGHT, 1.0, 785);
|
||||
set(ConfPaths.CHAT_TEXT_GL_PREFIXES_CHECK , false, 785);
|
||||
set(ConfPaths.CHAT_TEXT_GL_SIMILARITY_CHECK , false, 785);
|
||||
set(ConfPaths.CHAT_TEXT_GL_SIMILARITY_CHECK , true, 1154);
|
||||
// Player
|
||||
set(ConfPaths.CHAT_TEXT_PP_CHECK, true, 785);
|
||||
set(ConfPaths.CHAT_TEXT_PP_WORDS_CHECK, false, 785);
|
||||
set(ConfPaths.CHAT_TEXT_PP_PREFIXES_CHECK, false, 785);
|
||||
set(ConfPaths.CHAT_TEXT_PP_SIMILARITY_CHECK , false, 785);
|
||||
set(ConfPaths.CHAT_TEXT_PP_WORDS_CHECK, true, 1154);
|
||||
set(ConfPaths.CHAT_TEXT_PP_PREFIXES_CHECK, true, 1154);
|
||||
set(ConfPaths.CHAT_TEXT_PP_SIMILARITY_CHECK , true, 1154);
|
||||
// Warning (commands + chat).
|
||||
set(ConfPaths.CHAT_WARNING_CHECK, true, 785);
|
||||
set(ConfPaths.CHAT_WARNING_LEVEL, 67, 785);
|
||||
set(ConfPaths.CHAT_WARNING_MESSAGE, "&e>>>\n&e>>> &cPlease &eslow down &cchat, &eyou might get kicked &cfor spam.\n&e>>>", 785);
|
||||
set(ConfPaths.CHAT_WARNING_MESSAGE, "\n &c&l(!)&7 Please slow down chat, you might get kicked by the antispam.\n \n", 1154);
|
||||
set(ConfPaths.CHAT_WARNING_TIMEOUT, 10, 785);
|
||||
// Relog
|
||||
set(ConfPaths.CHAT_RELOG_CHECK, "default", 785);
|
||||
set(ConfPaths.CHAT_RELOG_TIMEOUT, 5000L, 785);
|
||||
set(ConfPaths.CHAT_RELOG_WARNING_MESSAGE, "&cYou relogged really fast! If you keep doing that, you're going to be banned.", 785);
|
||||
set(ConfPaths.CHAT_RELOG_WARNING_MESSAGE, "&c&l(!)&7 You relogged really fast! If you keep doing that, you're going to be banned.", 1154);
|
||||
set(ConfPaths.CHAT_RELOG_WARNING_NUMBER, 1, 785);
|
||||
set(ConfPaths.CHAT_RELOG_KICKMESSAGE, "Too fast re-login, try with a little delay.", 785);
|
||||
set(ConfPaths.CHAT_RELOG_WARNING_TIMEOUT, 60000L, 785);
|
||||
set(ConfPaths.CHAT_RELOG_ACTIONS, "log:relog:0:10:cf cancel vl>20 log:relog:0:10:cf cancel cmd:tempkick5", 785);
|
||||
set(ConfPaths.CHAT_RELOG_ACTIONS, "log:relog:0:10:cf cancel vl>20 log:relog:0:10:cf cancel cmdc:tempkick5", 1154);
|
||||
// Logins
|
||||
set(ConfPaths.CHAT_LOGINS_CHECK, "default", 785);
|
||||
set(ConfPaths.CHAT_LOGINS_STARTUPDELAY, 600, 785);
|
||||
set(ConfPaths.CHAT_LOGINS_PERWORLDCOUNT, false, 785);
|
||||
set(ConfPaths.CHAT_LOGINS_SECONDS, 10, 785);
|
||||
set(ConfPaths.CHAT_LOGINS_LIMIT, 10, 785);
|
||||
set(ConfPaths.CHAT_LOGINS_KICKMESSAGE, "Too many people logging in, retry soon.", 785);
|
||||
set(ConfPaths.CHAT_LOGINS_KICKMESSAGE, "Too many players are logging in at the same time, please try again later.", 1154);
|
||||
|
||||
/*
|
||||
* Combined !
|
||||
@@ -289,15 +302,15 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.COMBINED_ACTIVE, "default", 1144);
|
||||
|
||||
set(ConfPaths.COMBINED_BEDLEAVE_CHECK, "default", 785);
|
||||
set(ConfPaths.COMBINED_BEDLEAVE_ACTIONS, "cancel log:bedleave:0:5:if cmd:kickbedleave", 785);
|
||||
set(ConfPaths.COMBINED_BEDLEAVE_ACTIONS, "cancel log:bedleave:0:5:if cmdc:kickbedleave", 1154);
|
||||
|
||||
set(ConfPaths.COMBINED_ENDERPEARL_CHECK, "default", 785);
|
||||
set(ConfPaths.COMBINED_ENDERPEARL_CHECK, true, 1154); // 'default' activation flag issue
|
||||
set(ConfPaths.COMBINED_ENDERPEARL_PREVENTCLICKBLOCK, true, 785);
|
||||
|
||||
set(ConfPaths.COMBINED_IMPROBABLE_CHECK , "default", 785);
|
||||
set(ConfPaths.COMBINED_IMPROBABLE_LEVEL, 300, 785);
|
||||
// set(ConfPaths.COMBINED_IMPROBABLE_FASTBREAK_CHECK, false, 785);
|
||||
set(ConfPaths.COMBINED_IMPROBABLE_ACTIONS, "cancel log:improbable:2:8:if", 785);
|
||||
set(ConfPaths.COMBINED_IMPROBABLE_ACTIONS, "cancel vl>10 log:improbable:8:9:if cancel vl>1500 cancel log:improbable:0:10:if cmdc:kickimprobable:0:10 cmdc:clearimprobable:0:10", 1154);
|
||||
|
||||
set(ConfPaths.COMBINED_INVULNERABLE_CHECK, true, 785); // Not a check type yet.
|
||||
set(ConfPaths.COMBINED_INVULNERABLE_TRIGGERS_ALWAYS, false, 785);
|
||||
@@ -310,78 +323,92 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.COMBINED_MUNCHHAUSEN_ACTIONS, "cancel vl>100 cancel log:munchhausen:0:60:if", 785);
|
||||
|
||||
// (No active flag set !?)
|
||||
set(ConfPaths.COMBINED_YAWRATE_RATE , 380, 785);
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_FACTOR, 1.0, 785);
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_MIN, 250, 785);
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_MAX, 2000, 785);
|
||||
set(ConfPaths.COMBINED_YAWRATE_IMPROBABLE, true, 785);
|
||||
set(ConfPaths.COMBINED_YAWRATE_RATE , 290, 1154); // Old limit: 360
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_FACTOR, 2.0, 1154); // 1.0
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_MIN, 450, 1154); // 250
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_MAX, 2500, 1154); // 1500
|
||||
set(ConfPaths.COMBINED_YAWRATE_IMPROBABLE_FEEDONLY, false, 1154);
|
||||
set(ConfPaths.COMBINED_YAWRATE_IMPROBABLE_WEIGHT, 90.0, 1154); // 100.0
|
||||
// set(ConfPaths.COMBINED_YAWRATE_IMPROBABLE, true, 785);
|
||||
|
||||
// FIGHT
|
||||
set(ConfPaths.FIGHT_ACTIVE, "default", 1144);
|
||||
|
||||
set(ConfPaths.FIGHT_CANCELDEAD, true, 785);
|
||||
set(ConfPaths.FIGHT_TOOLCHANGEPENALTY, 500L, 785);
|
||||
set(ConfPaths.FIGHT_MAXLOOPLETENCYTICKS, 8, 1154);
|
||||
set(ConfPaths.FIGHT_TOOLCHANGEPENALTY, 0L, 1154); // Disabled for now, it interferes too much with pvp. 500L
|
||||
set(ConfPaths.FIGHT_PVP_KNOCKBACKVELOCITY, "default", 785);
|
||||
|
||||
set(ConfPaths.FIGHT_YAWRATE_CHECK, true, 785); // Not a check type.
|
||||
|
||||
set(ConfPaths.FIGHT_ANGLE_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_MOVE, 50, 1153);
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_TIME, 50, 1153);
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_YAW, 50, 1153);
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_MOVE, 100, 1154); // Move is problematic with mob grinders and in a 2 VS 1 scenario.
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_TIME, 200, 1154); // Time is problematic with mob grinders and in a 2 VS 1 scenario.
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_YAW, 60, 1154);
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_SWITCH, 50, 1153);
|
||||
set(ConfPaths.FIGHT_ANGLE_ACTIONS, "cancel vl>100 log:angle:3:5:f cancel vl>250 log:angle:0:5:cif cancel", 785);
|
||||
set(ConfPaths.FIGHT_ANGLE_ACTIONS, "cancel vl>100 log:angle:4:5:i cancel vl>500 log:angle:0:20:if cancel", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_CRITICAL_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_CRITICAL_FALLDISTANCE, 0.06251, 785);
|
||||
set(ConfPaths.FIGHT_CRITICAL_ACTIONS, "cancel vl>50 log:critical:0:5:cif cancel", 785);
|
||||
// Old value: 0.06251. NCP seems to be unable to catch packet-critical cheats with this value, although it has nearly no false positives.
|
||||
set(ConfPaths.FIGHT_CRITICAL_FALLDISTANCE, 0.075, 785);
|
||||
set(ConfPaths.FIGHT_CRITICAL_ACTIONS, "vl>2 cancel vl>50 cancel log:critical:10:9:i vl>100 cancel cmd:clearcritical:0:10", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_DIRECTION_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_DIRECTION_STRICT, false, 785);
|
||||
set(ConfPaths.FIGHT_DIRECTION_PENALTY, 500L, 785);
|
||||
set(ConfPaths.FIGHT_DIRECTION_ACTIONS,
|
||||
"cancel vl>5 log:fdirection:3:5:f cancel vl>20 log:fdirection:0:5:if cancel vl>50 log:fdirection:0:5:cif cancel", 785);
|
||||
set(ConfPaths.FIGHT_DIRECTION_STRICT, true, 1154);
|
||||
set(ConfPaths.FIGHT_DIRECTION_FAILALL, true, 1154);
|
||||
set(ConfPaths.FIGHT_DIRECTION_PENALTY, 75L, 1154);
|
||||
set(ConfPaths.FIGHT_DIRECTION_ACTIONS, "vl>2 log:fdirectionlowvl:9:10:i vl>5 log:fdirectionlowvl:5:4:i vl>10 cancel log:fdirection:2:4:if vl>50 cancel log:fdirection:0:7:icf cmdc:kicksuspiciouscombat:1:5", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_FASTHEAL_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_FASTHEAL_INTERVAL, 4000L, 785);
|
||||
set(ConfPaths.FIGHT_FASTHEAL_BUFFER, 1000L, 785);
|
||||
set(ConfPaths.FIGHT_FASTHEAL_ACTIONS, "cancel vl>10 cancel log:fastheal:0:10:i vl>30 cancel log:fastheal:0:10:if", 785);
|
||||
set(ConfPaths.FIGHT_FASTHEAL_ACTIONS, "cancel vl>10 cancel log:fastheal:2:6:i vl>30 cancel log:fastheal:1:1:i vl>90 cancel log:fastheal:0:10:if cmdc:kickfastheal:0:10", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_GODMODE_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_GODMODE_LAGMINAGE, 1100, 785); // TODO: ndt/2 => 500-600.
|
||||
set(ConfPaths.FIGHT_GODMODE_LAGMAXAGE, 5000, 785);
|
||||
set(ConfPaths.FIGHT_GODMODE_ACTIONS, "log:godmode:2:5:if cancel vl>60 log:godmode:2:5:icf cancel", 785); // cmd:kickgod", 785);
|
||||
set(ConfPaths.FIGHT_GODMODE_ACTIONS, "cancel log:godmode:0:5:icf cmdc:kickgod:0:5", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_NOSWING_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_NOSWING_ACTIONS, "cancel vl>10 log:noswing:0:5:if cancel", 785);
|
||||
set(ConfPaths.FIGHT_NOSWING_ACTIONS, "vl>2 cancel vl>10 log:noswing:1:5:i cancel", 1154);
|
||||
// TODO: Merge @CaptainObvious' pitchpattern check in this fork.
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_CHECK, "default", 1153);
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_ALWAYSACTIVE, false, 1154); // <- Cinematic/Zoom-like mods issue.
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_LIMIT, 10F, 1153);
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_SAMPLE, 35, 1154);
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_DIFF, 0.001D, 1153);
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_DELTAGCD, 0.00001F, 1153);
|
||||
//set(ConfPaths.FIGHT_PITCHPATTERN_ACTIONS, "vl>2 cancel vl>10 cancel log:pitchpattern:5:6:i vl>100 cancel log:pitchpattern:0:10:icf cmdc:kickillegalrotations:3:10", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_REACH_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_REACH_SURVIVALDISTANCE, 4.4, 785);
|
||||
set(ConfPaths.FIGHT_REACH_PENALTY, 500, 785);
|
||||
set(ConfPaths.FIGHT_REACH_SURVIVALDISTANCE, 4.22, 1154); // 4.4
|
||||
set(ConfPaths.FIGHT_REACH_PENALTY, 250, 1154);
|
||||
set(ConfPaths.FIGHT_REACH_REDUCE, true, 785);
|
||||
set(ConfPaths.FIGHT_REACH_REDUCEDISTANCE, 0.9, 785);
|
||||
set(ConfPaths.FIGHT_REACH_REDUCESTEP, 0.15, 785);
|
||||
set(ConfPaths.FIGHT_REACH_ACTIONS, "cancel vl>10 log:freach:2:5:if cancel", 785);
|
||||
set(ConfPaths.FIGHT_REACH_IMPROBABLE_FEEDONLY, false, 1154);
|
||||
set(ConfPaths.FIGHT_REACH_IMPROBABLE_WEIGHT, 2.0, 1154);
|
||||
set(ConfPaths.FIGHT_REACH_ACTIONS, "vl>1 log:freach:8:9:i vl>5 cancel log:freach:2:6:if vl>12 cancel log:kreach:1:5:i vl>35 cancel log:kreach:0:5:if cmdc:kicksuspiciouscombat:2:1", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_SELFHIT_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_SELFHIT_ACTIONS, "log:fselfhit:0:5:if cancel vl>10 log:fselfhit:0:5:icf cancel cmd:kickselfhit", 785);
|
||||
set(ConfPaths.FIGHT_SELFHIT_EXCLUDEPROJECTILE, false, 1154);
|
||||
set(ConfPaths.FIGHT_SELFHIT_ACTIONS, "cancel log:fselfhit:0:5:icf cmdc:kickselfhit:0:5", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_SPEED_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_SPEED_LIMIT, 15, 785);
|
||||
set(ConfPaths.FIGHT_SPEED_ACTIONS, "cancel vl>50 log:fspeed:0:5:if cancel", 785);
|
||||
set(ConfPaths.FIGHT_SPEED_LIMIT, 15, 1154);
|
||||
set(ConfPaths.FIGHT_SPEED_ACTIONS, "cancel vl>20 cancel log:fspeed:2:5:i vl>80 cancel log:fspeed:1:1:if cmd:kickattackfrequency:0:10", 1154);
|
||||
set(ConfPaths.FIGHT_SPEED_SHORTTERM_TICKS, 7, 785);
|
||||
set(ConfPaths.FIGHT_SPEED_SHORTTERM_LIMIT, 6, 785);
|
||||
|
||||
set(ConfPaths.FIGHT_WRONGTURN_CHECK, "default", 1143);
|
||||
set(ConfPaths.FIGHT_WRONGTURN_ACTIONS, "cancel cmd:kick_wrongturn log:log_wrongturn:0:15:fci", 1143);
|
||||
set(ConfPaths.FIGHT_SPEED_SHORTTERM_LIMIT, 5, 1154);
|
||||
set(ConfPaths.FIGHT_SPEED_IMPROBABLE_FEEDONLY, false, 1154);
|
||||
set(ConfPaths.FIGHT_SPEED_IMPROBABLE_WEIGHT, 2.0, 1154);
|
||||
|
||||
|
||||
set(ConfPaths.INVENTORY_ACTIVE, "default", 1144);
|
||||
|
||||
set(ConfPaths.INVENTORY_DROP_CHECK, "default", 785);
|
||||
set(ConfPaths.INVENTORY_DROP_LIMIT, 100, 785);
|
||||
set(ConfPaths.INVENTORY_DROP_LIMIT, 10, 1154);
|
||||
set(ConfPaths.INVENTORY_DROP_TIMEFRAME, 20L, 785);
|
||||
set(ConfPaths.INVENTORY_DROP_ACTIONS, "log:drop:0:1:cif cancel cmd:dropkick:0:1", 785);
|
||||
set(ConfPaths.INVENTORY_DROP_ACTIONS, "log:drop:0:5:if cancel cmdc:dropkick:0:5", 1154);
|
||||
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_CHECK, "default", 785);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_EXCLUDE, Arrays.asList("Inventory Name Here"), 1154);
|
||||
@@ -389,31 +416,34 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_TWEAKS1_5, true, 785);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_LIMIT_SHORTTERM, 4, 785);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_LIMIT_NORMAL, 15, 785);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_LIMIT_CHEST, 152, 1154);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_ACTIONS, "cancel vl>50 log:fastclick:3:5:cif cancel", 785);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_LIMIT_CHEST, 155, 1154);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_IMPROBABLE_WEIGHT, 0.7, 1154);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_ACTIONS, "cancel vl>200 cancel log:fastclick:7:5:i vl>600 cancel log:fastclick:1:5:if vl>5000 cancel log:fastclick:1:2:if cmdc:kickfastclick:2:15", 1154);
|
||||
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_CHECK, "default", 785);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_STRICT, true, 785);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_DELAY, 130, 785);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_DELAY, 75, 1154);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_IMPROBABLE_FEEDONLY, false, 1085);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_IMPROBABLE_WEIGHT, 0.6, 1085);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_ACTIONS, "cancel vl>15 log:instantbow:2:5:if cancel", 785);
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_ACTIONS, "cancel vl>15 cancel log:instantbow:4:5:i vl>200 cancel log:instantbow:0:10:if cmdc:kickbow:2:10", 1154);
|
||||
|
||||
// TODO: Set this to false as default?
|
||||
set(ConfPaths.INVENTORY_INSTANTEAT_CHECK, "default", 785);
|
||||
set(ConfPaths.INVENTORY_INSTANTEAT_ACTIONS, "log:instanteat:2:5:if cancel", 785);
|
||||
set(ConfPaths.INVENTORY_INSTANTEAT_ACTIONS, "log:instanteat:2:5:i cancel", 1154);
|
||||
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_CHECK, "default", 785);
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_DURATION, 0.7, 785);
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_DURATION, 1.4, 1154); // The actual consumption time needed would be 1.5s. Set to 1.4 for leniency
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_WHITELIST, false, 785);
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_ITEMS, new LinkedList<String>(), 785);
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_ACTIONS, "log:fastconsume:2:5:if cancel", 785);
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_ITEMS, Arrays.asList("DRIED_KELP"), 1154);
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_ACTIONS, "cancel vl>2 log:fastconsume:2:5:if cancel vl>35 cancel log:fastconsume:0:5:if cmdc:kickfastconsume:0:5", 1154);
|
||||
|
||||
set(ConfPaths.INVENTORY_INVENTORYMOVE_CHECK, "default", 1153);
|
||||
set(ConfPaths.INVENTORY_INVENTORYMOVE_ACTIONS, "log:inventorymove:2:5:if cancel", 785);
|
||||
set(ConfPaths.INVENTORY_INVENTORYMOVE_DISABLECREATIVE, true, 1153);
|
||||
set(ConfPaths.INVENTORY_INVENTORYMOVE_ACTIONS, "log:inventorymove:2:5:i cancel", 1154);
|
||||
|
||||
set(ConfPaths.INVENTORY_GUTENBERG_CHECK, "default", 785);
|
||||
set(ConfPaths.INVENTORY_GUTENBERG_PAGELIMIT, 50, 1154);
|
||||
set(ConfPaths.INVENTORY_GUTENBERG_ACTIONS, "cancel log:gutenberg:0:10:icf cmd:kickinvaliddata", 785);
|
||||
set(ConfPaths.INVENTORY_GUTENBERG_ACTIONS, "cancel log:gutenberg:0:10:if cmdc:kickinvaliddata:0:5", 1154);
|
||||
|
||||
set(ConfPaths.INVENTORY_ITEMS_CHECK, "default", 785);
|
||||
|
||||
@@ -423,12 +453,12 @@ public class DefaultConfig extends ConfigFile {
|
||||
|
||||
set (ConfPaths.INVENTORY_HOTFIX_DUPE_FALLINGBLOCKENDPORTAL, true, 785);
|
||||
|
||||
// MOVING
|
||||
/* Moving ! */
|
||||
set(ConfPaths.MOVING_ACTIVE, "default", 1144);
|
||||
|
||||
// CreativeFly
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_CHECK, "default", 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_IGNOREALLOWFLIGHT, true, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_IGNORECREATIVE, false, 785); // TODO: -> true ?
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_IGNORECREATIVE, false, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "creative." + ConfPaths.SUB_HORIZONTAL_SPEED, 100, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "creative." + ConfPaths.SUB_VERTICAL_ASCEND_SPEED, 100, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "creative." + ConfPaths.SUB_VERTICAL_MAXHEIGHT, 128, 785);
|
||||
@@ -448,29 +478,41 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "levitation." + ConfPaths.SUB_GRAVITY, false, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "levitation." + ConfPaths.SUB_GROUND, false, 785);
|
||||
}
|
||||
if (Bridge1_13.hasSlowfalling()) {
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "slowfalling." + ConfPaths.SUB_HORIZONTAL_SPEED, 110, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "slowfalling." + ConfPaths.SUB_VERTICAL_ASCEND_SPEED, 10, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "slowfalling." + ConfPaths.SUB_VERTICAL_MAXHEIGHT, 128, 1104);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "slowfalling." + ConfPaths.SUB_VERTICAL_GRAVITY, false, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "slowfalling." + ConfPaths.SUB_MODIFIERS, false, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "slowfalling." + ConfPaths.SUB_GRAVITY, true, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "slowfalling." + ConfPaths.SUB_GROUND, true, 785);
|
||||
}
|
||||
if (Bridge1_9.hasElytra()) {
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "elytra." + ConfPaths.SUB_HORIZONTAL_SPEED, 520, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "elytra." + ConfPaths.SUB_HORIZONTAL_MODSPRINT, 1.0, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "elytra." + ConfPaths.SUB_VERTICAL_ASCEND_SPEED, 0, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "elytra." + ConfPaths.SUB_VERTICAL_MAXHEIGHT, 128, 1104);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_MODEL + "elytra." + ConfPaths.SUB_MODIFIERS, false, 785);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_EYTRA_FWRESET, false, 1154);
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_EYTRA_STRICT, false, 1154);
|
||||
}
|
||||
set(ConfPaths.MOVING_CREATIVEFLY_ACTIONS,
|
||||
"log:flyfile:3:5:f cancel"
|
||||
+ " vl>100 log:flyshort:0:5:i log:flyfile:0:5:f cancel"
|
||||
+ " vl>400 log:flylong:0:5:i log:flyfile:0:5:cf cancel"
|
||||
, 1080);
|
||||
|
||||
"cancel log:flyfile:3:5:f"
|
||||
+ " vl>100 cancel log:creativefly:8:9:i log:flyfile:0:10:f"
|
||||
+ " vl>900 cancel log:creativefly:2:4:i log:flyfile:0:5:cf"
|
||||
+ " vl>2000 cancel log:creativefly:0:5:icf cmdc:kickfly:0:15 cmd:clearcf:0:15"
|
||||
, 1154);
|
||||
// MorePackets
|
||||
set(ConfPaths.MOVING_MOREPACKETS_CHECK, "default", 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_SECONDS, 6, 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_EPSIDEAL, 20, 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_EPSMAX, 22, 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_BURST_PACKETS, 40, 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_BURST_DIRECT, 60, 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_BURST_EPM, 180, 785);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_SETBACKAGE, 40, 1091);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_ACTIONS, "cancel vl>10 log:morepackets:0:2:if cancel vl>100 log:morepackets:0:2:if cancel cmd:kickpackets", 785);
|
||||
|
||||
set(ConfPaths.MOVING_MOREPACKETS_BURST_EPM, 120, 1154);
|
||||
set(ConfPaths.MOVING_MOREPACKETS_SETBACKAGE, 70, 1154); // 40
|
||||
set(ConfPaths.MOVING_MOREPACKETS_ACTIONS, "cancel vl>2 cancel log:morepackets:10:9:i vl>100 cancel log:morepackets:0:2:ifc cmdc:kickpackets:2:10", 1154);
|
||||
// NoFall
|
||||
set(ConfPaths.MOVING_NOFALL_CHECK, "default", 785);
|
||||
set(ConfPaths.MOVING_NOFALL_DEALDAMAGE, true, 785);
|
||||
set(ConfPaths.MOVING_NOFALL_SKIPALLOWFLIGHT, true, 785);
|
||||
@@ -478,37 +520,44 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.MOVING_NOFALL_RESETONTP, false, 785);
|
||||
set(ConfPaths.MOVING_NOFALL_RESETONVEHICLE, true, 785);
|
||||
set(ConfPaths.MOVING_NOFALL_ANTICRITICALS, true, 785);
|
||||
set(ConfPaths.MOVING_NOFALL_ACTIONS, "log:nofall:0:5:if cancel vl>30 log:nofall:0:5:icf cancel", 785);
|
||||
|
||||
set(ConfPaths.MOVING_NOFALL_ACTIONS, "cancel vl>2 cancel log:nofall:0:5:if", 1154); //vl>6 cancel log:nofall:0:1:if cmdc:kickfly:0:5", 1154);
|
||||
// Passable
|
||||
set(ConfPaths.MOVING_PASSABLE_CHECK, "default", 785);
|
||||
set(ConfPaths.MOVING_PASSABLE_ACTIONS, "cancel vl>10 log:passable:0:5:if cancel vl>50 log:passable:0:5:icf cancel", 785);
|
||||
set(ConfPaths.MOVING_PASSABLE_ACTIONS, "cancel vl>15 cancel log:passable:7:9:i vl>100 cancel log:passable:1:4:if cmd:clearpassable:3:15", 1154);
|
||||
set(ConfPaths.MOVING_PASSABLE_UNTRACKED_TELEPORT_ACTIVE, true, 785);
|
||||
set(ConfPaths.MOVING_PASSABLE_UNTRACKED_CMD_ACTIVE, true, 785);
|
||||
set(ConfPaths.MOVING_PASSABLE_UNTRACKED_CMD_TRYTELEPORT, true, 785);
|
||||
set(ConfPaths.MOVING_PASSABLE_UNTRACKED_CMD_PREFIXES, Arrays.asList("sethome", "home set", "setwarp", "warp set", "setback", "set back", "back set"), 785);
|
||||
|
||||
set(ConfPaths.MOVING_PASSABLE_UNTRACKED_CMD_PREFIXES, Arrays.asList("sethome", "home set", "setwarp", "warp set", "setback", "set back", "back set", "warp", "home", "tp" ), 1154);
|
||||
// SurvivalFly
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_CHECK, "default", 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_STEPHEIGHT, "default", 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_VACC, true, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_LENIENCY_HBUFMAX, 1.0, 1143);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_LENIENCY_HBUFMAX, 0.5, 1154);
|
||||
// SurvivalFly ViolationFrequencyHook
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_ACTIVE, true, 1154);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_DEBUG, false, 1154);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_MAXTOTALVLS, 35, 1154);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_MINADDEDVLS, 5, 1154);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_MOREVLS, 5, 1154);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_VLFREQUENCY_MOVECOUNT, 10, 1154);
|
||||
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_LENIENCY_FREEZECOUNT, 40, 1144);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_LENIENCY_FREEZEINAIR, true, 1143);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_SETBACKPOLICY_FALLDAMAGE, true, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_SETBACKPOLICY_VOIDTOVOID, true, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_ACTIONS,
|
||||
"log:flyfile:3:10:f cancel"
|
||||
+ " vl>100 log:flyshort:0:10:i log:flyfile:0:10:f cancel"
|
||||
+ " vl>400 log:flylong:0:5:i log:flyfile:0:5:cf cancel"
|
||||
+ " vl>1500 log:flylong:0:5:i log:flyfile:0:5:cf cancel cmd:kickfly"
|
||||
, 1080);
|
||||
|
||||
// sf / hover check.
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_SETBACKPOLICY_VOIDTOVOID, false, 1154);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_ACTIONS, "cancel log:flyfile:6:15:f"
|
||||
+ " vl>50 cancel log:survivalfly:13:9:i log:flyfile:6:15:f"
|
||||
+ " vl>300 cancel log:survivalfly:7:8:i log:flyfile:1:3:f"
|
||||
+ " vl>830 cancel log:survivalflyhighvl:4:9:i log:flyfile:2:3:f"
|
||||
+ " vl>1500 cancel log:survivalflyhighvl:3:4:i log:flyfile:1:2:f"
|
||||
+ " vl>2100 cancel log:survivalflyhighvl:0:4:icf cmdc:kickfly:0:15 cmd:clearsf:0:15", 1154);
|
||||
// SurvivalFly - Hover Subcheck
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_CHECK, true, 785); // Not a check type yet.
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_STEP, 5, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_TICKS, 85, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_LOGINTICKS, 60, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_FALLDAMAGE, true, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_SFVIOLATION, 500, 785);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_SFVIOLATION, 200, 1154); // Old VL: 500
|
||||
|
||||
// Moving Trace
|
||||
//set(ConfPaths.MOVING_TRACE_MAXAGE, 200, 785); // Your grandma reads code.
|
||||
@@ -539,48 +588,56 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.MOVING_VEHICLE_SCHEDULESETBACKS, "default", 785);
|
||||
|
||||
set(ConfPaths.MOVING_VEHICLE_MOREPACKETS_CHECK, "default", 785);
|
||||
set(ConfPaths.MOVING_VEHICLE_MOREPACKETS_ACTIONS, "cancel vl>10 log:morepackets:0:2:if cancel", 785);
|
||||
set(ConfPaths.MOVING_VEHICLE_MOREPACKETS_ACTIONS, "cancel vl>2 log:morepackets:2:5:if cancel vl>100 cancel log:morepackets:1:2:if cmdc:kickpackets:2:10", 1154);
|
||||
|
||||
set(ConfPaths.MOVING_VEHICLE_ENVELOPE_ACTIVE, "default", 785);
|
||||
set(ConfPaths.MOVING_VEHICLE_ENVELOPE_ACTIONS, "cancel vl>100 cancel log:vehicleenvelope:0:15:icf", 785);
|
||||
set(ConfPaths.MOVING_VEHICLE_ENVELOPE_HSPEEDCAP + ".default", 0.9, 1154);
|
||||
set(ConfPaths.MOVING_VEHICLE_ENVELOPE_HSPEEDCAP + ".pig", 0.3, 1154);
|
||||
set(ConfPaths.MOVING_VEHICLE_ENVELOPE_ACTIONS, "cancel vl>50 cancel log:vehicleenvelope:10:6:if vl>300 cancel log:vehicleenvelope:0:10:icf cmdc:kickvehiclefly:0:10 cmd:clearvehicle:0:15", 1154);
|
||||
|
||||
// Messages
|
||||
set(ConfPaths.MOVING_MESSAGE_ILLEGALPLAYERMOVE, "Illegal move.", 785);
|
||||
set(ConfPaths.MOVING_MESSAGE_ILLEGALVEHICLEMOVE, "Illegal vehicle move.", 785);
|
||||
|
||||
|
||||
// NET
|
||||
/* Net */
|
||||
|
||||
set(ConfPaths.NET_ACTIVE, "default", 1144);
|
||||
|
||||
// AttackFrequency
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_ACTIVE, "default", 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_HALF, 10, 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_ONE, 15, 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_HALF, 8, 1154); // 10
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_ONE, 15, 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_TWO, 30, 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_FOUR, 60, 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_EIGHT, 100, 785);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_ACTIONS, "cancel vl>30 cancel log:attackfrequency:0:5:if vl>160 cancel log:attackfrequency:0:0:cif cmd:kickattackfrequency", 785);
|
||||
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_EIGHT, 95, 1154); //100
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_IMPROBABLE_WEIGHT, 3.0, 1154);
|
||||
set(ConfPaths.NET_ATTACKFREQUENCY_ACTIONS, "cancel vl>10 cancel log:attackfrequency:4:5:i vl>200 cancel log:attackfrequency:0:4:if cmdc:kickattackfrequency", 1154);
|
||||
|
||||
// FlyingFrequency
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_ACTIVE, "default", 785);
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_SECONDS, 5, 785);
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_PACKETSPERSECOND, 60, 785);
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_ACTIONS, "cancel", 785); // TODO: Log actions.
|
||||
// Observed: when a flying packet gets canceled, the position of the player won't get updated to the server
|
||||
// but they will still be able to move client-side; this will result in a server-sided freeze.
|
||||
// When the player thaws out of this state, (presumably) their position will update in a rather fast sequence, which SurvivalFly
|
||||
// really seems to dislike. (Players can sometimes reach 1000+ VLs(!))
|
||||
// Thus, lower Flyingfrequency violation should not be immediately canceled, 20 seems a reasonable threshold through testing.
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_ACTIONS, "vl>20 cancel log:flyingfrequency:3:2:i vl>500 cancel log:flyingfrequency:0:5:if vl>1000 cancel log:flyingfrequency:0:2:icf cmdc:kickflyingfrequency:0:10", 1154);
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_REDUNDANT_ACTIVE, true, 785);
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_REDUNDANT_SECONDS, 3, 785);
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_REDUNDANT_ACTIONS, "cancel", 785); // TODO: Log actions.
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_REDUNDANT_ACTIONS, "cancel", 785);
|
||||
|
||||
// KeepAliveFrequency
|
||||
set(ConfPaths.NET_KEEPALIVEFREQUENCY_ACTIVE, "default", 785);
|
||||
set(ConfPaths.NET_KEEPALIVEFREQUENCY_SECONDS, 20, 1153);
|
||||
set(ConfPaths.NET_KEEPALIVEFREQUENCY_ACTIONS, "cancel vl>10 cancel log:keepalive:0:10:if vl>40 cancel log:keepalive:0:10:icf vl>100 cancel log:keepalive:0:10:icf cmd:kickalive", 785);
|
||||
set(ConfPaths.NET_KEEPALIVEFREQUENCY_ACTIONS, "cancel vl>10 cancel log:keepalive:2:6:i vl>60 cancel log:keepalive:0:10:icf cmdc:kickalive", 1154);
|
||||
|
||||
// PacketFrequency (pre 1.9).
|
||||
set(ConfPaths.NET_PACKETFREQUENCY_ACTIVE, "default", 785);
|
||||
set(ConfPaths.NET_PACKETFREQUENCY_PPS, 200, 785);
|
||||
set(ConfPaths.NET_PACKETFREQUENCY_PPS, 300, 1154); // Old limit: 200, legit 1.8 clients seem to be able to reach such value more often than not...
|
||||
set(ConfPaths.NET_PACKETFREQUENCY_SECONDS, 4, 785);
|
||||
set(ConfPaths.NET_PACKETFREQUENCY_ACTIONS, "cancel cmd:kickpacketfrequency", 785);
|
||||
set(ConfPaths.NET_PACKETFREQUENCY_ACTIONS, "cancel vl>2 cancel cmdc:kickpacketfrequency", 1154);
|
||||
|
||||
// SoundDistance
|
||||
set(ConfPaths.NET_SOUNDDISTANCE_ACTIVE, "default", 785);
|
||||
@@ -588,88 +645,113 @@ public class DefaultConfig extends ConfigFile {
|
||||
|
||||
// Superseded
|
||||
set(ConfPaths.NET_SUPERSEDED_FLYING_CANCELWAITING, true, 1090);
|
||||
|
||||
set(ConfPaths.NET_WRONGTURN_ACTIVE, "default", 1154);
|
||||
set(ConfPaths.NET_WRONGTURN_ACTIONS, "cancel cmdc:kickillegalrotations:0:10 log:wrongturn:0:15:i", 1154);
|
||||
|
||||
|
||||
// TODO: An extra file might suit these.
|
||||
final String start = "[player] failed [check]: ";
|
||||
final String end = ". VL [violations].";
|
||||
final String tell = "ncp tell [player] ";
|
||||
set(ConfPaths.STRINGS + ".angle", start + "tried to hit multiple entities at the same time" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".attackfrequency", start + "attacks with too high a frequency ([packets]/[limit], [tags])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".ban", "ban [player]", 785);
|
||||
set(ConfPaths.STRINGS + ".ban-ip", "ban-ip [ip]", 785);
|
||||
set(ConfPaths.STRINGS + ".bautosign", start + "failed autosign with [tags]" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bbfrequency", start + "tried to break too many blocks within time frame" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bdirection", start + "tried to interact with a block out of their line of sight" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bedleave", start + "sends bed leave packets (was not in bed)" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bpspeed", start + "tried to throw projectiles too quickly" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".breach", start + "exceeds block-interact distance ([reachdistance])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bspeed", start + "interacts too fast" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bvisible", start + "interacts with a block out of sight" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".bwrong", start + "broke another block than clicked" + end, 785);
|
||||
final String start = "&c[player]&7 failed &c[check]&7: ";
|
||||
final String end = " &7(&cVL[violations]&7)";
|
||||
final String tell = "ncp tell [player] &c&l(!)&7 ";
|
||||
final String clear = "ncp delay delay=2 ncp removeplayer [player] ";
|
||||
final String kick = "ncp kick [player] &c&l(!)&7 ";
|
||||
set(ConfPaths.STRINGS + ".against", start + "tried to place a block against liquid blocks or air as if they were solid" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".angle", start + "potentially tried to hit multiple entities at the same time (Tags: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".attackfrequency", start + "seems to be using an autoclicker (Clicks: &6[packets]&7/LimitPerTime-frame:&7[limit]&7, &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bautosign", start + "tried to use the autosign hack (Subcheck: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bbfrequency", start + "tried to break too many blocks at once" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bdirection", start + "tried to interact with a block out of their line of sight" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bedleave", start + "tried to send fake bed leave packets (was not in/near a bed)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bpspeed", start + "tried to throw projectiles too quickly" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".breach", start + "tried to interact with a block too far away" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bspeed", start + "is interacting with blocks beyond legit speeds" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bvisible", start + "tried to interact with a block through a solid obstacle" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".bwrong", start + "tried to break another block than interacted with last" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".captcha", "[player] failed captcha repeatedly" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".chatnormal", start + "potentially annoying chat" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".color", start + "sent colored chat message" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".commands", start + "issued too many commands" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".combspeed", start + "performs different actions at very high speed" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".critical", start + "tried to do a critical hit but wasn't technically jumping [tags]" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".chatfast", start + "acted like spamming (message deleted) (IP: &6[ip]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".chatnormal", start + "seems to be spamming the server chat" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".commands", start + "issued too many commands too quickly" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".creativefly", start + "tried to move unexpectedly while in air (Tags: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".critical", start + "tried to perform an illegal critical hit (Tags: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".drop", start + "tried to drop more items than allowed" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".dropkick", "ncp delay ncp kick [player] Dropping items too fast.", 785);
|
||||
set(ConfPaths.STRINGS + ".fastbreak", start + "tried to break blocks ([blocktype]) faster than possible" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".dropkick", kick + "Dropping items too fast.", 1154);
|
||||
set(ConfPaths.STRINGS + ".fastbreak", start + "tried to break a block faster than possible (Block: &6[blocktype]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fastclick", start + "tried to move items in their inventory too quickly" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fastconsume", start + "consumes [food] [tags] too fast" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fastheal", start + "regenerates health faster than usual (health [health])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fastplace", start + "tried to place too many blocks" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fdirection", start + "tried to hit an entity out of line of sight" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".flyshort", start + "tried to move unexpectedly" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".flylong", start
|
||||
+ "tried to move: [locationfrom] -> [locationto], d=[distance] ([tags])" + end, 1067);
|
||||
set(ConfPaths.STRINGS + ".flyfile", start
|
||||
+ "tried to move: [locationfrom] -> [locationto], d=[distance] ([tags])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".freach", start + "tried to attack entity out of reach" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fselfhit", start + "tried to self-hit" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fspeed", start + "tried to attack with too high a frequency" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".fastconsume", start + "tried to consume an item too quickly (Food: &6[food][tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fastheal", start + "tried to regenerate their health bar faster than possible (Health: &6health]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fastplace", start + "tried to place blocks too quickly" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fdirection", start + "tried to hit an entity outside their line of sight" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fdirectionlowvl", start + "could be using an aimbot (hit not canceled)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".flyfile", start + "tried to perform an illegal move from ([locationfrom]) to ([locationto]) over a distance of ([distance]) blocks, subchecks triggered> ([tags])" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".flyingfrequency", start + "is manipulating packets sent to the server to gain an unfair advantage" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".freach", start + "tried to hit an entity from a suspicious distance" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fselfhit", start + "tried to hit themselves" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".fspeed", start + "clicked [violations] times over the established CPS limit" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".godmode", start + "tried to ignore inflicted damage (Health: &7[health]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".gutenberg", start + "created a book with too many pages" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".godmode", start + "avoided taking damage or lagging (health [health])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".improbable", start + "meets the improbable more than expected" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".instantbow", start + "fires bow too fast" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".instanteat", start + "eats food [food] too fast" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".inventorymove", start + "interacted with inventory while it was not possible" + end, 1153);
|
||||
set(ConfPaths.STRINGS + ".keepalive", start + "spams keep-alive packets (god/freecam?)" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".kick", "kick [player]", 785);
|
||||
set(ConfPaths.STRINGS + ".kickalive", "ncp kick [player] Too many keep-alive packets.", 785);
|
||||
set(ConfPaths.STRINGS + ".kickattackfrequency", "ncp kick [player] Unlikely fast clicking.", 785);
|
||||
set(ConfPaths.STRINGS + ".kickbedleave", "ncp delay ncp kick [player] Go find a bed!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickbspeed", "ncp kick [player] You interacted too fast!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickcaptcha", "ncp kick [player] Enter the captcha!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickchat1", "ncp tempkick [player] 1 You're still not allowed to spam!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickchat5", "ncp tempkick [player] 5 You're not intended to spam!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickchatfast", "ncp kick [player] You're not allowed to spam in chat!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickchatnormal", "ncp kick [player] Too many chat messages, take a break.", 785);
|
||||
set(ConfPaths.STRINGS + ".kickcommands", "ncp tempkick [player] 1 You're not allowed to spam commands!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickfly", "ncp delay ncp kick [player] Kicked for flying (or related)", 785);
|
||||
set(ConfPaths.STRINGS + ".kickfrequency", "ncp kick [player] You did something too fast!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickgod", "ncp kick [player] God mode?", 785);
|
||||
set(ConfPaths.STRINGS + ".kickinvaliddata", "ncp kick [player] Invalid data.", 785);
|
||||
set(ConfPaths.STRINGS + ".kickpacketfrequency", "ncp kick [player] Too many packets.", 785); // TODO
|
||||
set(ConfPaths.STRINGS + ".kickpackets", "ncp delay ncp kick [player] Too many packets (extreme lag?)", 785);
|
||||
set(ConfPaths.STRINGS + ".kickselfhit", "ncp kick [player] You tried to hit yourself!", 785);
|
||||
set(ConfPaths.STRINGS + ".kickwb", "ncp kick [player] Block breaking out of sync!", 785);
|
||||
set(ConfPaths.STRINGS + ".kick_wrongturn", "ncp kick [player] Wrong turn!", 1143);
|
||||
set(ConfPaths.STRINGS + ".knockback", start + "tried to do a knockback but wasn't technically sprinting" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".log_wrongturn", start + "looked wrongly" + end, 1143);
|
||||
set(ConfPaths.STRINGS + ".morepackets", start + "sent too many moves ([packets] [tags])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".improbable", start + "is exhibiting an erratic behaviour (Check: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".instantbow", start + "tried to shoot an arrow too fast" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".instanteat", start + "tried to consume an item too quickly (Food: &6[food]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".inventorymove", start + "tried to click in their inventory while simultaneously performing another action (Tags: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".keepalive", start + "is spamming keep-alive packets to the server" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".kickagainst", kick + "Invalid block placements.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickalive", kick + "Too many keep-alive packets.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickattackfrequency", kick + "Unlikely fast clicking.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickbedleave", kick + "Invalid bed-leave packets.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickbow", kick + "Shooting arrows too quickly.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickbspeed", kick + "Too fast block interactions.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickcaptcha", kick + "Enter the captcha!", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickchat1", "ncp tempkick [player] 1 &c&l(!)&7 Do not spam the server chat (1 minute tempkick)", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickchat5", "ncp tempkick [player] 5 &c&l(!)&7 You are not allowed to spam the server chat (5 minutes tempkick)", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickchatfast", kick + "Stop spamming.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickchatnormal", kick + "Too many chat messages, take a break.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickcommands", "ncp tempkick [player] 1 &c&l(!)&7 Do not spam commands (1 minute tempkick)", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfastbreak", kick + "Breaking blocks too fast.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfastclick", kick + "Unlikely inventory interactions.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfastconsume", kick + "Using items too quickly.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfastheal", kick + "Too fast health regeneration.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfastplace", kick + "Placing blocks too quickly.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfly", kick + "Moved unexpectedly.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickflyingfrequency", kick + "Kicked for packet spam.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickfrequency", kick + "Illegal block-breaking frequency.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickgod", kick + "GodMode?", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickillegalblockinteract", kick + "Illegal block interactions.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickillegalrotations", kick + "Invalid rotations.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickimprobable", kick + "Illegal client modifications.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickinvaliddata", kick + "Invalid book data.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickpacketfrequency", kick + "Too many packets.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickpackets", kick + "You sent too many moves (extreme lag?)", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickscaffold", kick + "Incorrect block placements.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickselfhit", kick + "You tried to hit yourself!", 1154);
|
||||
set(ConfPaths.STRINGS + ".kicksuspiciouscombat", kick + "Illegal combat modifications.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickvehiclefly", kick + "Unexpected vehicle movement.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kickwb", kick + "Block breaking out of sync.", 1154);
|
||||
set(ConfPaths.STRINGS + ".kreach", start + "is most likely using a killaura cheat" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".morepackets", start + "sent too many moves (&cPackets&7/&cVL [packets]&7)", 1154);
|
||||
set(ConfPaths.STRINGS + ".msgtempdenylogin", "You are temporarily denied to join this server.", 785);
|
||||
set(ConfPaths.STRINGS + ".munchhausen", start + "almost made it off the pit" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".nofall", start + "tried to alter fall damage ([tags])" + end, 1057);
|
||||
set(ConfPaths.STRINGS + ".chatfast", start + "acted like spamming (IP: [ip])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".noswing", start + "didn't swing arm" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".passable", start + "moved into a block ([blocktype]) from [locationfrom] to [locationto] distance [distance] " + end, 785);
|
||||
set(ConfPaths.STRINGS + ".relog", start + "relogs too fast" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".tellchatnormal", tell + "&cNCP: &eToo many messages, slow down...", 785);
|
||||
set(ConfPaths.STRINGS + ".tempkick1", "ncp tempkick [player] 1 Wait a minute!", 785);
|
||||
set(ConfPaths.STRINGS + ".tempkick5", "ncp tempkick [player] 5 You have five minutes to think about it!", 785);
|
||||
set(ConfPaths.STRINGS + ".vehicleenvelope", start + "moved a vehicle too fast ([tags])" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".munchhausen", start + "tried to hit themeselves with a fishing rod too many times (the knockback can be potentially abused for bypasses)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".nofall", start + "tried to alter fall damage or fall distance (Tags: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".noswing", start + "didn't swing arm before performing their action" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".passable", start + "tried to move into a block (bugged player of phase cheat)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".pitchpattern", start + "has pitch rotation patterns that are often associated with cheats" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".relog", start + "tried to relog too fast" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".scaffold", start + "tried to place a block in an unnatural way (Tags: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".survivalfly", start + "tried to move unexpectedly" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".survivalflyhighvl", start + "tried to perform an illegal move (Subchecks: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".tellchatnormal", tell + "Too many messages, slow down...", 1154);
|
||||
set(ConfPaths.STRINGS + ".tempkick1", "ncp tempkick [player] 1 &c&l(!)&7 You have to wait 1 minute before joining this server again.", 1154);
|
||||
set(ConfPaths.STRINGS + ".tempkick5", "ncp tempkick [player] 5 &c&l(!)&7 You have to wait 5 minutes before joining this server again.", 1154);
|
||||
set(ConfPaths.STRINGS + ".vehicleenvelope", start + "tried to move a vehicle unexpectedly (Tags/Vehicle: &6[tags]&7)" + end, 1154);
|
||||
set(ConfPaths.STRINGS + ".wrongturn", start + "sent an impossible pitch rotation (&6>90 &7or&6 <-90&7)" + end, 1154);
|
||||
// Clear a check data
|
||||
set(ConfPaths.STRINGS + ".clearimprobable", clear + "COMBINED_IMPROBABLE", 1154);
|
||||
set(ConfPaths.STRINGS + ".clearsf", clear + "MOVING_SURVIVALFLY", 1154);
|
||||
set(ConfPaths.STRINGS + ".clearcf", clear + "MOVING_CREATIVEFLY", 1154);
|
||||
set(ConfPaths.STRINGS + ".clearpassable", clear + "MOVING_PASSABLE", 1154);
|
||||
set(ConfPaths.STRINGS + ".clearvehicle", clear + "MOVING_VEHICLE_ENVELOPE", 1154);
|
||||
set(ConfPaths.STRINGS + ".clearcritical", clear + "FIGHT_CRITICAL", 1154);
|
||||
set(ConfPaths.STRINGS + ".clearscaffold", clear + "BLOCKPLACE_SCAFFOLD", 1154);
|
||||
|
||||
// Compatibility settings.
|
||||
set(ConfPaths.COMPATIBILITY_EXEMPTIONS_WILDCARD_DEFAULT_METADATA_ACTIVE, true, 785);
|
||||
@@ -692,92 +774,7 @@ public class DefaultConfig extends ConfigFile {
|
||||
)) {
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + name, "default+ign_passable+ground_height", 785);
|
||||
}
|
||||
for (final String woodtype : Arrays.asList(
|
||||
"OAK",
|
||||
"SPRUCE",
|
||||
"BIRCH",
|
||||
"JUNGLE",
|
||||
"ACACIA",
|
||||
"DARK_OAK"
|
||||
)) {
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + woodtype + "_FENCE", "HEIGHT150+THICK_FENCE+VARIABLE+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "NETHER_BRICK_FENCE", "HEIGHT150+THICK_FENCE+VARIABLE+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + woodtype + "_FENCE_GATE", "PASSABLE_X4+VARIABLE_USE+HEIGHT150+THICK_FENCE+VARIABLE+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + woodtype + "_DOOR", "PASSABLE_X4+VARIABLE_USE+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "IRON_DOOR", "PASSABLE_X4+VARIABLE_USE+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + woodtype + "_SLAB", "default+GROUND+XZ100+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + woodtype + "_TRAPDOOR", "default+ign_passable+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "IRON_TRAPDOOR", "default+ign_passable+ground_height", 1154);
|
||||
} for (final String colors : Arrays.asList(
|
||||
"WHITE",
|
||||
"BLUE",
|
||||
"RED",
|
||||
"MAGENTA",
|
||||
"LIME",
|
||||
"YELLOW",
|
||||
"PINK",
|
||||
"GRAY",
|
||||
"BROWN",
|
||||
"GREEN",
|
||||
"LIGHT_BLUE",
|
||||
"CYAN",
|
||||
"PURPLE",
|
||||
"BLACK",
|
||||
"LIGHT_GRAY",
|
||||
"ORANGE"
|
||||
)) {
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + colors + "_BED", "default+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + colors + "_STAINED_GLASS_PANE", "THIN_FENCE+VARIABLE+ground_height+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + colors + "_SHULKER_BOX", "default+HEIGHT150+ground", 1154);
|
||||
} for (final String headType : Arrays.asList(
|
||||
"ZOMBIE",
|
||||
"PLAYER",
|
||||
"CREEPER",
|
||||
"DRAGON"
|
||||
)) {
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + headType + "_HEAD", "solid+ground_height+ground+ground+ign_passable", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "SKELETON_SKULL", "solid+ground_height+ground+ground+ign_passable", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "WITHER_SKELETON_WALL_SKULL", "solid+ground_height+ground+ground+ign_passable", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + headType + "_WALL_HEAD", "solid+ground_height+ground+ground+ign_passable", 1154);
|
||||
} for (final String slabType : Arrays.asList(
|
||||
"STONE",
|
||||
"SANDSTONE",
|
||||
"PETRIFIED_OAK",
|
||||
"COBBLESTONE",
|
||||
"BRICK",
|
||||
"STONE_BRICK",
|
||||
"NETHER_BRICK",
|
||||
"QUARTZ",
|
||||
"RED_SANDSTONE",
|
||||
"PURPUR",
|
||||
"PRISMARINE",
|
||||
"PRISMARINE_BRICK",
|
||||
"DARK_PRISMARINE"
|
||||
)) {
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + slabType + "_SLAB", "default+GROUND+XZ100+ground_height", 1154);
|
||||
}
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "MAGMA_BLOCK", "default+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "LILY_PAD", "default+ign_passable+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "END_ROD", "default+ign_passable", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "IRON_BARS", "THIN_FENCE+VARIABLE+ground_height+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "GLASS_PANE", "THIN_FENCE+VARIABLE+ground_height+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "COBBLESTONE_WALL", "HEIGHT150+VARIABLE+THICK_FENCE+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "MOSSY_COBBLESTONE_WALL", "HEIGHT150+VARIABLE+THICK_FENCE+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "ANVIL", "default+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "DAMAGED_ANVIL", "default+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "CHIPPED_ANVIL", "default+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "GRASS_PATH", "default+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "SHULKER_BOX", "default+HEIGHT150+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "CHEST", "ground_height+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "TRAPPED_CHEST", "ground_height+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "ENDER_CHEST", "ground_height+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "FARMLAND", "default+height100+ground_height+min_height16_15", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "TURTLE_EGG", "ground_height+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "SEA_PICKLE", "default+ground_height+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "CAULDRON", "ground_height+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "CONDUIT", "ground_height+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "FLOWER_POT", "ground_height+ground", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "ENCHANTING_TABLE", "ground_height+ground", 1154);
|
||||
// TODO: proper model for these blocks
|
||||
for (final String DeadCoralType : Arrays.asList(
|
||||
"DEAD_TUBE",
|
||||
"DEAD_BRAIN",
|
||||
@@ -785,18 +782,12 @@ public class DefaultConfig extends ConfigFile {
|
||||
"DEAD_FIRE",
|
||||
"DEAD_HORN"
|
||||
)) {
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + DeadCoralType + "_CORAL", "default+ign_passable+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + DeadCoralType + "_CORAL_WALL_FAN", "default+ign_passable+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + DeadCoralType + "_CORAL", "default+ign_passable+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + DeadCoralType + "_CORAL_WALL_FAN", "default+ign_passable+ground_height", 1154);
|
||||
}
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "DEAD_TUBE_CORAL_FAN", "default+ign_passable+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "DEAD_BRAIN_CORAL_FAN", "default+ign_passable+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "DEAD_BUBBLE_CORAL_FAN", "default+ign_passable+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "DAYLIGHT_DETECTOR", "default+GROUND+XZ100+ground_height", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "BLUE_ICE", "default+ground_height+allow_lowjump+ice", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "END_PORTAL_FRAME", "default+ign_passable+ground_height+ALLOW_LOWJUMP", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "COCOA", "default+ign_passable+ground_height+ALLOW_LOWJUMP", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "REPEATER", "default+ign_passable+ground_height+ALLOW_LOWJUMP", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS + ConfPaths.SUB_OVERRIDEFLAGS + "." + "COMPARATOR", "default+ign_passable+ground_height+ALLOW_LOWJUMP", 1154);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS_CHANGETRACKER_ACTIVE, true, 1036); // With lastChangedBuildNumber.
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS_CHANGETRACKER_PISTONS, true, 785);
|
||||
set(ConfPaths.COMPATIBILITY_BLOCKS_CHANGETRACKER_MAXAGETICKS, 80, 785);
|
||||
@@ -805,4 +796,4 @@ public class DefaultConfig extends ConfigFile {
|
||||
// // Update internal factory based on all the new entries to the "actions" section.
|
||||
// setActionFactory();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,6 +113,7 @@ public class Permissions {
|
||||
public static final RegisteredPermission BLOCKPLACE_AGAINST = add(BLOCKPLACE + ".against");
|
||||
public static final RegisteredPermission BLOCKPLACE_AGAINST_AIR = add(BLOCKPLACE_AGAINST + ".air");
|
||||
public static final RegisteredPermission BLOCKPLACE_AGAINST_LIQUIDS = add(BLOCKPLACE_AGAINST + ".liquids");
|
||||
public static final RegisteredPermission BLOCKPLACE_AGAINST_SELF = add(BLOCKPLACE_AGAINST + ".self");
|
||||
public static final RegisteredPermission BLOCKPLACE_AUTOSIGN = add(BLOCKPLACE + ".autosign");
|
||||
public static final RegisteredPermission BLOCKPLACE_BOATSANYWHERE = add(BLOCKPLACE + ".boatsanywhere");
|
||||
public static final RegisteredPermission BLOCKPLACE_DIRECTION = add(BLOCKPLACE + ".direction");
|
||||
@@ -152,7 +153,8 @@ public class Permissions {
|
||||
public static final RegisteredPermission INVENTORY_GUTENBERG = add(INVENTORY + ".gutenberg");
|
||||
public static final RegisteredPermission INVENTORY_INSTANTBOW = add(INVENTORY + ".instantbow");
|
||||
public static final RegisteredPermission INVENTORY_INSTANTEAT = add(INVENTORY + ".instanteat");
|
||||
public static final RegisteredPermission INVENTORY_MOVE = add(INVENTORY + ".inventorymove");
|
||||
public static final RegisteredPermission INVENTORY_INVENTORYMOVE = add(INVENTORY + ".inventorymove");
|
||||
public static final RegisteredPermission INVENTORY_MOREINVENTORY = add(INVENTORY + ".moreinventory");
|
||||
public static final RegisteredPermission INVENTORY_ITEMS = add(INVENTORY + ".items");
|
||||
public static final RegisteredPermission INVENTORY_OPEN = add(INVENTORY + ".open");
|
||||
|
||||
@@ -161,6 +163,7 @@ public class Permissions {
|
||||
public static final RegisteredPermission NET_FLYINGFREQUENCY = add(NET + ".flyingfrequency");
|
||||
public static final RegisteredPermission NET_KEEPALIVEFREQUENCY = add(NET + ".keepalivefrequency");
|
||||
public static final RegisteredPermission NET_PACKETFREQUENCY = add(NET + ".packetfrequency");
|
||||
public static final RegisteredPermission NET_WRONGTURN = add(NET + ".wrongturn");
|
||||
|
||||
public static final RegisteredPermission MOVING = add(CHECKS + ".moving");
|
||||
public static final RegisteredPermission MOVING_CREATIVEFLY = add(MOVING + ".creativefly");
|
||||
@@ -172,6 +175,7 @@ public class Permissions {
|
||||
public static final RegisteredPermission MOVING_SURVIVALFLY_SNEAKING = add(MOVING_SURVIVALFLY + ".sneaking");
|
||||
public static final RegisteredPermission MOVING_SURVIVALFLY_SPEEDING = add(MOVING_SURVIVALFLY + ".speeding");
|
||||
public static final RegisteredPermission MOVING_SURVIVALFLY_SPRINTING = add(MOVING_SURVIVALFLY + ".sprinting");
|
||||
public static final RegisteredPermission MOVING_SURVIVALFLY_WATERWALK = add(MOVING_SURVIVALFLY + ".waterwalk");
|
||||
public static final RegisteredPermission MOVING_SURVIVALFLY_STEP = add(MOVING_SURVIVALFLY + ".step");
|
||||
public static final RegisteredPermission MOVING_VEHICLE = add(MOVING + ".vehicle");
|
||||
public static final RegisteredPermission MOVING_VEHICLE_MOREPACKETS = add(MOVING_VEHICLE + ".morepackets");
|
||||
@@ -229,4 +233,4 @@ public class Permissions {
|
||||
return new ArrayList<RegisteredPermission>(permissions.values());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -907,8 +907,13 @@ public class PlayerDataManager implements IPlayerDataManager, ComponentWithName
|
||||
|
||||
@Override
|
||||
public PlayerData getPlayerData(final Player player, boolean create) {
|
||||
try {
|
||||
return getPlayerData(player.getUniqueId(), player.getName(),
|
||||
create, create ? worldDataManager.getWorldDataSafe(player) : null);
|
||||
} catch (Exception e) {
|
||||
// Fake player
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@ package fr.neatmonster.nocheatplus.utilities;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
@@ -51,5 +52,29 @@ public class PotionUtil {
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get amplifier for a potion effect.
|
||||
*
|
||||
* @param entity
|
||||
* the LivingEntity
|
||||
* @param type
|
||||
* the type
|
||||
* @return Double.NEGATIVE_INFINITY if not present, otherwise the maximal
|
||||
* amplifier.
|
||||
*/
|
||||
public static final double getPotionEffectAmplifier(final LivingEntity entity, final PotionEffectType type) {
|
||||
if (!entity.hasPotionEffect(type)) {
|
||||
return Double.NEGATIVE_INFINITY; // TODO: Might not win anything.
|
||||
}
|
||||
final Collection<PotionEffect> effects = entity.getActivePotionEffects();
|
||||
double max = Double.NEGATIVE_INFINITY;
|
||||
for (final PotionEffect effect : effects){
|
||||
if (effect.getType().equals(type)){
|
||||
max = Math.max(max, effect.getAmplifier());
|
||||
}
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -438,4 +438,4 @@ public abstract class AxisTracing implements ICollideBlocks, ISetMargins {
|
||||
double minX, double minY, double minZ, double maxX, double maxY, double maxZ,
|
||||
Axis axis, int increment);
|
||||
|
||||
}
|
||||
}
|
||||
Loaded 100 of 117 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user