mirror of
https://github.com/Updated-NoCheatPlus/NoCheatPlus.git
synced 2026-11-08 09:35:18 -05:00
Compare commits
104
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
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.13.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -43,4 +43,4 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
+74
-3
@@ -21,17 +21,21 @@ 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.BukkitChorusPlant;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitCocoa;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitDirectionalCentered;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitDoor;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitEndPortalFrame;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitFence;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitGate;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitSeaPickle;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitShapeModel;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitShulkerBox;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitSlab;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitStairs;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitStatic;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitTrapDoor;
|
||||
import fr.neatmonster.nocheatplus.compat.bukkit.model.BukkitTurtleEgg;
|
||||
import fr.neatmonster.nocheatplus.config.WorldConfigProvider;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
|
||||
import fr.neatmonster.nocheatplus.utilities.map.BlockFlags;
|
||||
@@ -48,9 +52,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,6 +71,9 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
0.4375, 1.0);
|
||||
private static final BukkitShapeModel MODEL_THICK_FENCE = new BukkitFence(
|
||||
0.375, 1.5);
|
||||
// .75 .25 0 max: .25 .75 .5
|
||||
private static final BukkitShapeModel MODEL_WALL_HEAD = new BukkitStatic(
|
||||
0.75, 0.25, 0.0, 0.25, 0.75, 0.5);
|
||||
|
||||
|
||||
// Static blocks (various height and inset values).
|
||||
@@ -70,6 +81,8 @@ public class MCAccessBukkitModern extends MCAccessBukkit {
|
||||
0.09375);
|
||||
private static final BukkitShapeModel MODEL_FLOWER_POT = new BukkitStatic(
|
||||
0.33, 0.375); // TODO: XZ really?
|
||||
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(
|
||||
@@ -135,10 +148,22 @@ 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 headFlags = BlockFlags.SOLID_GROUND | BlockProperties.F_XZ100 | BlockProperties.F_IGN_PASSABLE;
|
||||
final long blockFix = BlockFlags.SOLID_GROUND | BlockProperties.F_XZ100 | BlockProperties.F_IGN_PASSABLE;
|
||||
// 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, BlockProperties.F_IGN_PASSABLE | BlockFlags.SOLID_GROUND | BlockProperties.F_GROUND | BlockProperties.F_XZ100);
|
||||
BlockProperties.setBlockFlags(Material.CHORUS_PLANT, blockFix);
|
||||
BlockProperties.setBlockFlags(Material.CREEPER_WALL_HEAD, headFlags);
|
||||
BlockProperties.setBlockFlags(Material.ZOMBIE_WALL_HEAD, headFlags);
|
||||
BlockProperties.setBlockFlags(Material.PLAYER_WALL_HEAD, headFlags);
|
||||
BlockProperties.setBlockFlags(Material.DRAGON_WALL_HEAD, headFlags);
|
||||
BlockProperties.setBlockFlags(Material.WITHER_SKELETON_WALL_SKULL, headFlags);
|
||||
BlockProperties.setBlockFlags(Material.SKELETON_WALL_SKULL, headFlags);
|
||||
|
||||
// Directly keep blocks as is.
|
||||
for (final Material mat : new Material[] {
|
||||
@@ -146,7 +171,15 @@ 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.ANVIL,
|
||||
Material.CHIPPED_ANVIL,
|
||||
Material.DAMAGED_ANVIL,
|
||||
Material.CHORUS_FLOWER
|
||||
}) {
|
||||
processedBlocks.add(mat);
|
||||
}
|
||||
@@ -238,7 +271,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 +309,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,6 +322,13 @@ 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);
|
||||
}
|
||||
|
||||
// Sort to processed by flags.
|
||||
for (final Material mat : Material.values()) {
|
||||
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package fr.neatmonster.nocheatplus.compat.bukkit.model;
|
||||
|
||||
import 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 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);
|
||||
|
||||
double minX = Math.abs(block.getBoundingBox().getMinX()) - Math.abs((int) block.getBoundingBox().getMinX());
|
||||
double minY = Math.abs(block.getBoundingBox().getMinY()) - Math.abs((int) block.getBoundingBox().getMinY());
|
||||
double minZ = Math.abs(block.getBoundingBox().getMinZ()) - Math.abs((int) block.getBoundingBox().getMinZ());
|
||||
|
||||
double maxX = Math.abs(block.getBoundingBox().getMaxX()) - Math.abs((int) block.getBoundingBox().getMaxX());
|
||||
double maxY = Math.abs(block.getBoundingBox().getMaxY()) - Math.abs((int) block.getBoundingBox().getMaxY());
|
||||
double maxZ = Math.abs(block.getBoundingBox().getMaxZ()) - Math.abs((int) block.getBoundingBox().getMaxZ());
|
||||
|
||||
return new double[] {minX, minY, minZ, maxX, maxY, maxZ};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
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.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) {
|
||||
final Cocoa cocoa = (Cocoa) blockData;
|
||||
switch (cocoa.getAge()) {
|
||||
case 0: // .625 .4375 .0625 max: .375 .75 .3125
|
||||
return new double[] {0.625, 0.4375, 0.0625, 0.375, 0.75, 0.3125};
|
||||
case 1: // .6875 .3125 .0625 max: .3125 .75 .4375
|
||||
return new double[] {0.6875, 0.3125, 0.0625, 0.3125, 0.75, 0.4375};
|
||||
case 2: // .75 .1875 .0625 max: .25 .75 .5625
|
||||
return new double[] {0.75, 0.1875, 0.0625, 0.25, 0.75, 0.5625};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new double[] {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFakeData(final BlockCache blockCache,
|
||||
final World world, final int x, final int y, final int z) {
|
||||
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: // .625 , 0 , .375 max: .375 , 375 , .625
|
||||
return new double[] {0.625, 0.0, 0.375, 0.375, 0.375, 0.625};
|
||||
case 2: // .8125 , 0 , .1875 max: .1875 , .375 , .8125
|
||||
return new double[] {0.8125, 0.0, 0.1875, 0.1875, 0.375, 0.8125};
|
||||
case 3: // .875 0 .125 max: .125 .375 .875
|
||||
return new double[] {0.875, 0.0, 0.125, 0.125, 0.375, 0.875};
|
||||
case 4: // .875 0 .125 max: .125 .4375 .875
|
||||
return new double[] {0.875, 0.0, 0.125, 0.125, 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;
|
||||
}
|
||||
|
||||
}
|
||||
+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.8125, 0.0, 0.1875, 0.25, 0.4375, 0.75};
|
||||
case 2: // .9375 .0 .0625 max: 0.0625 .4375 .9375
|
||||
case 3:
|
||||
case 4:
|
||||
return new double[] {0.9375, 0.0, 0.0625, 0.0625, 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;
|
||||
}
|
||||
|
||||
}
|
||||
+3
-3
@@ -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;
|
||||
|
||||
@@ -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.4.5-1.13|?";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -72,6 +72,7 @@ public enum CheckType {
|
||||
|
||||
FIGHT(CheckTypeType.CHECK, CheckType.ALL, Permissions.FIGHT),
|
||||
FIGHT_ANGLE(CheckTypeType.CHECK, FIGHT, Permissions.FIGHT_ANGLE),
|
||||
FIGHT_CLICKPATTERN(CheckTypeType.CHECK, FIGHT),
|
||||
FIGHT_CRITICAL(CheckTypeType.CHECK, FIGHT, Permissions.FIGHT_CRITICAL),
|
||||
FIGHT_DIRECTION(CheckTypeType.CHECK, FIGHT, Permissions.FIGHT_DIRECTION),
|
||||
FIGHT_FASTHEAL(CheckTypeType.CHECK, FIGHT, Permissions.FIGHT_FASTHEAL),
|
||||
|
||||
+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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,10 +63,11 @@ public class AutoSign extends Check {
|
||||
if (mat == BridgeMaterial.SIGN || mat == Material.WALL_SIGN) {
|
||||
mat = Material.SIGN; // ITEM
|
||||
}
|
||||
if (data.autoSignPlacedHash != BlockPlaceListener.getBlockPlaceHash(block, mat)){
|
||||
tags.add("block_mismatch");
|
||||
return handleViolation(player, maxEditTime, data, cc);
|
||||
}
|
||||
// Still dont know how to fix this bug in 1.14
|
||||
//if (data.autoSignPlacedHash != BlockPlaceListener.getBlockPlaceHash(block, mat)){
|
||||
// tags.add("block_mismatch");
|
||||
// return handleViolation(player, maxEditTime, data, cc);
|
||||
//}
|
||||
if (time < data.autoSignPlacedTime){
|
||||
data.autoSignPlacedTime = 0;
|
||||
return false;
|
||||
|
||||
+11
-3
@@ -42,16 +42,20 @@ 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>();
|
||||
public final ActionList noSwingActions;
|
||||
|
||||
public final ActionList reachActions;
|
||||
|
||||
|
||||
public final ActionList scaffoldActions;
|
||||
|
||||
public final long speedInterval;
|
||||
public final boolean speedImprobableFeedOnly;
|
||||
public final float speedImprobableWeight;
|
||||
public final ActionList speedActions;
|
||||
|
||||
/** General activation flag. */
|
||||
@@ -78,16 +82,20 @@ 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);
|
||||
noSwingActions = config.getOptimizedActionList(ConfPaths.BLOCKPLACE_NOSWING_ACTIONS, Permissions.BLOCKPLACE_NOSWING);
|
||||
|
||||
reachActions = config.getOptimizedActionList(ConfPaths.BLOCKPLACE_REACH_ACTIONS, Permissions.BLOCKPLACE_REACH);
|
||||
|
||||
scaffoldActions = config.getOptimizedActionList(ConfPaths.BLOCKPLACE_SCAFFOLD_ACTIONS, Permissions.BLOCKPLACE_REACH);
|
||||
|
||||
scaffoldActions = config.getOptimizedActionList(ConfPaths.BLOCKPLACE_SCAFFOLD_ACTIONS, Permissions.BLOCKPLACE_REACH);
|
||||
|
||||
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);
|
||||
|
||||
+12
-6
@@ -234,9 +234,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,9 +516,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package fr.neatmonster.nocheatplus.checks.fight;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
// import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.Check;
|
||||
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 net.minecraft.server.v1_13_R2.EntityPlayer;
|
||||
|
||||
public class ClickPattern extends Check {
|
||||
|
||||
/**
|
||||
* Instantiates a new click pattern check.
|
||||
*/
|
||||
public ClickPattern() {
|
||||
super(CheckType.FIGHT_CLICKPATTERN);
|
||||
}
|
||||
|
||||
/*public int getPing(Player p) {
|
||||
CraftPlayer cp = (CraftPlayer) p; EntityPlayer ep = cp.getHandle(); return ep.ping;
|
||||
} */
|
||||
|
||||
HashMap<String, Long> clickData = new HashMap<String, Long>();
|
||||
|
||||
// Resets the click times to check for another click difference
|
||||
private void resetClickTime(HashMap<String, Long> clickData) {
|
||||
clickData.put("thisAttackTime", 0L);
|
||||
clickData.put("lastAttackTime", 0L);
|
||||
}
|
||||
|
||||
// Resets all the attack times once the check has been finished
|
||||
private void resetAllTimes(HashMap<String, Long> clickData) {
|
||||
clickData.put("thisAttackTime", 0L);
|
||||
clickData.put("lastAttackTime", 0L);
|
||||
clickData.put("thisClickDifference", 0L);
|
||||
clickData.put("lastClickDifference", 0L);
|
||||
}
|
||||
|
||||
/*
|
||||
* This check compares the players time between each click, and attempts to find a pattern,
|
||||
* Right now, this is bare-bone version, and more testing/fixing needs to be done to improve it.
|
||||
* This can detect AutoClickers or KillAuras that do not allow aps ranges.
|
||||
*
|
||||
*/
|
||||
public boolean check(final Player player, final FightData data, final IPlayerData pData, final FightConfig cc) {
|
||||
|
||||
boolean cancel = false;
|
||||
final long now = System.currentTimeMillis();
|
||||
|
||||
// Adds the HashMap if it has not already been added
|
||||
if (clickData.isEmpty()) {
|
||||
clickData.putIfAbsent("lastAttackTime", 0L);
|
||||
clickData.putIfAbsent("thisAttackTime", 0L);
|
||||
clickData.putIfAbsent("lastClickDifference", 0L);
|
||||
clickData.putIfAbsent("thisClickDifference", 0L);
|
||||
}
|
||||
|
||||
// Skip the player if they are lagging
|
||||
if (TickTask.getLag(1000, true) > 1.3f) return false;
|
||||
|
||||
// Setting the attack times
|
||||
else if (clickData.get("lastAttackTime").equals(0L)) {
|
||||
clickData.put("lastAttackTime", now);
|
||||
}
|
||||
else if (clickData.get("thisAttackTime").equals(0L)) {
|
||||
clickData.put("thisAttackTime", now);
|
||||
}
|
||||
|
||||
// Calculating the difference
|
||||
if (!clickData.get("lastAttackTime").equals(0L) && !clickData.get("thisAttackTime").equals(0L)) {
|
||||
if (clickData.get("lastClickDifference").equals(0L)) {
|
||||
clickData.put("lastClickDifference", Math.abs(clickData.get("thisAttackTime") - clickData.get("lastAttackTime")));
|
||||
resetClickTime(clickData);
|
||||
} else if (clickData.get("thisClickDifference").equals(0L)) {
|
||||
clickData.put("thisClickDifference", Math.abs(clickData.get("thisAttackTime") - clickData.get("lastAttackTime")));
|
||||
if (clickData.get("thisClickDifference") == clickData.get("lastClickDifference") || cc.clickRange > Math.max(clickData.get("thisClickDifference") - clickData.get("lastClickDifference"), clickData.get("lastClickDifference") - clickData.get("thisClickDifference"))) {
|
||||
cancel = executeActions(player, data.clickPatternVL, 1D, pData.getGenericInstance(FightConfig.class).clickActions).willCancel();
|
||||
data.clickPatternVL += 1D;
|
||||
} else {
|
||||
data.clickPatternVL *= 0.86D;
|
||||
}
|
||||
if (pData.isDebugActive(type) && pData.hasPermission(Permissions.ADMINISTRATION_DEBUG, player)) {
|
||||
player.sendMessage(ChatColor.RED + "NCP Debug: " + ChatColor.RESET + "ThisClick Difference: " + clickData.get("thisClickDifference") + " Last Click Differnce: " + clickData.get("lastClickDifference") + ChatColor.RED + " false");
|
||||
}
|
||||
resetAllTimes(clickData);
|
||||
}
|
||||
}
|
||||
if (cancel) {
|
||||
data.clicPatPenalty.applyPenalty(cc.clickPen);
|
||||
}
|
||||
return cancel;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Code to be touched up/fixed later, and the effectiveness of this check needs to be tested.
|
||||
* This part would get the average of their click difference and attempt to find a pattern there.
|
||||
* Could be useful to attempt to eliminate false positives with the click difference check.
|
||||
* Requires Java 8 to calculate the average, but a for method could be used to keep cross compatibility
|
||||
*
|
||||
* if (avgData.size() >= 8) {
|
||||
* player.sendMessage("Calculating avg:");
|
||||
* if (calcAvg(avgData) <= 25) {
|
||||
* player.sendMessage("Avg is " + ChatColor.GREEN + "true " + avgData);
|
||||
* } else {
|
||||
* player.sendMessage("Avg is " + ChatColor.RED + "false " + avgData);
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* avgData.add(Math.max(clickData.get("thisClickDifference") - clickData.get("lastClickDifference"), clickData.get("lastClickDifference") - clickData.get("thisClickDifference")));
|
||||
*
|
||||
* private double calcAvg(ArrayList <Long> avgData) {
|
||||
* double avg = avgData.stream().mapToInt(Long::intValue).average().getAsDouble();
|
||||
* int size = avgData.size();
|
||||
* Bukkit.getLogger().info("[NoCheatPlus] avg: " + avg + " size " + size);
|
||||
*
|
||||
* return avg / size;
|
||||
* }
|
||||
*
|
||||
* ArrayList<Long> avgData = new ArrayList<Long>();
|
||||
*/
|
||||
|
||||
@@ -37,6 +37,10 @@ public class FightConfig extends ACheckConfig {
|
||||
public final double angleSwitch;
|
||||
public final double angleTime;
|
||||
public final ActionList angleActions;
|
||||
|
||||
public final int clickRange;
|
||||
public long clickPen;
|
||||
public final ActionList clickActions;
|
||||
|
||||
public final long toolChangeAttackPenalty;
|
||||
|
||||
@@ -63,6 +67,8 @@ 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;
|
||||
|
||||
@@ -75,6 +81,8 @@ 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;
|
||||
@@ -100,6 +108,10 @@ public class FightConfig extends ACheckConfig {
|
||||
angleYaw = config.getDouble(ConfPaths.FIGHT_ANGLE_THRESHOLD_YAW);
|
||||
angleTime = config.getDouble(ConfPaths.FIGHT_ANGLE_THRESHOLD_TIME);
|
||||
angleActions = config.getOptimizedActionList(ConfPaths.FIGHT_ANGLE_ACTIONS, Permissions.FIGHT_ANGLE);
|
||||
|
||||
clickRange = config.getInt(ConfPaths.FIGHT_CLICKPATTERN_RANGE);
|
||||
clickPen = config.getLong(ConfPaths.FIGHT_CLICKPATTERN_PENALTY);
|
||||
clickActions = config.getOptimizedActionList(ConfPaths.FIGHT_CLICKPATTERN_ACTIONS, Permissions.FIGHT_SPEED);
|
||||
|
||||
toolChangeAttackPenalty = config.getLong(ConfPaths.FIGHT_TOOLCHANGEPENALTY);
|
||||
|
||||
@@ -131,6 +143,8 @@ 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);
|
||||
@@ -141,6 +155,8 @@ 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,
|
||||
|
||||
@@ -35,6 +35,7 @@ public class FightData extends ACheckData implements IDataOnRemoveSubCheckData,
|
||||
|
||||
// Violation levels.
|
||||
public double angleVL;
|
||||
public double clickPatternVL;
|
||||
public double criticalVL;
|
||||
public double directionVL;
|
||||
public double fastHealVL;
|
||||
@@ -53,6 +54,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 +96,7 @@ 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 = true;
|
||||
|
||||
// Data of the reach check.
|
||||
public double reachMod = 1.0;
|
||||
@@ -138,6 +140,8 @@ public class FightData extends ACheckData implements IDataOnRemoveSubCheckData,
|
||||
angleVL = 0;
|
||||
angleHits.clear();
|
||||
break;
|
||||
case FIGHT_CLICKPATTERN:
|
||||
clickPatternVL = 0;
|
||||
case FIGHT_SPEED:
|
||||
speedVL = 0;
|
||||
speedBuckets.clear(System.currentTimeMillis());
|
||||
|
||||
@@ -91,6 +91,8 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
|
||||
/** The critical check. */
|
||||
private final Critical critical = addCheck(new Critical());
|
||||
|
||||
private final ClickPattern clickpat = addCheck(new ClickPattern());
|
||||
|
||||
/** The direction check. */
|
||||
private final Direction direction = addCheck(new Direction());
|
||||
@@ -324,6 +326,11 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
&& wrongTurn.check(player, loc, data, cc)) {
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
// ClickPatern check
|
||||
if (clickpat.check(player, data, pData, cc) && clickpat.isEnabled(player, pData)) {
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
// Run through the main checks.
|
||||
if (!cancelled && speed.isEnabled(player, pData)) {
|
||||
@@ -331,19 +338,30 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
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)
|
||||
@@ -888,7 +906,7 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
} else {
|
||||
data.exemptArmSwing = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playerJoins(final Player player) {
|
||||
@@ -918,10 +936,11 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
|
||||
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_FIGHTSYNC, player)) return;
|
||||
if (data.fightSyncCount >= cc.fightSyncResetCount) {
|
||||
data.fightSyncCount = 0;
|
||||
data.fightSyncReset = 0;
|
||||
data.fightSyncVL *= 0.99D;
|
||||
data.fightSyncVL *= 0.99D;
|
||||
}
|
||||
data.fightSyncReset += 1;
|
||||
Location packet = data.lastHitLocation, eventLoc = player.getLocation();
|
||||
|
||||
@@ -17,7 +17,8 @@ public class FightSync extends Check {
|
||||
|
||||
public boolean check(Player player, IPlayerData pData, NetData data, Location packet, Location eventLoc, final NetConfig cc) {
|
||||
boolean cancel = false;
|
||||
double diff = Math.abs(eventLoc.getYaw() - packet.getYaw()) + Math.abs(eventLoc.getPitch() - packet.getPitch());
|
||||
if (eventLoc != null && packet != null) {
|
||||
double diff = Math.abs(eventLoc.getYaw() - packet.getYaw()) + Math.abs(eventLoc.getPitch() - packet.getPitch());
|
||||
|
||||
if (diff != 0) {
|
||||
if (data.fightSyncCount >= cc.fightSyncThreshold) {
|
||||
@@ -28,6 +29,7 @@ public class FightSync extends Check {
|
||||
data.fightSyncCount += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cancel;
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -40,7 +40,7 @@ public class WrongTurn extends Check {
|
||||
// Invalid Pitch
|
||||
// TODO: Does invalid pitch arrive here at all?
|
||||
// TODO: Prefer to detect on packet level already.
|
||||
if (Math.abs(pitch) > 90.0f) {
|
||||
if (Math.abs(pitch) > 90.0f || pitch < -90.0f) {
|
||||
data.wrongTurnVL += 1; // (Never cooldown.)
|
||||
if (executeActions(player, data.wrongTurnVL, 1.0, cc.wrongTurnActions).willCancel()) {
|
||||
return true;
|
||||
|
||||
@@ -161,7 +161,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;
|
||||
}
|
||||
|
||||
@@ -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,6 +112,7 @@ public class InventoryConfig extends ACheckConfig {
|
||||
openClose = data.getBoolean(ConfPaths.INVENTORY_OPEN_CLOSE);
|
||||
openCancelOther = data.getBoolean(ConfPaths.INVENTORY_OPEN_CANCELOTHER);
|
||||
|
||||
invMoveDisableCreative = data.getBoolean(ConfPaths.INVENTORY_INVENTORYMOVE_DISABLECREATIVE);
|
||||
invMoveActionList = data.getOptimizedActionList(ConfPaths.INVENTORY_INVENTORYMOVE_ACTIONS, Permissions.INVENTORY_MOVE);
|
||||
|
||||
hotFixFallingBlockEndPortalActive = data.getBoolean(ConfPaths.INVENTORY_HOTFIX_DUPE_FALLINGBLOCKENDPORTAL);
|
||||
|
||||
+5
-6
@@ -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,6 +35,7 @@ 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;
|
||||
@@ -49,7 +47,6 @@ 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;
|
||||
@@ -286,9 +283,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+77
-12
@@ -1,30 +1,95 @@
|
||||
package fr.neatmonster.nocheatplus.checks.inventory;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
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.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);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
// Tags
|
||||
if (player.isBlocking()) {
|
||||
tags.add("isBlocking");
|
||||
}
|
||||
else if (player.isSneaking()) {
|
||||
tags.add("isSneaking");
|
||||
}
|
||||
else if (player.isSwimming()) {
|
||||
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() || player.isSwimming() || player.isBlocking() || player.isDead()) {
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
@@ -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. */
|
||||
@@ -209,6 +212,9 @@ 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());
|
||||
@@ -390,6 +396,10 @@ 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;
|
||||
}
|
||||
|
||||
@@ -96,12 +96,14 @@ public class MovingData extends ACheckData implements IDataOnRemoveSubCheckData,
|
||||
public double jumpAmplifier = 0;
|
||||
/** Last time the player was actually sprinting. */
|
||||
public long timeSprinting = 0;
|
||||
public long timeRiptiding = 0;
|
||||
public long bedLeaveTime = 0;
|
||||
public long timeRiptiding = 0;
|
||||
public double multSprinting = 1.30000002; // Multiplier at the last time sprinting.
|
||||
/** Compatibility entry for bouncing of slime blocks and the like. */
|
||||
public SimpleEntry verticalBounce = null;
|
||||
/** Last used block change id (BlockChangeTracker). */
|
||||
public final BlockChangeReference blockChangeRef = new BlockChangeReference();
|
||||
public boolean newHDist = false;
|
||||
|
||||
/** Tick at which walk/fly speeds got changed last time. */
|
||||
public int speedTick = 0;
|
||||
|
||||
@@ -306,13 +306,14 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
public void onPlayerBedLeave(final PlayerBedLeaveEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
final IPlayerData pData = DataManager.getPlayerData(player);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
data.bedLeaveTime = System.currentTimeMillis();
|
||||
if (pData.isCheckActive(bedLeave.getType(), player)
|
||||
&& bedLeave.checkBed(player, pData)) {
|
||||
final MovingConfig cc = pData.getGenericInstance(MovingConfig.class);
|
||||
// Check if the player has to be reset.
|
||||
// To "cancel" the event, we teleport the player.
|
||||
final Location loc = player.getLocation(useLoc);
|
||||
final MovingData data = pData.getGenericInstance(MovingData.class);
|
||||
Location target = null;
|
||||
final PlayerMoveInfo moveInfo = aux.usePlayerMoveInfo();
|
||||
moveInfo.set(player, loc, null, cc.yOnGround);
|
||||
@@ -723,8 +724,9 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
prepareCreativeFlyCheck(player, from, to, moveInfo, thisMove, multiMoveCount, tick, data, cc);
|
||||
}
|
||||
else {
|
||||
checkCf = checkSf = false;
|
||||
// (thisMove.flyCheck stays null.)
|
||||
checkCf = true;
|
||||
checkSf = false;
|
||||
prepareCreativeFlyCheck(player, from, to, moveInfo, thisMove, multiMoveCount, tick, data, cc);
|
||||
}
|
||||
|
||||
// Pre-check checks (hum), either for cf or for sf.
|
||||
@@ -1925,7 +1927,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
// Adjust fall distance, if set so.
|
||||
// TODO: How to account for plugins that reset the fall distance here?
|
||||
// TODO: Detect transition from valid flying that needs resetting the fall distance.
|
||||
if (event.getCause() == TeleportCause.UNKNOWN) {
|
||||
if (event.getCause() == TeleportCause.UNKNOWN || event.getCause() == TeleportCause.COMMAND) {
|
||||
// Always keep fall damage.
|
||||
player.setFallDistance((float) fallDistance);
|
||||
data.noFallFallDistance = (float) fallDistance;
|
||||
|
||||
@@ -49,8 +49,8 @@ public class Magic {
|
||||
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 modSwim = 0.3D / WALK_SPEED; // 0.152D / 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[] modDepthStrider = new double[] {
|
||||
1.0,
|
||||
@@ -59,10 +59,10 @@ public class Magic {
|
||||
1.0 / modSwim, // 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 modSoulSand = 0.16D / 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);
|
||||
|
||||
/**
|
||||
* Somewhat arbitrary horizontal speed gain maximum for advance glide phase.
|
||||
@@ -127,7 +127,7 @@ public class Magic {
|
||||
*/
|
||||
public static double swimBaseSpeedV() {
|
||||
// TODO: Does this have to be the dynamic walk speed (refactoring)?
|
||||
return WALK_SPEED * modSwim + 0.1;
|
||||
return WALK_SPEED * modSwim + 0.1; // 0.244
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
+10
@@ -22,6 +22,7 @@ import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
import fr.neatmonster.nocheatplus.actions.ParameterName;
|
||||
@@ -36,10 +37,12 @@ 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.compat.Bridge1_13;
|
||||
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
|
||||
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
|
||||
import fr.neatmonster.nocheatplus.compat.blocks.changetracker.BlockChangeTracker;
|
||||
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;
|
||||
@@ -320,6 +323,10 @@ public class CreativeFly extends Check {
|
||||
}
|
||||
|
||||
double limitH = model.getHorizontalModSpeed() / 100.0 * ModelFlying.HORIZONTAL_SPEED * fSpeed;
|
||||
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)?
|
||||
@@ -379,6 +386,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.
|
||||
|
||||
@@ -164,7 +164,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() && !player.isSwimming() && !player.isGliding() && !(player.getEyeHeight()<0.45)) {
|
||||
tags = "raytracing_collide_";
|
||||
}
|
||||
else if (rayTracing.getStepsDone() >= rayTracing.getMaxSteps()) {
|
||||
|
||||
+53
-28
@@ -75,6 +75,8 @@ public class SurvivalFly extends Check {
|
||||
private static final int bunnyHopMax = 10;
|
||||
/** Divisor vs. last hDist for minimum slow down. */
|
||||
private static final double bunnyDivFriction = 160.0; // Rather in-air, blocks would differ by friction.
|
||||
|
||||
public boolean snowFix;
|
||||
|
||||
|
||||
|
||||
@@ -289,7 +291,17 @@ public class SurvivalFly extends Check {
|
||||
if ((from.getBlockFlags() & BlockProperties.F_ALLOW_LOWJUMP) != 0) {
|
||||
// TODO: Specialize - test for foot region?
|
||||
data.sfNoLowJump = true;
|
||||
}
|
||||
if ((from.getBlockFlags() & BlockProperties.F_GROUND_HEIGHT) != 0) {
|
||||
data.newHDist = true;
|
||||
} else {
|
||||
data.newHDist = false;
|
||||
}
|
||||
if ((from.getBlockFlags() & BlockProperties.F_HEIGHT_8_INC) != 0) {
|
||||
snowFix = true;
|
||||
} else {
|
||||
snowFix = false;
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
// Horizontal move.
|
||||
@@ -403,25 +415,25 @@ public class SurvivalFly extends Check {
|
||||
|
||||
// Detects walking directly above water
|
||||
Material blockUnder = player.getLocation().subtract(0, 0.12, 0).getBlock().getType();
|
||||
Material blockAbove = player.getLocation().add(0, 0.12, 0).getBlock().getType();
|
||||
Material blockAbove = player.getLocation().add(0, 0.10, 0).getBlock().getType();
|
||||
if (blockUnder != null && blockAbove != null) {
|
||||
// Checks if the player is above water but not in water.
|
||||
// Checks if the player is above water but not in water.
|
||||
if (blockUnder == Material.WATER && blockAbove == Material.AIR) {
|
||||
// hDist and vDist checks, simply checks for horizontal movement with little y distance
|
||||
if (hDistanceAboveLimit <= 0D && hDistance > 0.1D && yDistance <= 0.1D && !toOnGround && !fromOnGround
|
||||
&& lastMove.toIsValid && lastMove.yDistance != 0D
|
||||
// hDist and vDist checks, simply checks for horizontal movement with little y distance
|
||||
if (hDistanceAboveLimit <= 0D && hDistance > 0.11D && yDistance <= 0.1D && !toOnGround && !fromOnGround
|
||||
&& lastMove.toIsValid && lastMove.yDistance == yDistance || lastMove.yDistance == yDistance * -1 && lastMove.yDistance != 0D
|
||||
&& !from.isHeadObstructed() && !to.isHeadObstructed() && !player.isSwimming()) {
|
||||
// Prevent being flagged if a player transitions from a block to water and the player falls into the water.
|
||||
if (!(yDistance < 0 && yDistance != 0 && lastMove.yDistance < 0 && lastMove.yDistance != 0)) {
|
||||
hDistanceAboveLimit = Math.max(hDistanceAboveLimit, hDistance);
|
||||
tags.add("watermove");
|
||||
// Prevent being flagged if a player transitions from a block to water and the player falls into the water.
|
||||
if (!(yDistance < 0 && yDistance != 0 && lastMove.yDistance < 0 && lastMove.yDistance != 0)) {
|
||||
hDistanceAboveLimit = Math.max(hDistanceAboveLimit, hDistance);
|
||||
tags.add("watermove");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent players from sprinting if they're moving backwards (allow buffers to cover up !?).
|
||||
if (sprinting && data.lostSprintCount == 0 && !cc.assumeSprint && hDistance > thisMove.walkSpeed && !data.hasActiveHorVel()) {
|
||||
if (sprinting && data.lostSprintCount == 0 && hDistance > thisMove.walkSpeed && !data.hasActiveHorVel() && !player.hasPotionEffect(PotionEffectType.SPEED)) {
|
||||
// (Ignore some cases, in order to prevent false positives.)
|
||||
// TODO: speed effects ?
|
||||
if (TrigUtil.isMovingBackwards(xDistance, zDistance, from.getYaw())
|
||||
@@ -918,9 +930,13 @@ public class SurvivalFly extends Check {
|
||||
}
|
||||
}
|
||||
// (Friction is used as is.)
|
||||
} else if (data.newHDist && hAllowedDistance < 0.345D) {
|
||||
hAllowedDistance = 0.445D;
|
||||
|
||||
|
||||
} else if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
} else if (snowFix && hAllowedDistance < 0.377D) {
|
||||
hAllowedDistance = 0.377D;
|
||||
}
|
||||
else if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
hAllowedDistance = Magic.modRiptide * thisMove.walkSpeed * cc.survivalFlySpeedingSpeed / 100D;
|
||||
}
|
||||
// Allows faster speed for player when swimming above water since from -> to does not seem to detect correctly
|
||||
@@ -1135,9 +1151,15 @@ public class SurvivalFly extends Check {
|
||||
}
|
||||
strictVdistRel = false;
|
||||
} else if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
vAllowedDistance = lastMove.yDistance * 5.0D;
|
||||
strictVdistRel = false;
|
||||
}
|
||||
vAllowedDistance = lastMove.yDistance * 5.0D;
|
||||
strictVdistRel = false;
|
||||
} else if (data.bedLeaveTime + 500 > now && yDistance < 0.45) {
|
||||
strictVdistRel = false;
|
||||
vAllowedDistance = yDistance;
|
||||
} else if (snowFix) {
|
||||
strictVdistRel = false;
|
||||
vAllowedDistance = 0.425D;
|
||||
}
|
||||
else if (lastMove.toIsValid) {
|
||||
if (lastMove.yDistance >= -Math.max(Magic.GRAVITY_MAX / 2.0, 1.3 * Math.abs(yDistance)) && lastMove.yDistance <= 0.0
|
||||
&& (lastMove.touchedGround || lastMove.to.extraPropertiesValid && lastMove.to.resetCond)) {
|
||||
@@ -1220,6 +1242,8 @@ public class SurvivalFly extends Check {
|
||||
|
||||
} else if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
vDistRelVL = false;
|
||||
} else if (data.bedLeaveTime + 500 > now && yDistance < 0.45) {
|
||||
vDistRelVL = false;
|
||||
}
|
||||
else {
|
||||
// Violation.
|
||||
@@ -1301,6 +1325,8 @@ public class SurvivalFly extends Check {
|
||||
}
|
||||
else if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
vDistRelVL = false;
|
||||
} else if (data.bedLeaveTime + 500 > now && yDistance < 0.45) {
|
||||
vDistRelVL = false;
|
||||
}
|
||||
else {
|
||||
// Violation.
|
||||
@@ -1491,9 +1517,8 @@ public class SurvivalFly extends Check {
|
||||
else if (thisMove.verVelUsed == null) { // Only skip if just used.
|
||||
// Here yDistance can be negative and positive.
|
||||
// if (yDistance != 0.0) {
|
||||
if (BlockProperties.isNewLiq(from.getTypeIdBelow())) {
|
||||
|
||||
} else if (data.timeRiptiding + 500 > now) {
|
||||
if ( (BlockProperties.isNewLiq(from.getTypeIdBelow())) || (data.timeRiptiding + 500 > now) || (data.bedLeaveTime + 500 > now && yDistance < 0.45) || (snowFix) ) {
|
||||
// Ignore
|
||||
}
|
||||
else {
|
||||
data.vDistAcc.add((float) yDistance);
|
||||
@@ -1581,16 +1606,12 @@ public class SurvivalFly extends Check {
|
||||
// Moving upwards after falling without having touched the ground.
|
||||
if (data.bunnyhopDelay < 9 && !((lastMove.touchedGround || lastMove.from.onGroundOrResetCond) && lastMove.yDistance == 0D) && data.getOrUseVerticalVelocity(yDistance) == null) {
|
||||
// TODO: adjust limit for bunny-hop.
|
||||
if (BlockProperties.isNewLiq(from.getTypeIdBelow())) {
|
||||
// Exempts player if they are above a 'newliquid' block (1.13 water blocks)
|
||||
// Fixes issue with player swimming above a kelp plant (or related)
|
||||
}
|
||||
else if (data.timeRiptiding + 1000 > now) {
|
||||
|
||||
} else {
|
||||
vDistanceAboveLimit = Math.max(vDistanceAboveLimit, Math.abs(yDistance));
|
||||
if ( (BlockProperties.isNewLiq(from.getTypeIdBelow())) || (data.timeRiptiding + 500 > now) || (data.bedLeaveTime + 500 > now && yDistance < 0.45) || (snowFix) ) {
|
||||
|
||||
} else {
|
||||
vDistanceAboveLimit = Math.max(vDistanceAboveLimit, Math.abs(yDistance));
|
||||
tags.add("ychincfly");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
tags.add("ychincair");
|
||||
@@ -1726,13 +1747,17 @@ public class SurvivalFly extends Check {
|
||||
// Horizontal buffer.
|
||||
// TODO: Consider to confine use to "not in air" and similar.
|
||||
if (hDistanceAboveLimit > 0.0 && data.sfHorizontalBuffer > 0.0) {
|
||||
// Handle buffer only if moving too far.
|
||||
if (snowFix && data.sfHorizontalBuffer == 1) {
|
||||
// Ignore
|
||||
} else {
|
||||
// Handle buffer only if moving too far.
|
||||
// Consume buffer.
|
||||
tags.add("hbufuse");
|
||||
final double amount = Math.min(data.sfHorizontalBuffer, hDistanceAboveLimit);
|
||||
hDistanceAboveLimit -= amount;
|
||||
// Ensure we never end up below zero.
|
||||
data.sfHorizontalBuffer = Math.max(0.0, data.sfHorizontalBuffer - amount);
|
||||
}
|
||||
}
|
||||
|
||||
if (player.isRiptiding() || (data.timeRiptiding + 3000 > now)) {
|
||||
|
||||
@@ -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)))
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -55,6 +55,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 fightSyncResetCount;
|
||||
@@ -92,6 +93,7 @@ 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);
|
||||
|
||||
fightSyncResetCount = config.getInt(ConfPaths.NET_FIGHTSYNC_RESETCOUNT);
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import fr.neatmonster.nocheatplus.utilities.PotionUtil;
|
||||
|
||||
public class Bridge1_13 {
|
||||
private static final PotionEffectType SLOWFALLING = PotionEffectType.getByName("SLOW_FALLING");
|
||||
|
||||
public static boolean hasSlowfalling() {
|
||||
return SLOWFALLING != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
@@ -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", "sign_post", "wall_sign");
|
||||
|
||||
/** Some skull for reference. */
|
||||
public static final Material SKELETON_SKULL = getFirst("skeleton_skull", "skull");
|
||||
|
||||
+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
|
||||
|
||||
+7
@@ -97,6 +97,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 +167,9 @@ public class BlocksMC1_13 implements BlockPropertiesSetup {
|
||||
|
||||
// Conduit.
|
||||
BlockProperties.setBlockProps("CONDUIT", BlockProperties.woodDoorType);
|
||||
|
||||
// Sea Pickle.
|
||||
BlockProperties.setBlockProps("SEA_PICKLE", BlockProperties.instantType);
|
||||
|
||||
// Turtle egg.
|
||||
BlockProperties.setBlockProps("TURTLE_EGG", new BlockProps(
|
||||
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
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_FENCE;
|
||||
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);
|
||||
BlockInit.setAs("COMPOSTER", Material.DIRT);
|
||||
BlockInit.setAs("LECTERN", Material.OAK_PLANKS);
|
||||
BlockFlags.addFlags("LECTERN", BlockProperties.F_MIN_HEIGHT16_14);
|
||||
BlockFlags.addFlags("LECTERN", BlockProperties.F_MIN_HEIGHT8_1);
|
||||
BlockFlags.addFlags("LECTERN", BlockProperties.F_GROUND_HEIGHT);
|
||||
BlockFlags.addFlags("LECTERN", 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);
|
||||
BlockInit.setAs("STONECUTTER", Material.BRICK_SLAB);
|
||||
BlockFlags.addFlags("STONECUTTER", BlockProperties.F_MIN_HEIGHT16_9);
|
||||
BlockFlags.addFlags("STONECUTTER", BlockProperties.F_GROUND_HEIGHT);
|
||||
BlockProperties.setBlockProps("BAMBOO", new BlockProperties.BlockProps(BlockProperties.noTool, 0.7f, BlockProperties.secToMs(1.25)));
|
||||
BlockProperties.setBlockProps("BAMBOO_SAPLING", new BlockProperties.BlockProps(BlockProperties.noTool, 0.7f, BlockProperties.secToMs(1.25)));
|
||||
BlockFlags.addFlags("BAMBOO", BlockProperties.F_IGN_PASSABLE | BlockProperties.F_GROUND | BlockProperties.F_GROUND_HEIGHT | BlockProperties.F_THIN_FENCE);
|
||||
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);
|
||||
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);
|
||||
StaticLog.logInfo("Added block-info for Minecraft 1.14 blocks.");
|
||||
}
|
||||
|
||||
}
|
||||
+1
@@ -40,6 +40,7 @@ public class VanillaBlocksFactory {
|
||||
setups.add(new BlocksMC1_11());
|
||||
setups.add(new BlocksMC1_12());
|
||||
setups.add(new BlocksMC1_13());
|
||||
setups.add(new BlocksMC1_14());
|
||||
}
|
||||
catch(Throwable t){}
|
||||
for (final BlockPropertiesSetup setup : setups){
|
||||
|
||||
@@ -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.";
|
||||
@@ -287,6 +293,9 @@ public abstract class ConfPaths {
|
||||
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.";
|
||||
@@ -450,7 +459,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";
|
||||
@@ -472,7 +483,13 @@ 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_CLICKPATTERN = FIGHT + "clickpattern.";
|
||||
public static final String FIGHT_CLICKPATTERN_CHECK = FIGHT_CLICKPATTERN + SUB_ACTIVE;
|
||||
public static final String FIGHT_CLICKPATTERN_RANGE = FIGHT_CLICKPATTERN + "range";
|
||||
public static final String FIGHT_CLICKPATTERN_PENALTY = FIGHT_CLICKPATTERN + "penalty";
|
||||
public static final String FIGHT_CLICKPATTERN_ACTIONS = FIGHT_CLICKPATTERN + "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)?
|
||||
@@ -509,6 +526,9 @@ 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.";
|
||||
@@ -528,6 +548,9 @@ 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.";
|
||||
@@ -555,6 +578,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.";
|
||||
@@ -594,6 +619,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.
|
||||
@@ -741,6 +767,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_FIGHTSYNC = NET + "fightsync.";
|
||||
@@ -931,7 +959,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));
|
||||
|
||||
@@ -20,6 +20,7 @@ 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;
|
||||
|
||||
@@ -145,6 +146,8 @@ public class DefaultConfig extends ConfigFile {
|
||||
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKBREAK_WRONGBLOCK_LEVEL, 10, 785);
|
||||
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:0:5:if cancel vl>30 log:bwrong:0:5:cif cancel cmd:kickwb", 785);
|
||||
|
||||
|
||||
@@ -182,6 +185,8 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_LIMIT, 22, 785);
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_SHORTTERM_TICKS, 10, 785);
|
||||
set(ConfPaths.BLOCKPLACE_FASTPLACE_SHORTTERM_LIMIT, 6, 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>100 log:fastplace:3:5:cif cancel", 785);
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_REACH_CHECK, "default", 785);
|
||||
@@ -196,6 +201,8 @@ public class DefaultConfig extends ConfigFile {
|
||||
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_CHECK, "default", 785);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_INTERVAL, 45L, 785);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_IMPROBABLE_FEEDONLY, false, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_IMPROBABLE_WEIGHT, 0.6, 1154);
|
||||
set(ConfPaths.BLOCKPLACE_SPEED_ACTIONS,
|
||||
"cancel vl>150 log:bpspeed:3:5:if cancel vl>1000 log:bpspeed:3:5:cif cancel", 785);
|
||||
|
||||
@@ -317,7 +324,9 @@ public class DefaultConfig extends ConfigFile {
|
||||
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_IMPROBABLE_FEEDONLY, false, 1154);
|
||||
set(ConfPaths.COMBINED_YAWRATE_IMPROBABLE_WEIGHT, 100.0, 1154);
|
||||
// set(ConfPaths.COMBINED_YAWRATE_IMPROBABLE, true, 785);
|
||||
|
||||
// FIGHT
|
||||
set(ConfPaths.FIGHT_ACTIVE, "default", 1144);
|
||||
@@ -334,6 +343,11 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.FIGHT_ANGLE_THRESHOLD_YAW, 50, 1153);
|
||||
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_CLICKPATTERN_CHECK, "default", 1154);
|
||||
set(ConfPaths.FIGHT_CLICKPATTERN_RANGE, 8, 1154);
|
||||
set(ConfPaths.FIGHT_CLICKPATTERN_PENALTY, 150L, 1154);
|
||||
set(ConfPaths.FIGHT_CLICKPATTERN_ACTIONS, "vl>2 cancel vl>6 log:clickpat:0:7:cif cancel", 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_CRITICAL_CHECK, "default", 785);
|
||||
set(ConfPaths.FIGHT_CRITICAL_FALLDISTANCE, 0.06251, 785);
|
||||
@@ -364,6 +378,8 @@ public class DefaultConfig extends ConfigFile {
|
||||
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_IMPROBABLE_FEEDONLY, false, 1154);
|
||||
set(ConfPaths.FIGHT_REACH_IMPROBABLE_WEIGHT, 2.0, 1154);
|
||||
set(ConfPaths.FIGHT_REACH_ACTIONS, "cancel vl>10 log:freach:2:5:if cancel", 785);
|
||||
|
||||
set(ConfPaths.FIGHT_SELFHIT_CHECK, "default", 785);
|
||||
@@ -374,6 +390,8 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.FIGHT_SPEED_ACTIONS, "cancel vl>50 log:fspeed:0:5:if cancel", 785);
|
||||
set(ConfPaths.FIGHT_SPEED_SHORTTERM_TICKS, 7, 785);
|
||||
set(ConfPaths.FIGHT_SPEED_SHORTTERM_LIMIT, 6, 785);
|
||||
set(ConfPaths.FIGHT_SPEED_IMPROBABLE_FEEDONLY, false, 1154);
|
||||
set(ConfPaths.FIGHT_SPEED_IMPROBABLE_WEIGHT, 2.0, 1154);
|
||||
|
||||
set(ConfPaths.FIGHT_WRONGTURN_CHECK, "default", 1143);
|
||||
set(ConfPaths.FIGHT_WRONGTURN_ACTIONS, "cancel cmd:kick_wrongturn log:log_wrongturn:0:15:fci", 1143);
|
||||
@@ -393,6 +411,7 @@ public class DefaultConfig extends ConfigFile {
|
||||
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_IMPROBABLE_WEIGHT, 0.7, 1154);
|
||||
set(ConfPaths.INVENTORY_FASTCLICK_ACTIONS, "cancel vl>50 log:fastclick:3:5:cif cancel", 785);
|
||||
|
||||
set(ConfPaths.INVENTORY_INSTANTBOW_CHECK, "default", 785);
|
||||
@@ -412,6 +431,7 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.INVENTORY_FASTCONSUME_ACTIONS, "log:fastconsume:2:5:if cancel", 785);
|
||||
|
||||
set(ConfPaths.INVENTORY_INVENTORYMOVE_CHECK, "default", 1153);
|
||||
set(ConfPaths.INVENTORY_INVENTORYMOVE_DISABLECREATIVE, true, 1153);
|
||||
set(ConfPaths.INVENTORY_INVENTORYMOVE_ACTIONS, "log:inventorymove:2:5:if cancel", 785);
|
||||
|
||||
set(ConfPaths.INVENTORY_GUTENBERG_CHECK, "default", 785);
|
||||
@@ -451,6 +471,15 @@ 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);
|
||||
@@ -563,13 +592,15 @@ public class DefaultConfig extends ConfigFile {
|
||||
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_IMPROBABLE_WEIGHT, 2.0, 1154);
|
||||
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);
|
||||
|
||||
// FightSync
|
||||
set(ConfPaths.NET_FIGHTSYNC_ACTIVE, "default", 1154);
|
||||
set(ConfPaths.NET_FIGHTSYNC_THRESHOLD, 5, 1154);
|
||||
set(ConfPaths.NET_FIGHTSYNC_RESETCOUNT, 11, 1154);
|
||||
set(ConfPaths.NET_FIGHTSYNC_ACTIONS, "vl<10 log:fightsync:0:5:if", 1154);
|
||||
set(ConfPaths.NET_FIGHTSYNC_ACTIONS, "vl>10 log:fightsync:0:5:if", 1154);
|
||||
|
||||
// FlyingFrequency
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_ACTIVE, "default", 785);
|
||||
set(ConfPaths.NET_FLYINGFREQUENCY_SECONDS, 5, 785);
|
||||
@@ -602,7 +633,7 @@ public class DefaultConfig extends ConfigFile {
|
||||
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 + ".angle", start + "tried to hit multiple entities at the same time (Tags [tags])" + 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);
|
||||
@@ -617,9 +648,9 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.STRINGS + ".bwrong", start + "broke another block than clicked" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".captcha", "[player] failed captcha repeatedly" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".chatnormal", start + "potentially annoying chat" + end, 785);
|
||||
set(ConfPaths.STRINGS + ".clickpat", start + " seems to be clicking with bot-like frequencies" + 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 + ".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);
|
||||
@@ -643,7 +674,7 @@ public class DefaultConfig extends ConfigFile {
|
||||
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 + ".inventorymove", start + "interacted with inventory while it was not possible (tags [tags])" + 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);
|
||||
@@ -665,7 +696,6 @@ public class DefaultConfig extends ConfigFile {
|
||||
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 + ".msgtempdenylogin", "You are temporarily denied to join this server.", 785);
|
||||
@@ -702,92 +732,6 @@ 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);
|
||||
for (final String DeadCoralType : Arrays.asList(
|
||||
"DEAD_TUBE",
|
||||
"DEAD_BRAIN",
|
||||
@@ -801,12 +745,6 @@ public class DefaultConfig extends ConfigFile {
|
||||
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);
|
||||
|
||||
+4944
-4906
File diff suppressed because it is too large.
Load diff
@@ -365,7 +365,7 @@ public class MaterialUtil {
|
||||
public static final Set<Material> WATER = Collections.unmodifiableSet(
|
||||
BridgeMaterial.getAllBlocks("water", "stationary_water"));
|
||||
public static final Set<Material> NEWLIQ = Collections.unmodifiableSet(
|
||||
BridgeMaterial.getAllBlocks("SEA_PICKLE", "TALL_SEAGRASS", "KELP_PLANT", "SEAGRASS"));
|
||||
BridgeMaterial.getAllBlocks("TALL_SEAGRASS", "KELP_PLANT", "SEAGRASS"));
|
||||
|
||||
/** Wood types (1.13 rather). */
|
||||
public static final Set<Material> WOOD_BLOCKS = Collections.unmodifiableSet(addBlocks(
|
||||
@@ -518,6 +518,15 @@ public class MaterialUtil {
|
||||
Material.LEVER,
|
||||
BridgeMaterial.END_PORTAL,
|
||||
BridgeMaterial.NETHER_PORTAL))
|
||||
|
||||
));
|
||||
/**
|
||||
* Collections of blocks that are allowed all types of movement.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static final Set<Material> LIQUID_BLOCKS = Collections.unmodifiableSet(join(
|
||||
DEAD_CORAL_PARTS,
|
||||
NEWLIQ
|
||||
));
|
||||
|
||||
////////////////////
|
||||
|
||||
+6
@@ -47,6 +47,12 @@ public class DefaultComponentFactory {
|
||||
|
||||
public DefaultComponentFactory() {
|
||||
for (Activation condition : Arrays.asList(
|
||||
new Activation()
|
||||
.neutralDescription("ProtocolLib 4.5.0 or later for Minecraft 1.14.x")
|
||||
.pluginVersionGT("ProtocolLib", "4.5.0", true)
|
||||
.minecraftVersionBetween("1.14", true, "1.15", false)
|
||||
.advertise(true)
|
||||
,
|
||||
new Activation()
|
||||
.neutralDescription("ProtocolLib 4.4.0 or later for Minecraft 1.13.x")
|
||||
.pluginVersionGT("ProtocolLib", "4.4.0", true)
|
||||
|
||||
+8
-8
@@ -49,6 +49,14 @@ public class MCAccessFactory {
|
||||
MCAccess mcAccess = null;
|
||||
// Try to set up native access.
|
||||
|
||||
// Bukkit API only: 1.13 (and possibly later).
|
||||
try {
|
||||
return new MCAccessBukkitModern();
|
||||
}
|
||||
catch(Throwable t) {
|
||||
throwables.add(t);
|
||||
}
|
||||
|
||||
// CraftBukkit (dedicated).
|
||||
if (config.enableCBDedicated) {
|
||||
mcAccess = getMCAccessCraftBukkit(throwables);
|
||||
@@ -67,14 +75,6 @@ public class MCAccessFactory {
|
||||
}
|
||||
}
|
||||
|
||||
// Bukkit API only: 1.13 (and possibly later).
|
||||
try {
|
||||
return new MCAccessBukkitModern();
|
||||
}
|
||||
catch(Throwable t) {
|
||||
throwables.add(t);
|
||||
}
|
||||
|
||||
// Try to set up api-only access (since 1.4.6).
|
||||
try {
|
||||
mcAccess = new MCAccessBukkit();
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
### Build Status
|
||||
[](https://semaphoreci.com/captainobvious0/nocheatplus)
|
||||
|
||||
NoCheatPlus
|
||||
---------
|
||||
NoCheatPlus is a fork of the famous anti-cheat plugin [NoCheat](https://dev.bukkit.org/projects/nocheat/) created by [Evenprime](https://github.com/Evenprime). NoCheatPlus attempts to enforce "vanilla Minecraft" mechanics, as well as preventing players from abusing weaknesses in Minecraft or its protocol, making your server more safe. Organized in different sections, various checks are performed to test players doing, covering a wide range including flying and speeding, fighting hacks, fast block breaking and nukers, inventory hacks, chat spam and other types of malicious behaviour. For a more complete list have a look at the always outdated [Features Page](https://github.com/NoCheatPlus/Docs/wiki/Features).
|
||||
@@ -15,78 +18,3 @@ Hints
|
||||
* Don't use tabs in the config.yml file.
|
||||
* Use [ProtocolLib](https://dev.bukkit.org/bukkit-plugins/protocollib) for full efficiency of the fight checks and other. Using a version of ProtocolLib that is supported by NCP is essential, as otherwise some checks will be disabled.
|
||||
* For compatibility with other plugins such as mcMMO, citizens and more check out [CompatNoCheatPlus](https://dev.bukkit.org/projects/compatnocheatplus-cncp/).
|
||||
|
||||
Links
|
||||
---------
|
||||
|
||||
###### Project
|
||||
* [NoCheatPlus at SpigotMC](https://www.spigotmc.org/resources/nocheatplus2015-07-25.26/)
|
||||
* [NoCheatPlus at BukkitDev](https://dev.bukkit.org/projects/nocheatplus/)
|
||||
|
||||
###### Download
|
||||
* [BukkitDev (approved by staff)](https://dev.bukkit.org/projects/nocheatplus/files/)
|
||||
* [SpigotMC (not inspected by staff)](https://www.spigotmc.org/resources/nocheatplus2015-07-25.26/updates)
|
||||
* [Jenkins (all builds including development versions)](https://ci.md-5.net/job/NoCheatPlus/)
|
||||
|
||||
###### Support and Documentation
|
||||
* [Issues/Tickets](https://github.com/NoCheatPlus/Issues/issues)
|
||||
* [Wiki](https://github.com/NoCheatPlus/Docs/wiki)
|
||||
* [Configuration](https://github.com/NoCheatPlus/Docs/wiki/Configuration)
|
||||
* [Permissions](https://github.com/NoCheatPlus/Docs/wiki/Permissions)
|
||||
* [Commands](https://github.com/NoCheatPlus/Docs/wiki/Commands)
|
||||
|
||||
###### Developers
|
||||
* [License (GPLv3)](https://github.com/NoCheatPlus/NoCheatPlus/blob/master/LICENSE.txt)
|
||||
* [API](https://github.com/NoCheatPlus/Docs/wiki/API)
|
||||
* [Contribute](https://github.com/NoCheatPlus/NoCheatPlus/blob/master/CONTRIBUTING.md)
|
||||
|
||||
###### Related Plugins
|
||||
* [ProtocolLib at BukkitDev](https://dev.bukkit.org/bukkit-plugins/protocollib)
|
||||
* [CompatNoCheatPlus at BukkitDev](https://dev.bukkit.org/projects/compatnocheatplus-cncp/)
|
||||
|
||||
###### Obtain a build of Spigot
|
||||
* [Get the latest BuildTools.jar](https://hub.spigotmc.org/jenkins/job/BuildTools/)
|
||||
* [Run according to instructions](https://www.spigotmc.org/wiki/buildtools/)
|
||||
* ([Server installation instructions](https://www.spigotmc.org/wiki/spigot-installation/))
|
||||
|
||||
Compiling NoCheatPlus
|
||||
---------
|
||||
* NoCheatPlus used to be compiled with java 6 compliance (note OpenJDK, possibly we'll switch to 8 directly, once appropriate, e.g. with ProtocolLib dropping support for 7.).
|
||||
* We use [Maven](http://maven.apache.org/download.cgi) 3 to handle the dependencies. Tested both with Eclipse and Jenkins is Maven 3.3.9.
|
||||
* You can compile with this Maven goal: `mvn clean package`, for a build without any of the "non free" modules, which depened on not publicly downloadable resources, such as the CraftBukkit/Spigot server jar - the reflection based compatibility module is still contained.
|
||||
* In order to include a pre-built jar with the "non free" modules contained, use `-P nonfree_include`.
|
||||
* To also (re-) build "non free" compatibility modules, use `-P nonfree_build` as well as activating the appropriate module to build via a profile such as `-P cbdev` - see the tables below for reference.
|
||||
* Have a look at the NCPCompatNonFree sub module for reference on how to add custom compatibility modules. If you add custom modules with a different package naming than `fr.neatmonster`, you might have to update the includes section within NCPCompatNonFreeJar as well. The related factories are located within the NCPPlugin module (e.g. MCAccessFactory).
|
||||
* "Non free" jar file dependencies needed for the dedicated compat modules, which your local maven repository might be missing, can be installed manually.
|
||||
Example for Eclipse with embedded maven:
|
||||
Add a new maven build run configuration, name it appropriately, e.g. ```Install CB 1.7.5```.
|
||||
Set goals to: ```install:install-file -Dfile=<PATH TO JAR> -DgroupId=org.bukkit -DartifactId=craftbukkit -Dversion=1.7.5-R0.1-SNAPSHOT -Dpackaging=jar```
|
||||
On Windows the <PATH TO JAR> might look like: ```X:\...\craftbukkit\3042\craftbukkit-1.7.5-R0.1-20140408.020329-16.jar```
|
||||
To let it run you might have to set the base directory, e.g. to ```${workspace_loc}```, it does not seem to have significance.
|
||||
Do set the correct version alongside the file name. On newer version of maven, you might do with much simplified goals, because the pom files inside the jars are parsed.
|
||||
* **The latest versions of BuildTools.jar will automatically install the created server jars into the local .m2 repository (e.g. on linux) - provided configuration paths are standard. Thus you don't need to do this manually anymore, if you then build NCP with the specific profile, if you have run BuildTools.jar to generate the server jars on that machine/environment.**
|
||||
|
||||
Options and profiles related to enabling/disabling including/building "non free" compatibility modules.
|
||||
|
||||
| Profile | Parameter | Description |
|
||||
| :------------------ | :-------------- | :-------------- |
|
||||
| `-P nonfree_include` | _none_ | The "non free" modules are included via a pre-built jar file from the repository. |
|
||||
| `-P nonfree_build` | _none_ | Enable building "non free" compatibility modules. The NCPCompatNonFree jar file is built/installed/(deployed). |
|
||||
| _none_ | _none_ | The "non free" modules are neither built, nor included via a pre-built jar file. |
|
||||
|
||||
Profiles for choice of "non free" compatibility modules to build:
|
||||
|
||||
| Profile | Description |
|
||||
| :------------------ | :-------------- |
|
||||
| _none_ | Default build without any of the native access modules, might pose compatibility issues with latest Minecraft versions. The reflection based module is included here. |
|
||||
| `-P all` | All compatibility modules. |
|
||||
| `-P cbdev` | The latest version in development. |
|
||||
| `-P spigot1_12_r1` | Spigot 1.12 R1 (MC 1.12-1.12.2). |
|
||||
| `-P spigot1_11_r1` | Spigot 1.11 R1 (MC 1.11-1.11.2). |
|
||||
| `-P spigot1_10_r1` | Spigot 1.10 R1 (MC 1.10-1.10.2). |
|
||||
| `-P spigot1_9_r2` | Spigot 1.9 R2 (MC 1.9.4). |
|
||||
| `-P spigot1_8_r3` | Spigot 1.8 R3 (MC 1.8.4-1.8.8). |
|
||||
| `-P spigot1_7_r4` | Spigot 1.7 R4 (MC 1.7.10). |
|
||||
| `-P cblegacy` | The pre-DMCA CraftBukkit builds. |
|
||||
|
||||
(On the long run, only the latest module for a major Minecraft release may be be kept, such as 1_8_r3 for all of 1.8.x.)
|
||||
Reference in new issue
Block a user